summaryrefslogtreecommitdiff
path: root/sysutils/lsof/Makefile
blob: 4c1bac9d731733c8e3b404004df9e5417fe4376d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# note: If someone has a fix for a particular ARCH please feel free
#       to commit it.  I (ler) don't have access to all the ARCH's

PORTNAME=	lsof
DISTVERSION=	4.99.3
PORTREVISION=	2
PORTEPOCH=	8
CATEGORIES=	sysutils

MAINTAINER=	ler@FreeBSD.org
COMMENT=	Lists information about open files (similar to fstat(1))
WWW=		https://github.com/lsof-org/lsof

LICENSE=	lsof
LICENSE_NAME=	lsof
LICENSE_FILE=	${FILESDIR}/LICENSE
LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept

USES=		compiler cpe shebangfix
CPE_VENDOR=	lsof_project
USE_GITHUB=	yes
GH_ACCOUNT=	lsof-org

PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
PATCHFILES=	003c8463fd6b8cf2d25a4b10a874825f8f4b471b.patch \
		5233d10ec63ba674c250bdc4308c3a22a04f6d20.patch
PATCH_DIST_STRIP=	-p1

SHEBANG_FILES=	scripts/*.pl

HAS_CONFIGURE=	yes

CFLAGS_powerpcspe=	-DBOOKE

OPTIONS_DEFINE_powerpc64=	AIM BOOKE
OPTIONS_DEFAULT_powerpc64=	AIM

AIM_DESC=	Set for AIM hardware
BOOKE_DESC=	Set for BOOKE hardware

AIM_CFLAGS=	-DAIM
BOOKE_CFLAGS=	-DBOOKE

.include <bsd.port.pre.mk>

CONFIGURE_SCRIPT=	Configure
CONFIGURE_ARGS=		-n freebsd
CONFIGURE_ENV=		FREEBSD_SYS="${SRC_BASE}/sys" \
			LSOF_CC="${CC}"
BUILD_DEPENDS=		${LOCALBASE}/bin/bash:shells/bash 

# GCC needs -lzfs -lzpool for reasons unknown.  If someone can
# figure out why, I (ler) am all ears.
.if ${CHOSEN_COMPILER_TYPE} == gcc
CONFIGURE_ENV+=	LSOF_CFGL="-lzfs -lzpool"
.endif

.if !exists(${SRC_BASE}/sys/kern/kern_lockf.c)
IGNORE+=	requires kernel sources
.endif

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/lsof ${STAGEDIR}${PREFIX}/sbin
	(cd ${WRKSRC} && /usr/bin/soelim Lsof.8 > ${WRKSRC}/lsof.8)
	${INSTALL_MAN} ${WRKSRC}/lsof.8 ${STAGEDIR}${PREFIX}/share/man/man8/lsof.8
	@${MKDIR} ${STAGEDIR}${PREFIX}/share/lsof
	${INSTALL_SCRIPT} ${WRKSRC}/scripts/* ${STAGEDIR}${PREFIX}/share/lsof
	@${CHMOD} 0444 ${STAGEDIR}${PREFIX}/share/lsof/00*

.include <bsd.port.post.mk>