Thu, 23 Apr 2009 15:16:09 +0200
Import package vendor original specs for necessary manipulations.
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/spamassassin/fsl.spamassassin Thu Apr 23 15:16:09 2009 +0200 1.3 @@ -0,0 +1,16 @@ 1.4 +## 1.5 +## fsl.spamassassin -- OSSP fsl configuration 1.6 +## 1.7 + 1.8 +ident (spam[cd])/.+ q{ 1.9 + prefix( 1.10 + prefix="%b %d %H:%M:%S %N <%L> $1[%P]: " 1.11 + ) 1.12 + -> { 1.13 + debug: file( 1.14 + path="@l_prefix@/var/spamassassin/spamassassin.log", 1.15 + perm=0644, jitter=1, monitor=3600 1.16 + ) 1.17 + } 1.18 +}; 1.19 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/spamassassin/local.cf Thu Apr 23 15:16:09 2009 +0200 2.3 @@ -0,0 +1,15 @@ 2.4 +## 2.5 +## @l_prefix@/etc/spamassassin/local.cf -- site-wide defaults for SpamAssassin 2.6 +## (see 'perldoc Mail::SpamAssassin::Conf' for details of what can be tweaked) 2.7 +## 2.8 + 2.9 +# configuration branding 2.10 +version_tag openpkg 2.11 + 2.12 +# required score for mail to be considered as spam 2.13 +required_score 5.0 2.14 + 2.15 +# whitelist and blacklist addresses 2.16 +#whitelist_from *@example.com 2.17 +#whitelist_to *@example.com 2.18 +
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/spamassassin/rc.spamassassin Thu Apr 23 15:16:09 2009 +0200 3.3 @@ -0,0 +1,67 @@ 3.4 +#!@l_prefix@/bin/openpkg rc 3.5 +## 3.6 +## rc.spamassassin -- Run-Commands 3.7 +## 3.8 + 3.9 +%config 3.10 + spamassassin_enable="$openpkg_rc_def" 3.11 + spamassassin_bind="127.0.0.1" 3.12 + spamassassin_port="783" 3.13 + spamassassin_flags="-A 127. --local" 3.14 + spamassassin_stop_delay="2" 3.15 + spamassassin_log_prolog="true" 3.16 + spamassassin_log_epilog="true" 3.17 + spamassassin_log_numfiles="10" 3.18 + spamassassin_log_minsize="1M" 3.19 + spamassassin_log_complevel="9" 3.20 + 3.21 +%common 3.22 + spamassassin_etcdir="@l_prefix@/etc/spamassassin" 3.23 + spamassassin_pidfile="@l_prefix@/var/spamassassin/spamassassin.pid" 3.24 + spamassassin_logfile="@l_prefix@/var/spamassassin/spamassassin.log" 3.25 + spamassassin_signal () { 3.26 + [ -f $spamassassin_pidfile ] && kill -$1 `cat $spamassassin_pidfile` 3.27 + } 3.28 + 3.29 +%status -u @l_susr@ -o 3.30 + spamassassin_usable="unknown" 3.31 + spamassassin_active="no" 3.32 + rcService spamassassin enable yes && \ 3.33 + spamassassin_signal 0 && spamassassin_active="yes" 3.34 + echo "spamassassin_enable=\"$spamassassin_enable\"" 3.35 + echo "spamassassin_usable=\"$spamassassin_usable\"" 3.36 + echo "spamassassin_active=\"$spamassassin_active\"" 3.37 + 3.38 +%start -p 400 -u @l_susr@ 3.39 + rcService spamassassin enable yes || exit 0 3.40 + rcService spamassassin active yes && exit 0 3.41 + @l_prefix@/bin/spamd \ 3.42 + --daemonize \ 3.43 + --siteconfigpath="${spamassassin_etcdir}" \ 3.44 + --pidfile="${spamassassin_pidfile}" \ 3.45 + --syslog="${spamassassin_logfile}" \ 3.46 + --listen-ip="${spamassassin_bind}" \ 3.47 + --port="${spamassassin_port}" \ 3.48 + ${spamassassin_flags} 3.49 + 3.50 +%stop -p 400 -u @l_susr@ 3.51 + rcService spamassassin enable yes || exit 0 3.52 + rcService spamassassin active no && exit 0 3.53 + spamassassin_signal TERM 3.54 + sleep "$spamassassin_stop_delay" 3.55 + 3.56 +%restart -p 600 -u @l_susr@ 3.57 + rcService spamassassin enable yes || exit 0 3.58 + rcService spamassassin active no && exit 0 3.59 + rc spamassassin stop 3.60 + rc spamassassin start 3.61 + 3.62 +%daily -u @l_susr@ 3.63 + rcService spamassassin enable yes || exit 0 3.64 + shtool rotate -f \ 3.65 + -n ${spamassassin_log_numfiles} -s ${spamassassin_log_minsize} -d \ 3.66 + -z ${spamassassin_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ 3.67 + -P "${spamassassin_log_prolog}" \ 3.68 + -E "${spamassassin_log_epilog}; rc spamassassin restart" \ 3.69 + $spamassassin_logfile 3.70 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/spamassassin/spamassassin.spec Thu Apr 23 15:16:09 2009 +0200 4.3 @@ -0,0 +1,167 @@ 4.4 +## 4.5 +## spamassassin.spec -- OpenPKG RPM Package Specification 4.6 +## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/> 4.7 +## 4.8 +## Permission to use, copy, modify, and distribute this software for 4.9 +## any purpose with or without fee is hereby granted, provided that 4.10 +## the above copyright notice and this permission notice appear in all 4.11 +## copies. 4.12 +## 4.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 4.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 4.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 4.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 4.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 4.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 4.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 4.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 4.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 4.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 4.24 +## SUCH DAMAGE. 4.25 +## 4.26 + 4.27 +# package version 4.28 +%define V_real 3.2.5 4.29 +%define V_here 3.2.5 4.30 +%define V_sdir 3.2.5 4.31 + 4.32 +# package information 4.33 +Name: spamassassin 4.34 +Summary: Mail Filter Identifying Spam 4.35 +URL: http://spamassassin.apache.org/ 4.36 +Vendor: Justin Mason 4.37 +Packager: OpenPKG Foundation e.V. 4.38 +Distribution: OpenPKG Community 4.39 +Class: BASE 4.40 +Group: Mail 4.41 +License: ASF 4.42 +Version: %{V_here} 4.43 +Release: 20090420 4.44 + 4.45 +# package options 4.46 +%option with_fsl yes 4.47 + 4.48 +# list of sources 4.49 +Source0: http://www.apache.org/dist/spamassassin/source/Mail-SpamAssassin-%{V_real}.tar.gz 4.50 +Source1: rc.spamassassin 4.51 +Source2: local.cf 4.52 +Source3: fsl.spamassassin 4.53 + 4.54 +# build information 4.55 +Prefix: %{l_prefix} 4.56 +BuildRoot: %{l_buildroot} 4.57 +BuildPreReq: OpenPKG, openpkg >= 20060823, perl, perl-openpkg >= 5.8.4, make 4.58 +PreReq: OpenPKG, openpkg >= 20060823, perl 4.59 +BuildPreReq: perl-db, perl-crypto, perl-xml, perl-dns 4.60 +PreReq: perl-db, perl-crypto, perl-xml, perl-dns 4.61 +%if "%{with_fsl}" == "yes" 4.62 +BuildPreReq: fsl 4.63 +PreReq: fsl 4.64 +%endif 4.65 +AutoReq: no 4.66 +AutoReqProv: no 4.67 + 4.68 +%description 4.69 + SpamAssassin provides you with a way to reduce if not completely 4.70 + eliminate Unsolicited Commercial Email (UCE, aka SPAM) from your 4.71 + incoming email. It uses a genetic-algorithm evolved scoring system 4.72 + to identify messages which look spammy, then adds headers to the 4.73 + message so they can be filtered by the user's mail reading software. 4.74 + This distribution includes the spamd/spamc components which create a 4.75 + server that considerably speeds processing of mail. 4.76 + 4.77 +%track 4.78 + prog spamassassin = { 4.79 + version = %{V_real} 4.80 + url = http://www.apache.org/dist/spamassassin/source/ 4.81 + regex = Mail-SpamAssassin-(\d+\.\d+\.\d+)\.tar\.gz 4.82 + } 4.83 + 4.84 +%prep 4.85 + %setup -q -n Mail-SpamAssassin-%{V_sdir} 4.86 + 4.87 +%build 4.88 + # configure package 4.89 + %{l_prefix}/bin/perl-openpkg prepare 4.90 + export CC="%{l_cc}" 4.91 + export CFLAGS="%{l_cflags -O} -Ispamc %{l_cppflags}" 4.92 + export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}" 4.93 + export LIBS="%{l_ldflags} %{l_fsl_ldflags} %{l_fsl_libs}" 4.94 + %{l_prefix}/bin/perl-openpkg configure \ 4.95 + -A DESTDIR="$RPM_BUILD_ROOT" \ 4.96 + -A PREFIX="%{l_prefix}" \ 4.97 + -A SYSCONFDIR="%{l_prefix}/etc/spamassassin" \ 4.98 + -A LOCALRULESDIR="%{l_prefix}/etc/spamassassin" \ 4.99 + -A DATADIR="%{l_prefix}/share/spamassassin" \ 4.100 + -A PERL_BIN="%{l_prefix}/bin/perl" 4.101 + 4.102 + # build package 4.103 + %{l_make} %{l_mflags} 4.104 + 4.105 +%install 4.106 + rm -rf $RPM_BUILD_ROOT 4.107 + 4.108 + # install package 4.109 + %{l_make} %{l_mflags} install 4.110 + 4.111 + # install default configuration 4.112 + %{l_shtool} mkdir -f -p -m 755 \ 4.113 + $RPM_BUILD_ROOT%{l_prefix}/etc/spamassassin 4.114 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 4.115 + %{SOURCE local.cf} \ 4.116 + $RPM_BUILD_ROOT%{l_prefix}/etc/spamassassin/ 4.117 + 4.118 + # create directory for PID file 4.119 + %{l_shtool} mkdir -f -p -m 755 \ 4.120 + $RPM_BUILD_ROOT%{l_prefix}/var/spamassassin 4.121 + 4.122 + # strip installation 4.123 + chmod u+w $RPM_BUILD_ROOT%{l_prefix}/bin/* 4.124 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 4.125 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3 4.126 + 4.127 + # install run-command script 4.128 + %{l_shtool} mkdir -f -p -m 755 \ 4.129 + $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d 4.130 + %{l_shtool} install -c -m 755 %{l_value -s -a} \ 4.131 + %{SOURCE rc.spamassassin} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ 4.132 + 4.133 + # install OSSP fsl configuration 4.134 + %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl 4.135 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 4.136 + %{SOURCE fsl.spamassassin} \ 4.137 + $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ 4.138 + 4.139 + # determine installation files 4.140 + %{l_prefix}/bin/perl-openpkg \ 4.141 + -F perl-openpkg-files \ 4.142 + fixate cleanup 4.143 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 4.144 + %{l_files_std} \ 4.145 + '%config %{l_prefix}/etc/fsl/fsl.spamassassin' \ 4.146 + '%config %{l_prefix}/etc/spamassassin/*' \ 4.147 + '%attr(775,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/spamassassin' \ 4.148 + '%attr(4755,%{l_rusr},%{l_mgrp}) %{l_prefix}/bin/spamc' \ 4.149 + `cat perl-openpkg-files` 4.150 + 4.151 +%files -f files 4.152 + 4.153 +%clean 4.154 + rm -rf $RPM_BUILD_ROOT 4.155 + 4.156 +%post 4.157 + # after upgrade, restart service 4.158 + [ $1 -eq 2 ] || exit 0 4.159 + eval `%{l_rc} spamassassin status 2>/dev/null` 4.160 + [ ".$spamassassin_active" = .yes ] && %{l_rc} spamassassin restart 4.161 + exit 0 4.162 + 4.163 +%preun 4.164 + # before erase, stop service 4.165 + [ $1 -eq 0 ] || exit 0 4.166 + %{l_rc} spamassassin stop 2>/dev/null 4.167 + rm -f $RPM_INSTALL_PREFIX/var/spamassassin/*.pid >/dev/null 2>&1 || true 4.168 + rm -f $RPM_INSTALL_PREFIX/var/spamassassin/*.log* >/dev/null 2>&1 || true 4.169 + exit 0 4.170 +