diff options
author | garga <garga@FreeBSD.org> | 2014-05-17 02:18:16 +0800 |
---|---|---|
committer | garga <garga@FreeBSD.org> | 2014-05-17 02:18:16 +0800 |
commit | fe08d7d2c9efdbbcee2ee2f5b64c8b9bcb14102e (patch) | |
tree | 4789a24ea7bea8b81474950c327d3d1f46ae1f9b | |
parent | 1728e7bb99d99ac002587e8beac88538b9a4552f (diff) | |
download | freebsd-ports-gnome-fe08d7d2c9efdbbcee2ee2f5b64c8b9bcb14102e.tar.gz freebsd-ports-gnome-fe08d7d2c9efdbbcee2ee2f5b64c8b9bcb14102e.tar.zst freebsd-ports-gnome-fe08d7d2c9efdbbcee2ee2f5b64c8b9bcb14102e.zip |
. Drop pkg-install and move directories to pkg-plist
. Use USERS and GROUPS
. Remove old check for FreeBSD > 7.x
-rw-r--r-- | security/clamav/Makefile | 27 | ||||
-rw-r--r-- | security/clamav/files/pkg-install.in | 48 | ||||
-rw-r--r-- | security/clamav/pkg-plist | 8 |
3 files changed, 28 insertions, 55 deletions
diff --git a/security/clamav/Makefile b/security/clamav/Makefile index 992163396fae..f175b95cffae 100644 --- a/security/clamav/Makefile +++ b/security/clamav/Makefile @@ -58,7 +58,11 @@ PORTDOCS= * DBDIR= /var/db/clamav LOGDIR= /var/log/clamav RUNDIR= /var/run/clamav -PLIST_SUB+= DBDIR=${DBDIR} LOGDIR=${LOGDIR} RUNDIR=${RUNDIR} +PLIST_SUB+= DBDIR=${DBDIR} \ + LOGDIR=${LOGDIR} \ + RUNDIR=${RUNDIR} \ + CLAMAVUSER=${CLAMAVUSER} \ + CLAMAVGROUP=${CLAMAVGROUP} PY_NO_THREAD= ${WRKDIR}/.python-has-no-threads USE_AUTOTOOLS= libltdl OPTIONS_SUB= yes @@ -90,16 +94,14 @@ CLAMAVGROUP?= clamav CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd.sock CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock -SUB_FILES= pkg-install pkg-deinstall +SUB_FILES= pkg-deinstall SUB_LIST+= DBDIR=${DBDIR} \ LOGDIR=${LOGDIR} \ RUNDIR=${RUNDIR} \ CLAMAVUSER=${CLAMAVUSER} \ CLAMAVGROUP=${CLAMAVGROUP} \ CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} \ - CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET} \ - CHMOD=${CHMOD} \ - CHOWN=${CHOWN} + CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET} SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \ -e 's|^\#?((Update)?LogFile) .*/([a-z]+\.log)$$|\1 ${LOGDIR}/\3|' \ @@ -120,6 +122,14 @@ PLIST_SUB+= CLAMAVUSER=${CLAMAVUSER} \ .include <bsd.port.options.mk> +.if ${CLAMAVUSER} == "clamav" +USERS= clamav +.endif + +.if ${CLAMAVGROUP} == "clamav" +GROUPS= clamav mail +.endif + .if ${PORT_OPTIONS:MLLVM} && ( ${ARCH} == "i386" || ${ARCH} == "amd64" ) CONFIGURE_ARGS+=--enable-llvm . if ${PORT_OPTIONS:MTESTS} @@ -179,7 +189,7 @@ pre-configure: fi .endif -.if ${PORT_OPTIONS:MTESTS} && ${OSVERSION} >= 700000 +.if ${PORT_OPTIONS:MTESTS} post-build: @if [ ! -f "${PY_NO_THREAD}" ]; then \ ${GMAKE} -C ${WRKSRC} check; \ @@ -188,7 +198,10 @@ post-build: post-install: ${INSTALL_DATA} ${WRKSRC}/clamav-config.h ${STAGEDIR}${PREFIX}/include - @${MKDIR} ${STAGEDIR}${DOCSDIR}/html + @${MKDIR} ${STAGEDIR}${DOCSDIR}/html \ + ${STAGEDIR}${DBDIR} \ + ${STAGEDIR}${LOGDIR} \ + ${STAGEDIR}${RUNDIR} ${INSTALL_DATA} ${WRKSRC}/NEWS ${WRKSRC}/ChangeLog ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/docs/html/* ${STAGEDIR}${DOCSDIR}/html diff --git a/security/clamav/files/pkg-install.in b/security/clamav/files/pkg-install.in deleted file mode 100644 index d83287ec16aa..000000000000 --- a/security/clamav/files/pkg-install.in +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# $FreeBSD: /tmp/pcvs/ports/security/clamav/files/pkg-install.in,v 1.5 2008-02-21 13:19:50 garga Exp $ - -PREFIX=${PKG_PREFIX:-%%PREFIX%%} - -CLAMAVUSER=%%CLAMAVUSER%% -CLAMAVGROUP=%%CLAMAVGROUP%% -UID=106 -GID=$UID - -DBDIR=%%DBDIR%% -LOGDIR=%%LOGDIR%% -RUNDIR=%%RUNDIR%% - -PW="pw" -CHOWN="chown" -INSTALL_DIR="install -d -o ${CLAMAVUSER} -g ${CLAMAVGROUP} -m 0755" - -if [ "$2" = "PRE-INSTALL" ]; then - - if ! ${PW} groupshow ${CLAMAVGROUP} 2>/dev/null 1>&2; then - if ${PW} groupadd ${CLAMAVGROUP} -g $GID; then - echo "=> Added group \"${CLAMAVGROUP}\"." - else - echo "=> Adding group \"${CLAMAVGROUP}\" failed..." - exit 1 - fi - fi - - if ! ${PW} usershow ${CLAMAVUSER} 2>/dev/null 1>&2; then - if ${PW} useradd ${CLAMAVUSER} -u $UID -g ${CLAMAVGROUP} -h - \ - -s "/sbin/nologin" -d "/nonexistent" \ - -c "Clam Antivirus"; \ - then - ${PW} groupmod mail -m ${CLAMAVUSER} - echo "=> Added user \"${CLAMAVUSER}\"." - else - echo "=> Adding user \"${CLAMAVUSER}\" failed..." - exit 1 - fi - fi - -elif [ "$2" = "POST-INSTALL" ]; then - ${INSTALL_DIR} ${DBDIR} ${LOGDIR} ${RUNDIR} - ${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DBDIR} ${LOGDIR} ${RUNDIR} -fi - -exit 0 diff --git a/security/clamav/pkg-plist b/security/clamav/pkg-plist index 7f6918cc1e44..a6095ce40ff9 100644 --- a/security/clamav/pkg-plist +++ b/security/clamav/pkg-plist @@ -37,3 +37,11 @@ man/man8/clamd.8.gz @sample etc/clamd.conf.sample @sample etc/freshclam.conf.sample %%MILTER%%@sample etc/clamav-milter.conf.sample +@cwd / +@owner %%CLAMAVUSER%% +@group %%CLAMAVGROUP%% +@dirrmtry %%DBDIR%% +@dirrmtry %%LOGDIR%% +@dirrmtry %%RUNDIR%% +@group +@owner |