diff options
author | wxs <wxs@FreeBSD.org> | 2010-02-18 06:03:35 +0800 |
---|---|---|
committer | wxs <wxs@FreeBSD.org> | 2010-02-18 06:03:35 +0800 |
commit | ccc5f010ae968c8c848023b746d3e4da2daf3f35 (patch) | |
tree | e28e4bd3feaa17e5020d0e8f01bd7607f87d81fc /mail | |
parent | bbc9f370d63a99c303e77bb4c2a86f28f0b5108a (diff) | |
download | freebsd-ports-gnome-ccc5f010ae968c8c848023b746d3e4da2daf3f35.tar.gz freebsd-ports-gnome-ccc5f010ae968c8c848023b746d3e4da2daf3f35.tar.zst freebsd-ports-gnome-ccc5f010ae968c8c848023b746d3e4da2daf3f35.zip |
- Fix QAT by not touching DATADIR until pre-install target.
- Fix pkg-install to give a warning that the rules need to be installed if they
don't already exist.
Submitted by: wxs@
Approved by: Michael Scheidell <scheidell@secnap.net> (maintainer)
Feature safe: yes
Diffstat (limited to 'mail')
-rw-r--r-- | mail/p5-Mail-SpamAssassin/Makefile | 6 | ||||
-rw-r--r-- | mail/p5-Mail-SpamAssassin/pkg-install | 111 |
2 files changed, 73 insertions, 44 deletions
diff --git a/mail/p5-Mail-SpamAssassin/Makefile b/mail/p5-Mail-SpamAssassin/Makefile index 60aa9112e9f5..012d171fe707 100644 --- a/mail/p5-Mail-SpamAssassin/Makefile +++ b/mail/p5-Mail-SpamAssassin/Makefile @@ -7,7 +7,7 @@ PORTNAME= Mail-SpamAssassin PORTVERSION= 3.3.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= mail perl5 MASTER_SITES= ${MASTER_SITE_APACHE:S/$/:apache/} ${MASTER_SITE_PERL_CPAN:S/$/:cpan/} MASTER_SITE_SUBDIR= spamassassin/source/:apache Mail/:cpan @@ -231,7 +231,6 @@ post-patch: ${WRKSRC}/Makefile.PL @${REINPLACE_CMD} -e '/^CC =/d; \ s|@SSLCFLAGS@|& $${CFLAGS}|g' ${WRKSRC}/spamc/Makefile.in - @${MKDIR} ${DATADIR} .if defined(WITH_RAZOR) ${REINPLACE_CMD} -e '/Razor2/s/^#loadplugin/loadplugin/' ${WRKSRC}/rules/v312.pre @@ -255,6 +254,9 @@ post-patch: ${REINPLACE_CMD} -e '/Rule2XSBody/s/^# loadplugin/loadplugin/' ${WRKSRC}/rules/v320.pre .endif +pre-install: + @${MKDIR} ${DATADIR} + post-build: @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} spamc/libspamc.so) .if !defined(WITHOUT_SSL) diff --git a/mail/p5-Mail-SpamAssassin/pkg-install b/mail/p5-Mail-SpamAssassin/pkg-install index 18c2b203891a..cccf13f64d80 100644 --- a/mail/p5-Mail-SpamAssassin/pkg-install +++ b/mail/p5-Mail-SpamAssassin/pkg-install @@ -1,5 +1,10 @@ #!/bin/sh PKG_PREFIX=${PKG_PREFIX:-/usr/local} +USER=spamd +GROUP=${USER} +UID=58 +GID=${UID} +HOME=/var/spool/${USER} if [ "$2" = "POST-INSTALL" ];then ask() { @@ -28,52 +33,74 @@ yesno() { done } - - if yesno "Do you wish to run sa-update to fetch new rules" "N";then - ${PKG_PREFIX}/bin/sa-update || true - fi - grep '^load.*Rule2XSBody' ${PKG_PREFIX}/etc/mail/spamassassin/v320.pre > /dev/null - if [ $? -eq 0 ];then - if yesno "Do you wish to compile rules with re2c (will take a long time)" "N";then - ${PKG_PREFIX}/bin/sa-compile || true - fi - fi + if [ ! -e ${PKG_PREFIX}/etc/mail/spamassassin/v320.pre ]; then + echo "***********************************************" + echo "*__ ___ ____ _ _ ___ _ _ ____ *" + echo "*\ \ / / \ | _ \| \ | |_ _| \ | |/ ___|*" + echo "* \ \ /\ / / _ \ | |_) | \| || || \| | | _ *" + echo "* \ V V / ___ \| _ <| |\ || || |\ | |_| |*" + echo "* \_/\_/_/ \_\_| \_\_| \_|___|_| \_|\____|*" + echo "* *" + echo "*You must install rules before starting spamd!*" + echo "***********************************************" + if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then + sleep 10; + fi + if yesno "Do you wish to run sa-update to fetch new rules" "N";then + ${PKG_PREFIX}/bin/sa-update || true + fi + grep '^load.*Rule2XSBody' ${PKG_PREFIX}/etc/mail/spamassassin/v320.pre > /dev/null + if [ $? -eq 0 ];then + if yesno "Do you wish to compile rules with re2c (will take a long time)" "N";then + ${PKG_PREFIX}/bin/sa-compile || true + fi + fi + fi + + if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then + if pw groupadd ${GROUP} -g ${GID}; then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + exit 1 + fi + fi + + if ! pw usershow "${USER}" 2>/dev/null 1>&2; then + if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ + -s "/sbin/nologin" -d "${HOME}" \ + -c "SpamAssassin user"; \ + then + echo "Added user \"${USER}\"." + mkdir ${HOME} && chown ${USER}:${GROUP} ${HOME} + else + echo "Adding user \"${USER}\" failed..." + exit 1 + fi + fi + + # Create pid directory + mkdir /var/run/spamd 2> /dev/null && chown ${USER}:${GROUP} /var/run/spamd + exit 0 fi # post-install -if [ "$2" != "PRE-INSTALL" ]; then +if [ "$2" = "PRE-INSTALL" ]; then + if [ ! -e ${PKG_PREFIX}/etc/mail/spamassassin/v320.pre ]; then + echo "***********************************************" + echo "*__ ___ ____ _ _ ___ _ _ ____ *" + echo "*\ \ / / \ | _ \| \ | |_ _| \ | |/ ___|*" + echo "* \ \ /\ / / _ \ | |_) | \| || || \| | | _ *" + echo "* \ V V / ___ \| _ <| |\ || || |\ | |_| |*" + echo "* \_/\_/_/ \_\_| \_\_| \_|___|_| \_|\____|*" + echo "* *" + echo "*You must install rules before starting spamd!*" + echo "***********************************************" + if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then + sleep 10; + fi + fi exit 0 fi -USER=spamd -GROUP=${USER} -UID=58 -GID=${UID} -HOME=/var/spool/${USER} - -if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then - if pw groupadd ${GROUP} -g ${GID}; then - echo "Added group \"${GROUP}\"." - else - echo "Adding group \"${GROUP}\" failed..." - exit 1 - fi -fi - -if ! pw usershow "${USER}" 2>/dev/null 1>&2; then - if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \ - -s "/sbin/nologin" -d "${HOME}" \ - -c "SpamAssassin user"; \ - then - echo "Added user \"${USER}\"." - mkdir ${HOME} && chown ${USER}:${GROUP} ${HOME} - else - echo "Adding user \"${USER}\" failed..." - exit 1 - fi -fi - -# Create pid directory -mkdir /var/run/spamd 2> /dev/null && chown ${USER}:${GROUP} /var/run/spamd - exit 0 |