diff options
author | Oliver Eikemeier <eik@FreeBSD.org> | 2004-02-25 09:46:26 +0000 |
---|---|---|
committer | Oliver Eikemeier <eik@FreeBSD.org> | 2004-02-25 09:46:26 +0000 |
commit | 6cd6202ef7b75ba9a22e394e2b1eeddc9c3786f6 (patch) | |
tree | 118714f203d87c9ea058c126979b6d7f6ba0118e /ports-mgmt | |
parent | 5c2f313ce7b03e213ab0205baf41133d3a46a5ff (diff) | |
download | ports-6cd6202ef7b75ba9a22e394e2b1eeddc9c3786f6.tar.gz ports-6cd6202ef7b75ba9a22e394e2b1eeddc9c3786f6.zip |
- 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>
Notes
Notes:
svn path=/head/; revision=102046
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/portaudit/Makefile | 20 | ||||
-rw-r--r-- | ports-mgmt/portaudit/files/portaudit.functions | 4 | ||||
-rw-r--r-- | ports-mgmt/portaudit/pkg-deinstall | 18 | ||||
-rw-r--r-- | ports-mgmt/portaudit/pkg-install | 18 |
4 files changed, 57 insertions, 3 deletions
diff --git a/ports-mgmt/portaudit/Makefile b/ports-mgmt/portaudit/Makefile index b19fbd408c21..8b186c098bf3 100644 --- a/ports-mgmt/portaudit/Makefile +++ b/ports-mgmt/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/ports-mgmt/portaudit/files/portaudit.functions b/ports-mgmt/portaudit/files/portaudit.functions index 1b6a0fe9992c..36f10289dd1b 100644 --- a/ports-mgmt/portaudit/files/portaudit.functions +++ b/ports-mgmt/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/ports-mgmt/portaudit/pkg-deinstall b/ports-mgmt/portaudit/pkg-deinstall new file mode 100644 index 000000000000..8aebe9994cb0 --- /dev/null +++ b/ports-mgmt/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/ports-mgmt/portaudit/pkg-install b/ports-mgmt/portaudit/pkg-install new file mode 100644 index 000000000000..56b66fd5592d --- /dev/null +++ b/ports-mgmt/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 |