diff options
author | sbd <sbd> | 2010-04-30 06:53:06 +0000 |
---|---|---|
committer | sbd <sbd> | 2010-04-30 06:53:06 +0000 |
commit | 1d3aaddd92ca27c55d363b4cd5474a5a962f5142 (patch) | |
tree | efafb0fd5a9167d213be06aea8c60b2248d3b657 /sysutils | |
parent | ea67ba90e4e597338746be036cf35e5093f21bd8 (diff) | |
download | pkgsrc-1d3aaddd92ca27c55d363b4cd5474a5a962f5142.tar.gz |
Move lsof from using the LSOF_MORE_SECURE and LSOF_LESS_SECURE_SOCKETS to
using pkg options lsof-more-secure and lsof-less-secure-sockets.
Also change the way the option are applied, the same way that the Customize
script does and it works on all supported dialects.
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/lsof/Makefile | 7 | ||||
-rw-r--r-- | sysutils/lsof/distinfo | 4 | ||||
-rw-r--r-- | sysutils/lsof/options.mk | 39 | ||||
-rw-r--r-- | sysutils/lsof/patches/patch-aa | 29 |
4 files changed, 44 insertions, 35 deletions
diff --git a/sysutils/lsof/Makefile b/sysutils/lsof/Makefile index b09fe1e18a2..83dbf00efff 100644 --- a/sysutils/lsof/Makefile +++ b/sysutils/lsof/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.103 2010/03/21 16:29:43 wiz Exp $ +# $NetBSD: Makefile,v 1.104 2010/04/30 06:53:06 sbd Exp $ DISTNAME= lsof_4.78 PKGNAME= ${DISTNAME:S/_/-/}.${OS_VERSION} @@ -23,8 +23,6 @@ CONFIGURE_SCRIPT= ./Configure CONFIGURE_ARGS+= -n ${LOWER_OPSYS} CONFIGURE_ENV+= LSOF_CC="${CC} ${CFLAGS}" MAKE_FLAGS+= LSOF_BLDCMT="NetBSD pkgsrc rocks!" -CPPFLAGS+= -DLSOF_MORE_SECURE=${LSOF_MORE_SECURE} \ - -DLSOF_LESS_SECURE_SOCKETS=${LSOF_LESS_SECURE_SOCKETS} OSVERSION_SPECIFIC= yes TMPWRK= ${WRKDIR}/${DISTNAME} @@ -41,6 +39,7 @@ USE_TOOLS+= gtar pax perl:run PKG_INSTALLATION_TYPES= overwrite pkgviews .include "../../mk/bsd.prefs.mk" +.include "options.mk" REAL_GROUP= ${REAL_ROOT_GROUP} .if ${OPSYS} == "NetBSD" @@ -51,8 +50,6 @@ MAKE_ENV+= CPPFLAGS= .endif INSTALLATION_DIRS= ${PKGMANDIR}/man8 sbin -LSOF_MORE_SECURE?= 0 - post-extract: @(cd ${TMPWRK} ; \ EXPMD5=`${GREP} 'MD5 (' README.${DISTNAME} | ${SED} 's/^[ ]*//'` ; \ diff --git a/sysutils/lsof/distinfo b/sysutils/lsof/distinfo index 9c9e3e07fdf..743ac863561 100644 --- a/sysutils/lsof/distinfo +++ b/sysutils/lsof/distinfo @@ -1,9 +1,9 @@ -$NetBSD: distinfo,v 1.77 2009/08/11 20:53:06 apb Exp $ +$NetBSD: distinfo,v 1.78 2010/04/30 06:53:06 sbd Exp $ SHA1 (lsof_4.78.tar.bz2) = 0379fc9f38a931ce19e8386e662314d96fc2a099 RMD160 (lsof_4.78.tar.bz2) = 50d71e500f1109cda717b73ce209c0e100a6dbe9 Size (lsof_4.78.tar.bz2) = 756729 bytes -SHA1 (patch-aa) = 73c41a9d897425c8482f6f1673b38304ec794b47 +SHA1 (patch-aa) = 4469a5fed540e3c5635b6082efedc477ea96a382 SHA1 (patch-ab) = 1501d8b0e6fd2c61949ba0d447c7b726655725c4 SHA1 (patch-ac) = dac0fcdfee97d42c8f23684a4321519b9f8698d9 SHA1 (patch-ad) = 4bd73dea4770c7f5a43be0d096c26e7d6728dd2c diff --git a/sysutils/lsof/options.mk b/sysutils/lsof/options.mk new file mode 100644 index 00000000000..132a4c4ba84 --- /dev/null +++ b/sysutils/lsof/options.mk @@ -0,0 +1,39 @@ +# $NetBSD: options.mk,v 1.1 2010/04/30 06:53:06 sbd Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.lsof +PKG_SUPPORTED_OPTIONS= lsof-more-secure lsof-less-secure-sockets + +.if defined(LSOF_MORE_SECURE) +. if !empty(LSOF_MORE_SECURE:M1) +PKG_LEGACY_OPTIONS+= lsof-more-secure +PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_MORE_SECURE set to 1, use PKG_OPTIONS.lsof+=lsof-more-secure instead." +. elif !empty(LSOF_MORE_SECURE:M0) +PKG_LEGACY_OPTIONS+= -lsof-more-secure +PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_MORE_SECURE set to 0, use PKG_OPTIONS.lsof+=-lsof-more-secure instead." +. endif +.endif + +.if defined(LSOF_LESS_SECURE_SOCKETS) +. if !empty(LSOF_LESS_SECURE_SOCKETS:M1) +PKG_LEGACY_OPTIONS+= lsof-less-secure-sockets +PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_LESS_SECURE_SOCKETS set to 1, use PKG_OPTIONS.lsof+=lsof-less-secure-sockets instead." +. elif !empty(LSOF_LESS_SECURE_SOCKETS:M0) +PKG_LEGACY_OPTIONS+= -lsof-less-secure-sockets +PKG_OPTIONS_DEPRECATED_WARNINGS+= "Deprecated variable LSOF_LESS_SECURE_SOCKETS set to 0, use PKG_OPTIONS.lsof+=lsof-less-secure-sockets instead." +. endif +.endif + +.include "../../mk/bsd.options.mk" + +## Emulate what ./Customize does. +post-configure: + ${RUN} cd ${WRKSRC}; ${MV} -f machine.h machine.h.orig ; \ + ${CAT} machine.h.orig > machine.h ; \ + ${ECHO} "#undef HASSECURITY" >> machine.h ; \ + ${ECHO} "#undef HASNOSOCKSECURITY" >> machine.h ; +.if !empty(PKG_OPTIONS:Mlsof-more-secure) + ${ECHO} "#define HASSECURITY 1" >> ${WRKSRC}/machine.h +. if !empty(PKG_OPTIONS:Mlsof-less-secure-sockets) + ${ECHO} "#define HASNOSOCKSECURITY 1" >> ${WRKSRC}/machine.h +. endif +.endif diff --git a/sysutils/lsof/patches/patch-aa b/sysutils/lsof/patches/patch-aa index 41419e85f20..61f5628e9d5 100644 --- a/sysutils/lsof/patches/patch-aa +++ b/sysutils/lsof/patches/patch-aa @@ -1,9 +1,4 @@ -$NetBSD: patch-aa,v 1.27 2008/05/17 23:53:29 christos Exp $ - -If LSOF_MORE_SECURE is non-zero, compile lsof with security, and -only let unprivileged (non-root) users view their own open files. -Set LSOF_LESS_SECURE_SOCKETS to non-zero in order to allow non-root -users to see open sockets, even when LSOF_MORE_SECURE is set. +$NetBSD: patch-aa,v 1.28 2010/04/30 06:53:07 sbd Exp $ --- dialects/n+obsd/machine.h.orig 2006-03-28 16:54:17.000000000 -0500 +++ dialects/n+obsd/machine.h 2008-05-17 18:53:29.000000000 -0400 @@ -18,25 +13,3 @@ users to see open sockets, even when LSOF_MORE_SECURE is set. /* -@@ -410,7 +414,9 @@ - * (the one that its user logged on with) of the lsof process. - */ - --/* #define HASSECURITY 1 */ -+#if LSOF_MORE_SECURE -+#define HASSECURITY 1 -+#endif - - - /* -@@ -419,7 +425,9 @@ - * listing is selected by the "-i" option. - */ - --/* #define HASNOSOCKSECURITY 1 */ -+#if LSOF_LESS_SECURE_SOCKETS -+#define HASNOSOCKSECURITY 1 -+#endif - - - /* |