aboutsummaryrefslogtreecommitdiffstats
path: root/mail/assp
diff options
context:
space:
mode:
authorohauer <ohauer@FreeBSD.org>2011-01-07 00:26:53 +0800
committerohauer <ohauer@FreeBSD.org>2011-01-07 00:26:53 +0800
commit25b8ef043fbd45c39b81443b6378f5d4320c7c33 (patch)
tree35f156fe4b42aba613f9c8d82ee8bb0a1cdef4ea /mail/assp
parent601266452f5b1c2ba770df60361b342940bb04d1 (diff)
downloadfreebsd-ports-gnome-25b8ef043fbd45c39b81443b6378f5d4320c7c33.tar.gz
freebsd-ports-gnome-25b8ef043fbd45c39b81443b6378f5d4320c7c33.tar.zst
freebsd-ports-gnome-25b8ef043fbd45c39b81443b6378f5d4320c7c33.zip
- fix periodic script(s) [1] [2]
- use ports framework to create user/group - add pkg-install script to create links and directories so they are created during package install - use COPYTREE_SHARE instead of fix permissions and use INSTALL_DATA - fix order of pkg-plist - bump PORTREVISION PR: [1] ports/152365 [2] ports/153350 (maintainer) Submitted by: [1] Marco Walraven [2] Rusty Nejdl (maintainer)
Diffstat (limited to 'mail/assp')
-rw-r--r--mail/assp/Makefile55
-rw-r--r--mail/assp/files/510.assp.in1
-rw-r--r--mail/assp/files/periodic-assp.in4
-rw-r--r--mail/assp/files/periodic-assp.sh.in1
-rw-r--r--mail/assp/files/pkg-install.in20
-rw-r--r--mail/assp/pkg-plist18
6 files changed, 48 insertions, 51 deletions
diff --git a/mail/assp/Makefile b/mail/assp/Makefile
index d53fda7d3a0f..c5c7c4daf850 100644
--- a/mail/assp/Makefile
+++ b/mail/assp/Makefile
@@ -7,8 +7,10 @@
PORTNAME= assp
PORTVERSION= 1.8.1.6
+PORTREVISION= 1
CATEGORIES= mail
-MASTER_SITES= SF/${PORTNAME}/ASSP%20Installation/${PORTNAME:U}%20${PORTVERSION}/
+MASTER_SITES= SF
+MASTER_SITE_SUBDIR=${PORTNAME}/ASSP%20Installation/${PORTNAME:U}%20${PORTVERSION}/
DISTNAME= ${PORTNAME:U}_${PORTVERSION}-Install
MAINTAINER= rnejdl@ringofsaturn.com
@@ -22,14 +24,14 @@ MAN8= assp.8 assplog.8
ASSP_USER= assp
ASSP_GROUP= assp
-ASSP_UID= 587
-ASSP_GID= 587
+USERS= ${ASSP_USER}
+GROUPS= ${ASSP_GROUP}
ASSP_HOME= /var/db/assp
ASSP_LOG= /var/log/assp
PLIST_SUB= ASSP_HOME="${ASSP_HOME}" ASSP_LOG="${ASSP_LOG}"
-SUB_FILES= assp.8 assplog.8 assplog.pl periodic-assp
+SUB_FILES= assp.8 assplog.8 assplog.pl periodic-assp pkg-install
SUB_LIST= ASSP_USER="${ASSP_USER}" ASSP_GROUP="${ASSP_GROUP}" \
ASSP_HOME="${ASSP_HOME}" ASSP_LOG="${ASSP_LOG}" \
DATADIR="${DATADIR}" PERL="${PERL}"
@@ -129,57 +131,23 @@ RUN_DEPENDS+= ${SITE_PERL}/IO/Socket/INET6.pm:${PORTSDIR}/net/p5-IO-Socket-INET6
EXTRACT_AFTER_ARGS= -d ${PORTNAME}-${PORTVERSION}
-post-extract:
- @echo "===> Removing incorrect group/other write permissions"
- @${FIND} ${WRKDIR}/${PORTNAME}-${PORTVERSION} -type d -exec ${CHMOD} go-w {} \;
- @${FIND} ${WRKDIR}/${PORTNAME}-${PORTVERSION} -type f -exec ${CHMOD} a-wx {} \;
-
post-patch:
@${REINPLACE_CMD} -e 's|/usr/bin/perl|${PERL}|' ${WRKSRC}/*.pl
-pre-install:
- if ! /usr/sbin/pw groupshow ${ASSP_GROUP}; then \
- /usr/sbin/pw groupadd ${ASSP_GROUP} -g ${ASSP_GID}; \
- else \
- ${ECHO_CMD} "Using exsing ${ASSP_GROUP} group"; \
- fi; \
- if ! /usr/sbin/pw usershow ${ASSP_USER}; then \
- /usr/sbin/pw useradd ${ASSP_USER} -g ${ASSP_GROUP} -u ${ASSP_UID} -h - -d ${ASSP_HOME} -s /usr/sbin/nologin -c "ASSP Anti-Spam Proxy"; \
- else \
- ${ECHO_CMD} "Using exsing ${ASSP_USER} user"; \
- fi
-
do-install:
${MKDIR} ${DATADIR}
${INSTALL_SCRIPT} ${WRKSRC}/assp.pl ${DATADIR}
${INSTALL_SCRIPT} ${WRKSRC}/rebuildspamdb.pl ${DATADIR}
${INSTALL_SCRIPT} ${WRKSRC}/stat.pl ${DATADIR}
- ${MKDIR} ${DATADIR}/files
- ${INSTALL_DATA} ${WRKSRC}/files/* ${DATADIR}/files
- ${MKDIR} ${DATADIR}/images
- ${INSTALL_DATA} ${WRKSRC}/images/* ${DATADIR}/images
- ${MKDIR} ${DATADIR}/reports
- ${INSTALL_DATA} ${WRKSRC}/reports/* ${DATADIR}/reports
- ${LN} -s ${DATADIR}/assp.pl ${PREFIX}/sbin/assp
+ ( cd ${WRKSRC} && ${COPYTREE_SHARE} "files images reports" \
+ ${DATADIR}/ "! -name '*.orig' ! -name '*.bak'" )
${INSTALL_SCRIPT} ${WRKDIR}/assplog.pl ${PREFIX}/sbin/assplog
${INSTALL_MAN} ${WRKDIR}/assp.8 ${MAN8PREFIX}/man/man8
${INSTALL_MAN} ${WRKDIR}/assplog.8 ${MAN8PREFIX}/man/man8
- ${MKDIR} ${ASSP_LOG}
- ${CHOWN} ${ASSP_USER}:${ASSP_GROUP} ${ASSP_LOG}
- ${CHMOD} 750 ${ASSP_LOG}
-
- ${MKDIR} ${ASSP_HOME}
- ${CHOWN} ${ASSP_USER}:${ASSP_GROUP} ${ASSP_HOME}
- ${CHMOD} 700 ${ASSP_HOME}
- ${LN} -s ${DATADIR}/files ${ASSP_HOME}
- ${LN} -s ${DATADIR}/images ${ASSP_HOME}
- ${LN} -s ${DATADIR}/reports ${ASSP_HOME}
- ${LN} -s ${ASSP_LOG} ${ASSP_HOME}/logs
-
${MKDIR} ${PREFIX}/etc/periodic/daily
${INSTALL_SCRIPT} ${WRKDIR}/periodic-assp ${PREFIX}/etc/periodic/daily/510.assp
@@ -188,4 +156,11 @@ do-install:
${INSTALL_DATA} ${WRKSRC}/docs/*.htm ${DOCSDIR}
.endif
+post-install:
+ @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+# XXX Workaround: for PR ports/152498. Remove if PR ports/152498 is fixed!
+ @${EGREP} -e '^@exec.*${PW}' -e '^@exec ${INSTALL} -d -g' ${TMPPLIST} > ${WRKDIR}/.PLIST.ugid
+ @${EGREP} -v -e '^@exec.*${PW}' -e '^@exec ${INSTALL} -d -g' ${TMPPLIST} >> ${WRKDIR}/.PLIST.ugid
+ @${MV} ${WRKDIR}/.PLIST.ugid ${TMPPLIST}
+
.include <bsd.port.post.mk>
diff --git a/mail/assp/files/510.assp.in b/mail/assp/files/510.assp.in
index a9de078eadad..af074b41acfe 100644
--- a/mail/assp/files/510.assp.in
+++ b/mail/assp/files/510.assp.in
@@ -15,6 +15,7 @@ else
echo ""
echo "Running ASSP rebuildspamdb.pl:"
%%PERL%% %%DATADIR%%/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3
+ chown -R %%ASSP_USER%%:%%ASSP_GROUP%% %%ASSP_HOME%%
fi
. /etc/rc.subr
diff --git a/mail/assp/files/periodic-assp.in b/mail/assp/files/periodic-assp.in
index 63cd5af5ecd9..c63f70080625 100644
--- a/mail/assp/files/periodic-assp.in
+++ b/mail/assp/files/periodic-assp.in
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $FreeBSD: /tmp/pcvs/ports/mail/assp/files/Attic/periodic-assp.in,v 1.1 2010-12-12 01:09:48 pgollucci Exp $
+# $FreeBSD: /tmp/pcvs/ports/mail/assp/files/Attic/periodic-assp.in,v 1.2 2011-01-06 16:26:53 ohauer Exp $
#
# Run ASSP's nightly housekeeping script, rebuildspamdb.pl
# Delete old ASSP log files
@@ -15,7 +15,7 @@ else
echo ""
echo "Running ASSP rebuildspamdb.pl:"
%%PERL%% %%DATADIR%%/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3
- chown -R assp:assp %%DATADIR%%
+ chown -R %%ASSP_USER%%:%%ASSP_GROUP%% %%ASSP_HOME%%
fi
. /etc/rc.subr
diff --git a/mail/assp/files/periodic-assp.sh.in b/mail/assp/files/periodic-assp.sh.in
index a9de078eadad..af074b41acfe 100644
--- a/mail/assp/files/periodic-assp.sh.in
+++ b/mail/assp/files/periodic-assp.sh.in
@@ -15,6 +15,7 @@ else
echo ""
echo "Running ASSP rebuildspamdb.pl:"
%%PERL%% %%DATADIR%%/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3
+ chown -R %%ASSP_USER%%:%%ASSP_GROUP%% %%ASSP_HOME%%
fi
. /etc/rc.subr
diff --git a/mail/assp/files/pkg-install.in b/mail/assp/files/pkg-install.in
new file mode 100644
index 000000000000..b8a4bf171fa3
--- /dev/null
+++ b/mail/assp/files/pkg-install.in
@@ -0,0 +1,20 @@
+#!/bin/sh
+# $FreeBSD$
+
+if [ "${2}" = "POST-INSTALL" ]; then
+ ASSP_USER=%%ASSP_USER%%
+ ASSP_GROUP=%%ASSP_GROUP%%
+ ASSP_HOME=%%ASSP_HOME%%
+ ASSP_LOG=%%ASSP_LOG%%
+ DATADIR=${PKG_PREFIX}/share/assp
+
+ ln -sf ${DATADIR}/assp.pl ${PKG_PREFIX}/sbin/assp
+
+ install -d -m 750 -o ${ASSP_USER} -g ${ASSP_GROUP} ${ASSP_LOG}
+ install -d -m 700 -o ${ASSP_USER} -g ${ASSP_GROUP} ${ASSP_HOME}
+
+ ln -sf ${DATADIR}/files ${ASSP_HOME}
+ ln -sf ${DATADIR}/images ${ASSP_HOME}
+ ln -sf ${DATADIR}/reports ${ASSP_HOME}
+ ln -sf ${ASSP_LOG} ${ASSP_HOME}/logs
+fi
diff --git a/mail/assp/pkg-plist b/mail/assp/pkg-plist
index 040f35f29646..bf4c38c7a156 100644
--- a/mail/assp/pkg-plist
+++ b/mail/assp/pkg-plist
@@ -1,15 +1,15 @@
etc/periodic/daily/510.assp
-@dirrmtry etc/periodic/daily
-@dirrmtry etc/periodic
+sbin/assp
+sbin/assplog
%%DATADIR%%/assp.pl
%%DATADIR%%/files/URIBLCCTLDS.txt
%%DATADIR%%/files/blackaddresses.txt
%%DATADIR%%/files/blackdomains.txt
-%%DATADIR%%/files/blackre.txt
+%%DATADIR%%/files/blackre.txt
%%DATADIR%%/files/blockreportlist.txt
%%DATADIR%%/files/bombheaderre.txt
-%%DATADIR%%/files/bombsenderre.txt
%%DATADIR%%/files/bombre.txt
+%%DATADIR%%/files/bombsenderre.txt
%%DATADIR%%/files/charsets.txt
%%DATADIR%%/files/deny.txt
%%DATADIR%%/files/denyalways.txt
@@ -74,15 +74,15 @@ etc/periodic/daily/510.assp
%%DATADIR%%/reports/whiteremovereport.txt
%%DATADIR%%/reports/whitereport.txt
%%DATADIR%%/stat.pl
+%%PORTDOCS%%%%DOCSDIR%%/Legacy - ASSP Documentation.htm
+%%PORTDOCS%%%%DOCSDIR%%/Regular Expression Tutorial.htm
+%%PORTDOCS%%@dirrm %%DOCSDIR%%
@dirrm %%DATADIR%%/reports
@dirrm %%DATADIR%%/images
@dirrm %%DATADIR%%/files
@dirrm %%DATADIR%%
-sbin/assp
-sbin/assplog
-%%PORTDOCS%%%%DOCSDIR%%/Legacy - ASSP Documentation.htm
-%%PORTDOCS%%%%DOCSDIR%%/Regular Expression Tutorial.htm
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
+@dirrmtry etc/periodic/daily
+@dirrmtry etc/periodic
@unexec rm %%ASSP_HOME%%/logs
@unexec rm %%ASSP_HOME%%/reports
@unexec rm %%ASSP_HOME%%/images