pkgsrc/sysutils/lsof/Makefile
bsiegert 19052cb90f Update lsof to 4.88. From David H. Gutteridge in PR pkg/50487.
Reduced to 50 the number of open file descriptors lsof
attempts to close while trying to protect itself from a
file descriptor exec() attack.  This limits the overhead
lsof incurs on systems that have large file descriptor
limits, yet provides sufficient open descriptors for the
library functions lsof calls.

Updated for changes in FreeBSD 10 with advice from Eygene
Ryabinkin <rea@freebsd.org>.  Taught Configure to recognize
FreeBSD 8.4.

Herein am noting that lsof for Solaris 10 or 11 is no longer
supported.  I no longer have test systems.  Some support is
still available from Casper Dik <Casper.Dik@oracle.com> and a
Solaris 11 patch he provided is included in this revision.

Initialized local variables in the Linux process_id() function.
Jia He <jiakernel@gmail.com> reported the problem.

Added support for FreeBSD 11.

Updated FreeBSD ZFS Configure stanza to supply a dummy
opt_kdtrace.h when needed.

Added tmpfs file system support for FreeBSD.

Since a test system is no longer available, dropped the
claim of FreeBSD 4.9 support.

Added the +|-E options for Linux.  -E displays endpoint info;
+E displays endpoint info and endpopint files.  Masatake YAMATO
<yamato@redhat.com> requested this support and suggested code
to implement it.

Fixed a Linux bug handling processes whose command includes a
non-printing character, particularly a NEWLINE character, and
clarified printing of single '\\' characters in command and
file names.  Stephane Chazelas <stephane.chazelas@gmail.com>
reported the problem.

Added support for Linux RDMA and CRYPTO protocal names and UNIX
socket type with code from Masatake YAMATO <yamato@redhat.com>.

Fixed field output to insure that the field descriptor field is
always selected, since it identifies the file set.  The bug was
reported by Gary Plewa <gary.m.plewa-1@lowes.com>.
2015-12-29 12:42:57 +00:00

106 lines
3.4 KiB
Makefile

# $NetBSD: Makefile,v 1.121 2015/12/29 12:42:57 bsiegert Exp $
DISTNAME= lsof_4.88
PKGNAME= ${DISTNAME:S/_/-/}
CATEGORIES= sysutils
MASTER_SITES= ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/ \
ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/NEW/ \
ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/OLD/ \
ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/ \
ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/NEW/ \
ftp://ftp.cerias.purdue.edu/pub/tools/unix/sysutils/lsof/OLD/ \
ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/ \
ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/NEW/ \
ftp://ftp.fu-berlin.de/pub/unix/tools/lsof/OLD/ \
ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/ \
ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/NEW/ \
ftp://gd.tuwien.ac.at/utils/admin-tools/lsof/OLD/ \
ftp://sunsite.ualberta.ca/pub/Mirror/lsof/ \
ftp://sunsite.ualberta.ca/pub/Mirror/lsof/NEW/ \
ftp://sunsite.ualberta.ca/pub/Mirror/lsof/OLD/
EXTRACT_SUFX= .tar.bz2
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://people.freebsd.org/~abe/
COMMENT= Lists information about open files
WRKSRC= ${WRKDIR}/${DISTNAME}/${SRCBALL_NAME}
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT= ./Configure
CONFIGURE_ARGS+= -n ${LOWER_OPSYS}
CONFIGURE_ENV+= LSOF_CC="${CC} ${CFLAGS}"
MAKE_FLAGS+= LSOF_BLDCMT="NetBSD pkgsrc rocks!"
OSVERSION_SPECIFIC= yes
TMPWRK= ${WRKDIR}/${DISTNAME}
SRCBALL_NAME= ${DISTNAME}_src
REPLACE_PERL+= scripts/sort_res.perl5 scripts/count_pf.perl5 \
scripts/list_NULf.perl5 scripts/big_brother.perl5 \
scripts/identd.perl5 scripts/shared.perl5 \
scripts/idrlogin.perl5 scripts/count_pf.perl \
scripts/idrlogin.perl scripts/list_fields.perl \
scripts/watch_a_file.perl
USE_TOOLS+= gtar pax perl:run
TEST_DIRS= tests
TEST_TARGET= test
INTERACTIVE_STAGE+= test
.include "../../mk/bsd.prefs.mk"
.include "options.mk"
REAL_GROUP= ${REAL_ROOT_GROUP}
.if ${OPSYS} == "NetBSD"
REAL_GROUP= kmem
CONFIGURE_ENV+= NETBSD_SYS="${NETBSDSRCDIR}/sys"
CPPFLAGS+= -D_KMEMUSER
CPPFLAGS+= "-DVFS_PROTOS(fsname)="
.elif ${OPSYS} == "FreeBSD"
BUILDLINK_PASSTHRU_DIRS+= /usr/src/sys
.elif ${OPSYS} == "SunOS"
REAL_GROUP= sys
MAKE_ENV+= CPPFLAGS=
CONFIGURE_ENV+= LSOF_RANLIB="/bin/true"
.endif
INSTALLATION_DIRS= ${PKGMANDIR}/man8 sbin
post-extract:
.if ${OPSYS} == "FreeBSD"
@(if [ ! -x /usr/src/sys ]; then \
${ECHO} "Lsof requires kernel sources to be found in /usr/src/sys." ; \
exit 1 ; \
fi)
.endif
@(cd ${TMPWRK} ; \
EXPMD5=`${GREP} 'MD5 (' README.${DISTNAME} | ${SED} 's/^[ ]*//'` ; \
CALCMD5=`${DIGEST} MD5 ${SRCBALL_NAME}.tar` ; \
if [ "$${EXPMD5}"X != "$${CALCMD5}"X ]; then \
${ECHO} "Expected and calculated MD5 signatures don't agree." ; \
${ECHO} "($$EXPMD5 != $$CALCMD5)" ; \
exit 1 ; \
fi ; \
if [ X${EXTRACT_USING} = Xgtar ]; then \
${GTAR} -xf ${SRCBALL_NAME}.tar; \
else \
pax -O -r < ${SRCBALL_NAME}.tar; \
fi)
@( cd ${WRKSRC} ; ${ECHO} "y" | ./Inventory || exit 1 )
INSTALLATION_DIRS+= sbin ${PKGMANDIR}/man8 share/lsof
SPECIAL_PERMS+= ${PREFIX}/sbin/lsof ${REAL_ROOT_USER} ${REAL_GROUP} 2755
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/lsof ${DESTDIR}${PREFIX}/sbin
${INSTALL_MAN} ${WRKSRC}/lsof.8 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/lsof.8
${INSTALL_SCRIPT} ${WRKSRC}/scripts/* ${DESTDIR}${PREFIX}/share/lsof
@${CHMOD} 0444 ${DESTDIR}${PREFIX}/share/lsof/00*
opt:
.for _dir_ in ${TEST_DIRS}
${RUN}${_ULIMIT_CMD} \
cd ${WRKSRC} && cd ${_dir_} && \
${TEST_MAKE_CMD} opt
.endfor
.include "../../mk/bsd.pkg.mk"