aboutsummaryrefslogtreecommitdiff
path: root/security/tripwire
diff options
context:
space:
mode:
authorCy Schubert <cy@FreeBSD.org>2012-01-27 20:45:47 +0000
committerCy Schubert <cy@FreeBSD.org>2012-01-27 20:45:47 +0000
commitfc5d186d1a12e2973dbc7f25b8a41b232d468211 (patch)
tree06a2b115bfdf37985e8167a87c5bd94444c4a2fd /security/tripwire
parente918d3106343aa47ac37007a356de63513dc7247 (diff)
downloadports-fc5d186d1a12e2973dbc7f25b8a41b232d468211.tar.gz
ports-fc5d186d1a12e2973dbc7f25b8a41b232d468211.zip
Additional software only options and binary package build tweaks.`
Notes
Notes: svn path=/head/; revision=289898
Diffstat (limited to 'security/tripwire')
-rw-r--r--security/tripwire/Makefile69
-rw-r--r--security/tripwire/files/patch-install-install.sh33
2 files changed, 76 insertions, 26 deletions
diff --git a/security/tripwire/Makefile b/security/tripwire/Makefile
index 80c83071f016..b4cb17c9f0d2 100644
--- a/security/tripwire/Makefile
+++ b/security/tripwire/Makefile
@@ -7,7 +7,7 @@
PORTNAME= tripwire
PORTVERSION= 2.4.2.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= security
MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-src/${PORTNAME}-${PORTVERSION}
DISTNAME= ${PORTNAME}-${PORTVERSION}-src
@@ -31,8 +31,17 @@ M4= /usr/bin/m4
# Tripwire database files are stored in TWDB.
TWDB?= /var/db/tripwire
+# If TW_CLOBBER is set to true, the install script clobbers
+# previously installed config files.
+#
+# If TW_PROMPT is set to true, the install script is interactive.
+
OPTIONS= TWCFG_ETC "Put config files in ${ETCDIR}" on \
- TWCFG_TWDB "Put config files in ${TWDB}/etc" off
+ TWCFG_TWDB "Put config files in ${TWDB}/etc" off \
+ TW_CLOBBER "Clobber existing database files at install" off \
+ TW_PROMPT "Interactive install (ignored when PACKAGE_BUILDING)" on \
+ SW_ONLY "Install software only, do not post-configure (ignored when PACKAGE_BUILDING)" off \
+ DB_BUILD "Build database during post-install (ignored when PACKAGE_BUILDING)" on
.include <bsd.port.pre.mk>
@@ -52,6 +61,26 @@ TWCFG?= ${TWDB}/etc
BROKEN= TWCFG must be defined
.endif
+.if defined(WITH_TW_CLOBBER) && ${WITH_TW_CLOBBER} == "true"
+TW_CLOBBER= true
+.else
+TW_CLOBBER= false
+.endif
+
+.if defined(WITH_TW_PROMPT) && ${WITH_TW_PROMPT} == "true"
+TW_PROMPT= true
+.else
+TW_PROMPT= false
+# TW_SITE_PASS?= FreeBSD
+.ifndef TW_SITE_PASS
+BROKEN= No site passphrase specified or turn PROMPT on
+.endif
+# TW_LOCAL_PASS?= FreeBSD
+.ifndef TW_LOCAL_PASS
+BROKEN= No local passphrase specified or turn PROMPT on
+.endif
+.endif
+
# Tripwire policy files are stored in TWPOLICY.
TWPOLICY?= ${TWCFG}
# The Tripwire site key files are stored in TWSITEKEYDIR.
@@ -64,11 +93,6 @@ TWREPORT?= ${TWDB}/report
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, when not package building:
-TRIPWIRE_CLOBBER?= false
-TRIPWIRE_PROMPT?= true
-# If TRIPWIRE_CLOBBER is set to YES, the install script clobbers
-# previously installed config files.
CONFIGURE_ARGS= --prefix=${PREFIX} --program-transform-name='' --sysconfdir=${TWCFG}
PLIST_SUB+= TWCFG=${TWCFG} TWDB=${TWDB}
@@ -91,11 +115,21 @@ install-config-files:
@ ${ECHO_CMD} TWDB=${TWDB} >> ${WRKSRC}/install/install.cfg
@ ${ECHO_CMD} TWREPORT=${TWREPORT} >> ${WRKSRC}/install/install.cfg
@ ${ECHO_CMD} TWEDITOR=${TWEDITOR} >> ${WRKSRC}/install/install.cfg
+.ifdef TW_SITE_PASS
+ @ ${ECHO_CMD} TW_SITE_PASS=${TW_SITE_PASS} >> ${WRKSRC}/install/install.cfg
+.endif
+.ifdef TW_LOCAL_PASS
+ @ ${ECHO_CMD} TW_LOCAL_PASS=${TW_LOCAL_PASS} >> ${WRKSRC}/install/install.cfg
+.endif
@ cd ${WRKSRC} && ${LN} -sf install/install.cfg install/install.sh .
.ifdef PACKAGE_BUILDING
- @ cd ${WRKSRC} && PREFIX=${PREFIX} DO_NOT_CONFIG=yes TRIPWIRE_CLOBBER=${TRIPWIRE_CLOBBER} TRIPWIRE_PROMPT="false" ${GMAKE} install-data-hook
+ @ cd ${WRKSRC} && PREFIX=${PREFIX} TW_CLOBBER=${TW_CLOBBER} DO_NOT_CONFIG="yes" TW_PROMPT="false" ${GMAKE} install-data-hook
.else
- @ cd ${WRKSRC} && PREFIX=${PREFIX} TRIPWIRE_CLOBBER=${TRIPWIRE_CLOBBER} TRIPWIRE_PROMPT=${TRIPWIRE_PROMPT} ${GMAKE} install-data-hook
+.if defined(WITH_SW_ONLY) && ${WITH_SW_ONLY} == "true"
+ @ cd ${WRKSRC} && PREFIX=${PREFIX} TW_CLOBBER=${TW_CLOBBER} DO_NOT_CONFIG="yes" TW_PROMPT="false" ${GMAKE} install-data-hook
+.else
+ @ cd ${WRKSRC} && PREFIX=${PREFIX} TW_CLOBBER=${TW_CLOBBER} TW_PROMPT=${TW_PROMPT} ${GMAKE} install-data-hook
+.endif
.endif
make-pkg-install:
@@ -111,8 +145,8 @@ make-pkg-install:
@ ${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} TW_CLOBBER="false" >> ${PKGINSTALL}
+ @ ${ECHO_CMD} TW_PROMPT="false" >> ${PKGINSTALL}
@ ${ECHO_CMD} sysconfdir="$(sysconfdir)" >> ${PKGINSTALL}
@ ${ECHO_CMD} prefix=${PREFIX} >> ${PKGINSTALL}
@ ${ECHO_CMD} sysconfdir=${TWCFG} >> ${PKGINSTALL}
@@ -120,6 +154,12 @@ make-pkg-install:
@ ${ECHO_CMD} path_to_sendmail="/usr/sbin/sendmail" >> ${PKGINSTALL}
@ ${ECHO_CMD} BASE_DIR=${PREFIX}/ >> ${PKGINSTALL}
@ ${ECHO_CMD} BIN_DIR=${PREFIX}/sbin >> ${PKGINSTALL}
+.ifdef TW_SITE_PASS
+ @ ${ECHO_CMD} TW_SITE_PASS=${TW_SITE_PASS} >> ${PKGINSTALL}
+.endif
+.ifdef TW_LOCAL_PASS
+ @ ${ECHO_CMD} TW_LOCAL_PASS=${TW_LOCAL_PASS} >> ${PKGINSTALL}
+.endif
@ ${CAT} ${WRKSRC}/install/install.cfg >> ${PKGINSTALL}
@ ${ECHO_CMD} ${CAT} "> /tmp/$$$$.tmp <<'EOF'" >> ${PKGINSTALL}
@ ${M4} -DFREEBSD_VERSION=`${ECHO_CMD} ${OSREL} | ${CUT} -d. -f1` < ${TWPOL_TXT} >> ${PKGINSTALL}
@@ -127,7 +167,10 @@ make-pkg-install:
@ ${SED} "/^\. /s/^/: /;/^BASE_DIR=/d;s/BIN_DIR=/: BIN_DIR=/;/^POLICYSRC/d" ${WRKSRC}/install/install.sh >> ${PKGINSTALL}
create-database:
-.if !defined(NO_DB_BUILD) && !defined(PACKAGE_BUILDING)
+.if defined(WITH_DB_BUILD) && ${WITH_DB_BUILD} == "true"
+.if defined(WITH_SW_ONLY) && ${WITH_SW_ONLY} == "true"
+ @ ${ECHO} SW_ONLY has been specified, database will not be built.
+.else
@ ${MKDIR} -p ${TWCFG} ${TWPOLICY} ${TWSITEKEYDIR} ${TWLOCALKEYDIR} \
${TWDB} ${TWREPORT}
@ ${ECHO} Creating tripwire database
@@ -137,7 +180,7 @@ create-database:
@ ${ECHO} policy file are signed using the local and site keys,
@ ${ECHO} therefore according to the support staff at
@ ${ECHO} tripwiresecurity.com, creating a floppy is not necessary.
-
+.endif
.endif
post-install: install-config-files create-database make-pkg-install
diff --git a/security/tripwire/files/patch-install-install.sh b/security/tripwire/files/patch-install-install.sh
index e800ae9e4098..d992b342d57f 100644
--- a/security/tripwire/files/patch-install-install.sh
+++ b/security/tripwire/files/patch-install-install.sh
@@ -1,19 +1,26 @@
--- install/install.sh.orig 2011-11-21 08:06:56.000000000 -0800
-+++ install/install.sh 2012-01-25 17:05:50.514792833 -0800
-@@ -181,10 +181,10 @@
- TW_LOCAL_PASS=""
++++ install/install.sh 2012-01-26 14:46:55.995316577 -0800
+@@ -174,17 +174,11 @@
+ # Starting directory.
+ START_DIR=`pwd`
+-# Site passphrase.
+-TW_SITE_PASS=""
+-
+-# Local passphrase.
+-TW_LOCAL_PASS=""
+-
# If clobber==true, overwrite files; if false, do not overwrite files.
-CLOBBER="false"
-+CLOBBER=${TRIPWIRE_CLOBBER:-"false"}
++CLOBBER=${TW_CLOBBER:-"false"}
# If prompt==true, ask for confirmation before continuing with install.
-PROMPT="true"
-+PROMPT=${TRIPWIRE_PROMPT:-"true"}
++PROMPT=${TW_PROMPT:-"true"}
# Guess where the toplevel for the distribution is.
# A bad guess is the current directory
-@@ -200,6 +200,7 @@
+@@ -200,6 +194,7 @@
## Parse the command line.
##-------------------------------------------------------
@@ -21,7 +28,7 @@
while [ "x$1" != "x" ] ; do
case "$1" in
-n) PROMPT="false"; xCLOBBER="true" ;;
-@@ -232,6 +233,7 @@
+@@ -232,6 +227,7 @@
esac
shift
done
@@ -29,7 +36,7 @@
##-------------------------------------------------------
## Print the sign-on banner here before the first
-@@ -333,7 +335,7 @@
+@@ -333,7 +329,7 @@
## passphrases must be specified on the command line.
##-------------------------------------------------------
@@ -38,7 +45,7 @@
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 @@
+@@ -525,7 +521,7 @@
chmod 0750 "$d" > /dev/null
fi
else
@@ -47,7 +54,7 @@
fi
done
-@@ -541,7 +543,7 @@
+@@ -541,7 +537,7 @@
chmod 0755 "$d" > /dev/null
fi
else
@@ -56,7 +63,7 @@
fi
done
-@@ -550,6 +552,7 @@
+@@ -550,6 +546,7 @@
## Copy all files to the location specified.
##=======================================================
@@ -64,7 +71,7 @@
echo
echo "----------------------------------------------"
echo "Copying files..."
-@@ -593,7 +596,7 @@
+@@ -593,7 +590,7 @@
f=${TAR_DIR}$d/$ff
ff=${dd}/$ff
if [ -s $ff ] && [ "$CLOBBER" = "false" ] ; then
@@ -73,7 +80,7 @@
else
cp "$f" "$dd"
if [ $? -eq 0 ]; then
-@@ -604,6 +607,12 @@
+@@ -604,6 +601,12 @@
fi
fi
done