aboutsummaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2012-01-26 10:34:46 +0800
committercy <cy@FreeBSD.org>2012-01-26 10:34:46 +0800
commite7bbd8d278c213d252183d2f9b40de075dff2b43 (patch)
tree6cb56c669a4c09609410d23befa6c18732ecc88f /security
parent4748bfcedaafca4e1a28c88e0cd43560a8461028 (diff)
downloadfreebsd-ports-gnome-e7bbd8d278c213d252183d2f9b40de075dff2b43.tar.gz
freebsd-ports-gnome-e7bbd8d278c213d252183d2f9b40de075dff2b43.tar.zst
freebsd-ports-gnome-e7bbd8d278c213d252183d2f9b40de075dff2b43.zip
Binary package improvements.
User option to specify the location of database files. (Can still be overriden in make.conf).
Diffstat (limited to 'security')
-rw-r--r--security/tripwire/Makefile48
-rw-r--r--security/tripwire/files/patch-install-install.sh51
2 files changed, 83 insertions, 16 deletions
diff --git a/security/tripwire/Makefile b/security/tripwire/Makefile
index d0f2248aad69..c38da3f2b165 100644
--- a/security/tripwire/Makefile
+++ b/security/tripwire/Makefile
@@ -7,6 +7,7 @@
PORTNAME= tripwire
PORTVERSION= 2.4.2.2
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-src/${PORTNAME}-${PORTVERSION}
DISTNAME= ${PORTNAME}-${PORTVERSION}-src
@@ -19,7 +20,6 @@ NO_LICENSES_INSTALL= yes
LATEST_LINK= ${PORTNAME}
MAN5= twfiles.5 twconfig.5 twpolicy.5
MAN8= siggen.8 tripwire.8 twadmin.8 twintro.8 twprint.8
-# NO_PACKAGE= "requires local database to be built"
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-src
USE_BZIP2= yes
GNU_CONFIGURE= yes
@@ -28,23 +28,43 @@ MAKE_ARGS= SYSPRE=${ARCH}-unknown-freebsd
IS_INTERACTIVE= yes
M4= /usr/bin/m4
+# Tripwire database files are stored in TWDB.
+TWDB?= /var/db/tripwire
+
+OPTIONS= TWCFG_ETC "Put config files in ${ETCDIR}" on \
+ TWCFG_TWDB "Put config files in ${TWDB}/etc" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_TWCFG_ETC) && ${WITH_TWCFG_ETC} == "true" && defined(WITH_TWCFG_TWDB) && ${WITH_TWCFG_TWDB} == "true"
+BROKEN= Must select only one of WITH_TWCFG_ETC or WITH_TWCFG_TWDB
+.endif
+
# Tripwire config files are stored in TWCFG
-TWCFG?= /usr/local/etc/tripwire
+.if defined(WITH_TWCFG_ETC) && ${WITH_TWCFG_ETC} == "true"
+TWCFG?= ${ETCDIR}
+.endif
+.if defined(WITH_TWCFG_TWDB) && ${WITH_TWCFG_TWDB} == "true"
+TWCFG?= ${TWDB}/etc
+.endif
+
+.ifndef TWCFG
+BROKEN= TWCFG must be defined
+.endif
+
# Tripwire policy files are stored in TWPOLICY.
TWPOLICY?= ${TWCFG}
# The Tripwire site key files are stored in TWSITEKEYDIR.
TWSITEKEYDIR?= ${TWPOLICY}
# The Tripwire local key files are stored in TWLOCALKEYDIR.
TWLOCALKEYDIR?= ${TWPOLICY}
-# Tripwire database files are stored in TWDB.
-TWDB?= /var/db/tripwire
# Tripwire report files are stored in TWREPORT.
TWREPORT?= ${TWDB}/report
# This sets the default text editor for Tripwire.
TWEDITOR?= /usr/bin/vi
# This sets the location of the twpol.txt file that is to be installed
TWPOL_TXT?= ${FILESDIR}/twpol.m4
-# Other variables that are used:
+# Other variables that are used, when not package building:
TRIPWIRE_CLOBBER?= false
TRIPWIRE_PROMPT?= true
# If TRIPWIRE_CLOBBER is set to YES, the install script clobbers
@@ -59,7 +79,7 @@ SUB_LIST= TWCFG=${TWCFG} TWDB=${TWDB}
pre-configure:
@ ${M4} -DFREEBSD_VERSION=`${ECHO_CMD} ${OSREL} | ${CUT} -d. -f1` < ${TWPOL_TXT} > ${WRKSRC}/policy/twpol-FreeBSD.txt
@ ${MV} ${WRKSRC}/src/core/stdcore.h ${WRKSRC}/src/core/stdcore.h.orig
- @ ${SED} 's%^# define CONFIG_FILE_ROOT "/usr/local/etc/tripwire"%# define CONFIG_FILE_ROOT "${TWCFG}"%' ${WRKSRC}/src/core/stdcore.h.orig > ${WRKSRC}/src/core/stdcore.h
+ @ ${SED} 's%^# define CONFIG_FILE_ROOT "${TWCFG}"%# define CONFIG_FILE_ROOT "${TWCFG}"%' ${WRKSRC}/src/core/stdcore.h.orig > ${WRKSRC}/src/core/stdcore.h
@ ${MV} ${WRKSRC}/man/man4/twconfig.4 ${WRKSRC}/man/man5/twconfig.5
@ ${MV} ${WRKSRC}/man/man4/twpolicy.4 ${WRKSRC}/man/man5/twpolicy.5
@ ${LN} -s ${WRKSRC}/contrib ${WRKSRC}/install
@@ -72,15 +92,10 @@ install-config-files:
@ ${ECHO_CMD} TWREPORT=${TWREPORT} >> ${WRKSRC}/install/install.cfg
@ ${ECHO_CMD} TWEDITOR=${TWEDITOR} >> ${WRKSRC}/install/install.cfg
@ cd ${WRKSRC} && ${LN} -sf install/install.cfg install/install.sh .
-.ifndef PACKAGE_BUILDING
-.if ( defined(TRIPWIRE_CLOBBER) && ${TRIPWIRE_CLOBBER} == "YES" ) || \
- ( defined(TRIPWIRE_CLOBBER) && ${TRIPWIRE_CLOBBER} == "yes" )
- @ cd ${WRKSRC} && PREFIX=${PREFIX} CLOBBER=true ${GMAKE} install-data-hook
-.else
- @ cd ${WRKSRC} && PREFIX=${PREFIX} ${GMAKE} install-data-hook
-.endif
+.ifdef PACKAGE_BUILDING
+ @ cd ${WRKSRC} && PREFIX=${PREFIX} DO_NOT_CONFIG=yes TRIPWIRE_CLOBBER=${TRIPWIRE_CLOBBER} TRIPWIRE_PROMPT="false" ${GMAKE} install-data-hook
.else
- @ cd ${WRKSRC} && PREFIX=${PREFIX} DO_NOT_CONFIG=yes ${GMAKE} install-data-hook
+ @ cd ${WRKSRC} && PREFIX=${PREFIX} TRIPWIRE_CLOBBER=${TRIPWIRE_CLOBBER} TRIPWIRE_PROMPT=${TRIPWIRE_PROMPT) ${GMAKE} install-data-hook
.endif
make-pkg-install:
@@ -95,6 +110,9 @@ make-pkg-install:
@ ${ECHO_CMD} PACKAGE_INSTALLER=yes >> ${PKGINSTALL}
@ ${ECHO_CMD} POLICYSRC=/tmp/$$$$.tmp >> ${PKGINSTALL}
@ ${ECHO_CMD} PREFIX="$(PREFIX)" >> ${PKGINSTALL}
+ @ ${ECHO_CMD} DO_NOT_CONFIG=yes >> ${PKGINSTALL}
+ @ ${ECHO_CMD} TRIPWIRE_CLOBBER="false" >> ${PKGINSTALL}
+ @ ${ECHO_CMD} TRIPWIRE_PROMPT="false" >> ${PKGINSTALL}
@ ${ECHO_CMD} sysconfdir="$(sysconfdir)" >> ${PKGINSTALL}
@ ${ECHO_CMD} prefix=${PREFIX} >> ${PKGINSTALL}
@ ${ECHO_CMD} sysconfdir=${TWCFG} >> ${PKGINSTALL}
@@ -124,4 +142,4 @@ create-database:
post-install: install-config-files create-database make-pkg-install
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/security/tripwire/files/patch-install-install.sh b/security/tripwire/files/patch-install-install.sh
index 7112cc1ebb50..e800ae9e4098 100644
--- a/security/tripwire/files/patch-install-install.sh
+++ b/security/tripwire/files/patch-install-install.sh
@@ -1,5 +1,18 @@
--- install/install.sh.orig 2011-11-21 08:06:56.000000000 -0800
-+++ install/install.sh 2012-01-17 22:57:34.124821110 -0800
++++ install/install.sh 2012-01-25 17:05:50.514792833 -0800
+@@ -181,10 +181,10 @@
+ TW_LOCAL_PASS=""
+
+ # If clobber==true, overwrite files; if false, do not overwrite files.
+-CLOBBER="false"
++CLOBBER=${TRIPWIRE_CLOBBER:-"false"}
+
+ # If prompt==true, ask for confirmation before continuing with install.
+-PROMPT="true"
++PROMPT=${TRIPWIRE_PROMPT:-"true"}
+
+ # Guess where the toplevel for the distribution is.
+ # A bad guess is the current directory
@@ -200,6 +200,7 @@
## Parse the command line.
##-------------------------------------------------------
@@ -16,6 +29,33 @@
##-------------------------------------------------------
## Print the sign-on banner here before the first
+@@ -333,7 +335,7 @@
+ ## passphrases must be specified on the command line.
+ ##-------------------------------------------------------
+
+-if [ "$PROMPT" = "false" ] ; then
++if [ "$DO_NOT_CONFIG" != "yes" -a "$PROMPT" = "false" ] ; then
+ if [ -z "$TW_SITE_PASS" ] || [ -z "$TW_LOCAL_PASS" ] ; then
+ echo "Error: You must specify site and local passphrase" 1>&2
+ echo "if no prompting is chosen." 1>&2
+@@ -525,7 +527,7 @@
+ chmod 0750 "$d" > /dev/null
+ fi
+ else
+- echo "$d: already exists"
++ test "$PACKAGE_INSTALLER" != "yes" && echo "$d: already exists"
+ fi
+ done
+
+@@ -541,7 +543,7 @@
+ chmod 0755 "$d" > /dev/null
+ fi
+ else
+- echo "$d: already exists"
++ test "$PACKAGE_INSTALLER" != "yes" && echo "$d: already exists"
+ fi
+ done
+
@@ -550,6 +552,7 @@
## Copy all files to the location specified.
##=======================================================
@@ -24,6 +64,15 @@
echo
echo "----------------------------------------------"
echo "Copying files..."
+@@ -593,7 +596,7 @@
+ f=${TAR_DIR}$d/$ff
+ ff=${dd}/$ff
+ if [ -s $ff ] && [ "$CLOBBER" = "false" ] ; then
+- echo "$ff: file already exists"
++ test "$PACKAGE_INSTALLER" != "yes" && echo "$ff: file already exists"
+ else
+ cp "$f" "$dd"
+ if [ $? -eq 0 ]; then
@@ -604,6 +607,12 @@
fi
fi