From 4373c358c54adc4a551351eeb7ab4f3ae867296f Mon Sep 17 00:00:00 2001 From: Michael Scheidell Date: Sat, 31 Dec 2011 14:17:03 +0000 Subject: - Built packages were not passing INSTALL var [1] - moved pkg-install to files/pkg-install.in to fix [1] - General cleanup: - Move MAN* to files/manpages - pre-install is/was not su. DATADIR was not made if you were not root - removed pkginstall from pre-su-install (not needed, was a no-op anyway - use my freebsd name as maintainer for auto GNATS assignments. PR: ports/163715 [1] Submitted by: Alexey Markov [1] Approved by: gabor (mentor) --- mail/p5-Mail-SpamAssassin/Makefile | 82 +++----------------------- mail/p5-Mail-SpamAssassin/files/manpages | 71 ++++++++++++++++++++++ mail/p5-Mail-SpamAssassin/files/pkg-install.in | 77 ++++++++++++++++++++++++ mail/p5-Mail-SpamAssassin/pkg-install | 62 ------------------- 4 files changed, 155 insertions(+), 137 deletions(-) create mode 100644 mail/p5-Mail-SpamAssassin/files/manpages create mode 100644 mail/p5-Mail-SpamAssassin/files/pkg-install.in delete mode 100644 mail/p5-Mail-SpamAssassin/pkg-install (limited to 'mail/p5-Mail-SpamAssassin') diff --git a/mail/p5-Mail-SpamAssassin/Makefile b/mail/p5-Mail-SpamAssassin/Makefile index 6f23773f59ec..456316cf7958 100644 --- a/mail/p5-Mail-SpamAssassin/Makefile +++ b/mail/p5-Mail-SpamAssassin/Makefile @@ -14,7 +14,7 @@ MASTER_SITE_SUBDIR= spamassassin/source/:apache Mail/:cpan PKGNAMEPREFIX?= p5- DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:apache,cpan -MAINTAINER= scheidell@secnap.net +MAINTAINER= scheidell@freebsd.org COMMENT= A highly efficient mail filter for identifying spam RUN_DEPENDS= p5-NetAddr-IP>=4.00.7:${PORTSDIR}/net-mgmt/p5-NetAddr-IP \ @@ -56,6 +56,9 @@ OPTIONS= AS_ROOT "Run spamd as root (recommended)" on \ RELAY_COUNTRY "Relay country support" off \ DCC "Add DCC support (see LICENSE)" off +SUB_FILES= pkg-install +SUB_LIST= USER=${USERS} GROUP=${GROUPS} INSTALL="${INSTALL}" + .if !defined(WITHOUT_SSL) USE_OPENSSL= yes .endif @@ -146,75 +149,7 @@ RUN_DEPENDS+= ${SITE_PERL}/IP/Country/Fast.pm:${PORTSDIR}/net/p5-IP-Country RUN_DEPENDS+= dcc-dccd>=1.3.111:${PORTSDIR}/mail/dcc-dccd .endif -MAN3= Mail::SpamAssassin.3 \ - Mail::SpamAssassin::AICache.3 \ - Mail::SpamAssassin::ArchiveIterator.3 \ - Mail::SpamAssassin::AsyncLoop.3 \ - Mail::SpamAssassin::AutoWhitelist.3 \ - Mail::SpamAssassin::Bayes.3 \ - Mail::SpamAssassin::BayesStore.3 \ - Mail::SpamAssassin::BayesStore::BDB.3 \ - Mail::SpamAssassin::BayesStore::MySQL.3 \ - Mail::SpamAssassin::BayesStore::PgSQL.3 \ - Mail::SpamAssassin::BayesStore::SQL.3 \ - Mail::SpamAssassin::Client.3 \ - Mail::SpamAssassin::Conf.3 \ - Mail::SpamAssassin::Conf::LDAP.3 \ - Mail::SpamAssassin::Conf::Parser.3 \ - Mail::SpamAssassin::Conf::SQL.3 \ - Mail::SpamAssassin::DnsResolver.3 \ - Mail::SpamAssassin::Logger.3 \ - Mail::SpamAssassin::Logger::File.3 \ - Mail::SpamAssassin::Logger::Stderr.3 \ - Mail::SpamAssassin::Logger::Syslog.3 \ - Mail::SpamAssassin::Message.3 \ - Mail::SpamAssassin::Message::Metadata.3 \ - Mail::SpamAssassin::Message::Node.3 \ - Mail::SpamAssassin::PerMsgLearner.3 \ - Mail::SpamAssassin::PerMsgStatus.3 \ - Mail::SpamAssassin::PersistentAddrList.3 \ - Mail::SpamAssassin::Plugin.3 \ - Mail::SpamAssassin::Plugin::ASN.3 \ - Mail::SpamAssassin::Plugin::AWL.3 \ - Mail::SpamAssassin::Plugin::AccessDB.3 \ - Mail::SpamAssassin::Plugin::AntiVirus.3 \ - Mail::SpamAssassin::Plugin::AutoLearnThreshold.3 \ - Mail::SpamAssassin::Plugin::Bayes.3 \ - Mail::SpamAssassin::Plugin::BodyRuleBaseExtractor.3 \ - Mail::SpamAssassin::Plugin::Check.3 \ - Mail::SpamAssassin::Plugin::DCC.3 \ - Mail::SpamAssassin::Plugin::DKIM.3 \ - Mail::SpamAssassin::Plugin::Hashcash.3 \ - Mail::SpamAssassin::Plugin::MIMEHeader.3 \ - Mail::SpamAssassin::Plugin::OneLineBodyRuleType.3 \ - Mail::SpamAssassin::Plugin::PhishTag.3 \ - Mail::SpamAssassin::Plugin::Pyzor.3 \ - Mail::SpamAssassin::Plugin::Razor2.3 \ - Mail::SpamAssassin::Plugin::RelayCountry.3 \ - Mail::SpamAssassin::Plugin::ReplaceTags.3 \ - Mail::SpamAssassin::Plugin::Reuse.3 \ - Mail::SpamAssassin::Plugin::Rule2XSBody.3 \ - Mail::SpamAssassin::Plugin::SPF.3 \ - Mail::SpamAssassin::Plugin::Shortcircuit.3 \ - Mail::SpamAssassin::Plugin::SpamCop.3 \ - Mail::SpamAssassin::Plugin::Test.3 \ - Mail::SpamAssassin::Plugin::TextCat.3 \ - Mail::SpamAssassin::Plugin::URIDNSBL.3 \ - Mail::SpamAssassin::Plugin::URIDetail.3 \ - Mail::SpamAssassin::Plugin::VBounce.3 \ - Mail::SpamAssassin::Plugin::WhiteListSubject.3 \ - Mail::SpamAssassin::PluginHandler.3 \ - Mail::SpamAssassin::SQLBasedAddrList.3 \ - Mail::SpamAssassin::SubProcBackChannel.3 \ - Mail::SpamAssassin::Timeout.3 \ - Mail::SpamAssassin::Util.3 \ - Mail::SpamAssassin::Util::DependencyInfo.3 \ - Mail::SpamAssassin::Util::Progress.3 \ - Mail::SpamAssassin::Util::RegistrarBoundaries.3 \ - spamassassin-run.3 - -MAN1= spamd.1 spamassassin.1 spamc.1 sa-learn.1 sa-update.1 \ - spamassassin-run.1 sa-compile.1 sa-awl.1 +.include "${FILESDIR}/manpages" DOCSDIR= ${PREFIX}/share/doc/${PKGNAMEPREFIX}${PORTNAME} DATADIR= ${PREFIX}/share/spamassassin @@ -268,9 +203,6 @@ 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) @@ -278,7 +210,7 @@ post-build: .endif pre-su-install: - @PREFIX=${PREFIX} BATCH=${BATCH} SU_CMD="${SU_CMD}" USER=${USERS} GROUP=${GROUPS} INSTALL="${INSTALL}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL + @${MKDIR} ${DATADIR} @${INSTALL_PROGRAM} ${WRKSRC}/spamc/libspamc.so ${PREFIX}/lib/libspamc.so.0 @${LN} -sf libspamc.so.0 ${PREFIX}/lib/libspamc.so .if !defined(WITHOUT_SSL) @@ -303,7 +235,7 @@ post-install: @[ -f ${PREFIX}/etc/mail/spamassassin/v320.pre ] || \ ${CP} ${PREFIX}/etc/mail/spamassassin/v320.pre.sample \ ${PREFIX}/etc/mail/spamassassin/v320.pre - @PREFIX=${PREFIX} BATCH=${BATCH} SU_CMD="${SU_CMD}" USER=${USERS} GROUP=${GROUPS} INSTALL="${INSTALL}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @[ -f ${PREFIX}/etc/mail/spamassassin/v330.pre ] || \ ${CP} ${PREFIX}/etc/mail/spamassassin/v330.pre.sample \ ${PREFIX}/etc/mail/spamassassin/v330.pre diff --git a/mail/p5-Mail-SpamAssassin/files/manpages b/mail/p5-Mail-SpamAssassin/files/manpages new file mode 100644 index 000000000000..b355d8e1535d --- /dev/null +++ b/mail/p5-Mail-SpamAssassin/files/manpages @@ -0,0 +1,71 @@ +# $FreeBSD$ +MAN3= Mail::SpamAssassin.3 \ + Mail::SpamAssassin::AICache.3 \ + Mail::SpamAssassin::ArchiveIterator.3 \ + Mail::SpamAssassin::AsyncLoop.3 \ + Mail::SpamAssassin::AutoWhitelist.3 \ + Mail::SpamAssassin::Bayes.3 \ + Mail::SpamAssassin::BayesStore.3 \ + Mail::SpamAssassin::BayesStore::BDB.3 \ + Mail::SpamAssassin::BayesStore::MySQL.3 \ + Mail::SpamAssassin::BayesStore::PgSQL.3 \ + Mail::SpamAssassin::BayesStore::SQL.3 \ + Mail::SpamAssassin::Client.3 \ + Mail::SpamAssassin::Conf.3 \ + Mail::SpamAssassin::Conf::LDAP.3 \ + Mail::SpamAssassin::Conf::Parser.3 \ + Mail::SpamAssassin::Conf::SQL.3 \ + Mail::SpamAssassin::DnsResolver.3 \ + Mail::SpamAssassin::Logger.3 \ + Mail::SpamAssassin::Logger::File.3 \ + Mail::SpamAssassin::Logger::Stderr.3 \ + Mail::SpamAssassin::Logger::Syslog.3 \ + Mail::SpamAssassin::Message.3 \ + Mail::SpamAssassin::Message::Metadata.3 \ + Mail::SpamAssassin::Message::Node.3 \ + Mail::SpamAssassin::PerMsgLearner.3 \ + Mail::SpamAssassin::PerMsgStatus.3 \ + Mail::SpamAssassin::PersistentAddrList.3 \ + Mail::SpamAssassin::Plugin.3 \ + Mail::SpamAssassin::Plugin::ASN.3 \ + Mail::SpamAssassin::Plugin::AWL.3 \ + Mail::SpamAssassin::Plugin::AccessDB.3 \ + Mail::SpamAssassin::Plugin::AntiVirus.3 \ + Mail::SpamAssassin::Plugin::AutoLearnThreshold.3 \ + Mail::SpamAssassin::Plugin::Bayes.3 \ + Mail::SpamAssassin::Plugin::BodyRuleBaseExtractor.3 \ + Mail::SpamAssassin::Plugin::Check.3 \ + Mail::SpamAssassin::Plugin::DCC.3 \ + Mail::SpamAssassin::Plugin::DKIM.3 \ + Mail::SpamAssassin::Plugin::Hashcash.3 \ + Mail::SpamAssassin::Plugin::MIMEHeader.3 \ + Mail::SpamAssassin::Plugin::OneLineBodyRuleType.3 \ + Mail::SpamAssassin::Plugin::PhishTag.3 \ + Mail::SpamAssassin::Plugin::Pyzor.3 \ + Mail::SpamAssassin::Plugin::Razor2.3 \ + Mail::SpamAssassin::Plugin::RelayCountry.3 \ + Mail::SpamAssassin::Plugin::ReplaceTags.3 \ + Mail::SpamAssassin::Plugin::Reuse.3 \ + Mail::SpamAssassin::Plugin::Rule2XSBody.3 \ + Mail::SpamAssassin::Plugin::SPF.3 \ + Mail::SpamAssassin::Plugin::Shortcircuit.3 \ + Mail::SpamAssassin::Plugin::SpamCop.3 \ + Mail::SpamAssassin::Plugin::Test.3 \ + Mail::SpamAssassin::Plugin::TextCat.3 \ + Mail::SpamAssassin::Plugin::URIDNSBL.3 \ + Mail::SpamAssassin::Plugin::URIDetail.3 \ + Mail::SpamAssassin::Plugin::VBounce.3 \ + Mail::SpamAssassin::Plugin::WhiteListSubject.3 \ + Mail::SpamAssassin::PluginHandler.3 \ + Mail::SpamAssassin::SQLBasedAddrList.3 \ + Mail::SpamAssassin::SubProcBackChannel.3 \ + Mail::SpamAssassin::Timeout.3 \ + Mail::SpamAssassin::Util.3 \ + Mail::SpamAssassin::Util::DependencyInfo.3 \ + Mail::SpamAssassin::Util::Progress.3 \ + Mail::SpamAssassin::Util::RegistrarBoundaries.3 \ + spamassassin-run.3 + +MAN1= spamd.1 spamassassin.1 spamc.1 sa-learn.1 sa-update.1 \ + spamassassin-run.1 sa-compile.1 sa-awl.1 + diff --git a/mail/p5-Mail-SpamAssassin/files/pkg-install.in b/mail/p5-Mail-SpamAssassin/files/pkg-install.in new file mode 100644 index 000000000000..3bfcad767407 --- /dev/null +++ b/mail/p5-Mail-SpamAssassin/files/pkg-install.in @@ -0,0 +1,77 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +USER=%%USER%% +GROUP=%%GROUP%% +INSTALL=%%INSTALL%% +PREFIX=%%PREFIX%% + +if [ "$2" = "PRE-INSTALL" ];then exit; fi + +if [ -z "${INSTALL}" ];then +echo "report this problem to scheidell@freebsd.org, $*" +exit 1 +fi + +if [ "$2" = "POST-INSTALL" ];then +ask() { + local question default answer + + question=$1 + default=$2 + if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then + read -t120 -p "${question} [${default}]? " answer + fi + echo ${answer:-${default}} +} + +yesno() { + local question default answer + + question=$1 + default=$2 + while :; do + answer=$(ask "${question}" "${default}") + case "${answer}" in + [Yy]*) return 0;; + [Nn]*) return 1;; + esac + echo "Please answer yes or no." + done +} + + # Create pid directory + + ${INSTALL} -d -o ${USER} -g ${GROUP} /var/run/spamd + ${PREFIX}/bin/spamassassin -x -L --lint + if [ ${?} -ne 0 ];then + echo " +******************************************************* +* _ _ _ _______ ______ __ _ _____ __ _ ______ * +* | | | |_____| |_____/ | \ | | | \ | | ____ * +* |__|__| | | | \_ | \_| __|__ | \_| |_____| * +* * +******************************************************* +* You must install rules before starting spamd! * +*******************************************************" + if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then + if yesno "Do you wish to run sa-update to fetch new rules" "N";then + ${PREFIX}/bin/sa-update || true + else + echo "" + fi + ${PREFIX}/bin/spamassassin -x -L --lint + if [ ${?} -eq 0 ] && grep '^load.*Rule2XSBody' ${PREFIX}/etc/mail/spamassassin/v320.pre > /dev/null ;then + if yesno "Do you wish to compile rules with re2c (will take a long time)" "N";then + ${PREFIX}/bin/sa-compile || true + fi + fi + fi + fi + + exit 0 +fi # post-install + +exit 0 diff --git a/mail/p5-Mail-SpamAssassin/pkg-install b/mail/p5-Mail-SpamAssassin/pkg-install deleted file mode 100644 index f57f9f38ec81..000000000000 --- a/mail/p5-Mail-SpamAssassin/pkg-install +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/sh - -if [ "$2" = "POST-INSTALL" ];then -ask() { - local question default answer - - question=$1 - default=$2 - if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then - read -t120 -p "${question} [${default}]? " answer - fi - echo ${answer:-${default}} -} - -yesno() { - local question default answer - - question=$1 - default=$2 - while :; do - answer=$(ask "${question}" "${default}") - case "${answer}" in - [Yy]*) return 0;; - [Nn]*) return 1;; - esac - echo "Please answer yes or no." - done -} - - # Create pid directory - - ${INSTALL} -d -o ${USER} -g ${GROUP} /var/run/spamd - ${PREFIX}/bin/spamassassin -x -L --lint - if [ ${?} -ne 0 ];then - echo " -******************************************************* -* _ _ _ _______ ______ __ _ _____ __ _ ______ * -* | | | |_____| |_____/ | \ | | | \ | | ____ * -* |__|__| | | | \_ | \_| __|__ | \_| |_____| * -* * -******************************************************* -* You must install rules before starting spamd! * -*******************************************************" - if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then - if yesno "Do you wish to run sa-update to fetch new rules" "N";then - ${PREFIX}/bin/sa-update || true - else - echo "" - fi - ${PREFIX}/bin/spamassassin -x -L --lint - if [ ${?} -eq 0 ] && grep '^load.*Rule2XSBody' ${PREFIX}/etc/mail/spamassassin/v320.pre > /dev/null ;then - if yesno "Do you wish to compile rules with re2c (will take a long time)" "N";then - ${PREFIX}/bin/sa-compile || true - fi - fi - fi - fi - - exit 0 -fi # post-install - -exit 0 -- cgit v1.2.3