summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authoreik <eik@FreeBSD.org>2004-02-25 09:46:26 +0000
committereik <eik@FreeBSD.org>2004-02-25 09:46:26 +0000
commitd5698cb70b8ba091a87d69e090c4052394f41bbf (patch)
treeacbd06084c85ed14328e3dbfe484eb6ff02d7f54 /security
parent90a7eee108a436c444c9d1b3fa85a4d48004504f (diff)
downloadFreeBSD-ports-d5698cb70b8ba091a87d69e090c4052394f41bbf.zip
FreeBSD-ports-d5698cb70b8ba091a87d69e090c4052394f41bbf.tar.gz
- bugfix: awk in -CURRENT accepts no regexes in RS, causing the database
update to fail - add an install & deinstall message Submitted by: nectar & Ion-Mihai Tetcu <itetcu@apropo.ro>
Diffstat (limited to 'security')
-rw-r--r--security/portaudit/Makefile20
-rw-r--r--security/portaudit/files/portaudit.functions4
-rw-r--r--security/portaudit/pkg-deinstall18
-rw-r--r--security/portaudit/pkg-install18
4 files changed, 57 insertions, 3 deletions
diff --git a/security/portaudit/Makefile b/security/portaudit/Makefile
index b19fbd4..8b186c0 100644
--- a/security/portaudit/Makefile
+++ b/security/portaudit/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= portaudit
-PORTVERSION= 0.2
+PORTVERSION= 0.2.1
CATEGORIES= security
DISTFILES=
@@ -18,9 +18,15 @@ MAN1= portaudit.1
PERIODICDIR?= ${PREFIX}/etc/periodic
DATABASEDIR?= /var/db/portaudit
+PKGINSTALL= ${WRKDIR}/pkg-install
+PKGDEINSTALL= ${WRKDIR}/pkg-deinstall
+
PLIST_SUB+= PERIODICDIR="${PERIODICDIR:S,^${PREFIX}/,,}" \
DATABASEDIR="${DATABASEDIR}"
+SED_SCRIPT= -e 's,%%PREFIX%%,${PREFIX},g' \
+ -e 's,%%DATABASEDIR%%,${DATABASEDIR},g'
+
PKG_INFO_BASE?= /usr/sbin/pkg_info
BASEPKGVER!= ${PKG_INFO_BASE} -qP 2>/dev/null
@@ -44,6 +50,13 @@ do-build:
${FILESDIR}/${f} > ${WRKDIR}/${f}
.endfor
+post-build:
+.for text in pkg-install pkg-deinstall
+ @if [ -f ${PKGDIR}/${text} ]; then \
+ ${SED} ${SED_SCRIPT} ${PKGDIR}/${text} >${WRKDIR}/${text}; \
+ fi
+.endfor
+
do-install:
@${INSTALL_SCRIPT} ${WRKDIR}/portaudit-cmd.sh ${PREFIX}/bin/portaudit
@${INSTALL_MAN} ${WRKDIR}/portaudit.1 ${MAN1PREFIX}/man/man1
@@ -55,4 +68,9 @@ do-install:
@${INSTALL_DATA} ${WRKDIR}/portaudit.functions ${DATADIR}
@${MKDIR} ${DATABASEDIR}
+post-install:
+ @if [ -f ${PKGINSTALL} ]; then \
+ ${SETENV} "PKG_PREFIX=${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL; \
+ fi
+
.include <bsd.port.post.mk>
diff --git a/security/portaudit/files/portaudit.functions b/security/portaudit/files/portaudit.functions
index 1b6a0fe..36f1028 100644
--- a/security/portaudit/files/portaudit.functions
+++ b/security/portaudit/files/portaudit.functions
@@ -153,8 +153,8 @@ audit_installed()
fetch_locations()
{
# site sort order is not overly smart
- echo "${MASTER_SITE_LOCAL}" | awk "
- BEGIN { RS=\"[ \\t\\n]\"; IGNORECASE=1; srand() }
+ echo "${MASTER_SITE_LOCAL}" | sed -e 'y/ /\n\n/' | awk "
+ BEGIN { IGNORECASE=1; srand() }
/^$/ { next }
{
if (\$0 ~ /${MASTER_SORT_REGEX}/ ) rank=0; else rank=rand()
diff --git a/security/portaudit/pkg-deinstall b/security/portaudit/pkg-deinstall
new file mode 100644
index 0000000..8aebe99
--- /dev/null
+++ b/security/portaudit/pkg-deinstall
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+ECHO_CMD=echo
+
+case $2 in
+POST-DEINSTALL)
+ ${ECHO_CMD}
+ ${ECHO_CMD} "The portaudit package has been deleted."
+ ${ECHO_CMD} "If you're *not* upgrading and won't be using"
+ ${ECHO_CMD} "it any longer, you may want to remove the"
+ ${ECHO_CMD} "portaudit database:"
+ ${ECHO_CMD}
+ ${ECHO_CMD} " rm -Rf %%DATABASEDIR%%"
+ ;;
+esac
diff --git a/security/portaudit/pkg-install b/security/portaudit/pkg-install
new file mode 100644
index 0000000..56b66fd
--- /dev/null
+++ b/security/portaudit/pkg-install
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+ECHO_CMD=echo
+
+case $2 in
+POST-INSTALL)
+ if [ ! -f "%%DATABASEDIR%%/auditfile.tbz" ]; then
+ ${ECHO_CMD}
+ ${ECHO_CMD} "===> To check your installed ports for known vulnerabilities now do:"
+ ${ECHO_CMD}
+ ${ECHO_CMD} " %%PREFIX%%/bin/portaudit -F -a"
+ ${ECHO_CMD}
+ fi
+ ;;
+esac
OpenPOWER on IntegriCloud