mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-23 00:43:28 +00:00
- 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>
This commit is contained in:
parent
5c2f313ce7
commit
6cd6202ef7
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=102046
@ -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>
|
||||
|
@ -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()
|
||||
|
18
ports-mgmt/portaudit/pkg-deinstall
Normal file
18
ports-mgmt/portaudit/pkg-deinstall
Normal file
@ -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
|
18
ports-mgmt/portaudit/pkg-install
Normal file
18
ports-mgmt/portaudit/pkg-install
Normal file
@ -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
|
@ -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>
|
||||
|
@ -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()
|
||||
|
18
security/portaudit/pkg-deinstall
Normal file
18
security/portaudit/pkg-deinstall
Normal file
@ -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
|
18
security/portaudit/pkg-install
Normal file
18
security/portaudit/pkg-install
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user