spamassassin/spamassassin.spec

Tue, 28 Aug 2012 18:29:00 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 28 Aug 2012 18:29:00 +0200
changeset 532
e5f1af644b30
parent 194
42dc0386ad57
child 629
27f852b7efd2
permissions
-rw-r--r--

Massively update modules from Drupal 6.x to 7.x, and add diverse OpenID modules.
Unfortunately many modules available to Drupal 6.x installations have not been
since maintained or ported to 7.x causing this package to diminish in both size
and utility.

michael@191 1 ##
michael@191 2 ## spamassassin.spec -- OpenPKG RPM Package Specification
michael@374 3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@191 4 ##
michael@191 5 ## Permission to use, copy, modify, and distribute this software for
michael@191 6 ## any purpose with or without fee is hereby granted, provided that
michael@191 7 ## the above copyright notice and this permission notice appear in all
michael@191 8 ## copies.
michael@191 9 ##
michael@191 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@191 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@191 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@191 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@191 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@191 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@191 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@191 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@191 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@191 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@191 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@191 21 ## SUCH DAMAGE.
michael@191 22 ##
michael@191 23
michael@191 24 # package version
michael@374 25 %define V_real 3.3.1
michael@374 26 %define V_here 3.3.1
michael@374 27 %define V_sdir 3.3.1
michael@191 28
michael@191 29 # package information
michael@191 30 Name: spamassassin
michael@191 31 Summary: Mail Filter Identifying Spam
michael@191 32 URL: http://spamassassin.apache.org/
michael@191 33 Vendor: Justin Mason
michael@191 34 Packager: OpenPKG Foundation e.V.
michael@191 35 Distribution: OpenPKG Community
michael@191 36 Class: BASE
michael@191 37 Group: Mail
michael@191 38 License: ASF
michael@191 39 Version: %{V_here}
michael@374 40 Release: 20110914
michael@191 41
michael@191 42 # package options
michael@191 43 %option with_fsl yes
michael@191 44
michael@191 45 # list of sources
michael@191 46 Source0: http://www.apache.org/dist/spamassassin/source/Mail-SpamAssassin-%{V_real}.tar.gz
michael@191 47 Source1: rc.spamassassin
michael@191 48 Source2: local.cf
michael@191 49 Source3: fsl.spamassassin
michael@374 50 Patch0: spamassassin.patch
michael@191 51
michael@191 52 # build information
michael@191 53 Prefix: %{l_prefix}
michael@191 54 BuildRoot: %{l_buildroot}
michael@191 55 BuildPreReq: OpenPKG, openpkg >= 20060823, perl, perl-openpkg >= 5.8.4, make
michael@374 56 PreReq: OpenPKG, openpkg >= 20060823, perl, gnupg
michael@374 57 BuildPreReq: perl-db, perl-crypto, perl-xml, perl-dns, perl-locale, perl-www
michael@374 58 PreReq: perl-db, perl-crypto, perl-xml, perl-dns, perl-locale, perl-www
michael@191 59 %if "%{with_fsl}" == "yes"
michael@191 60 BuildPreReq: fsl
michael@191 61 PreReq: fsl
michael@191 62 %endif
michael@191 63 AutoReq: no
michael@191 64 AutoReqProv: no
michael@191 65
michael@191 66 %description
michael@191 67 SpamAssassin provides you with a way to reduce if not completely
michael@191 68 eliminate Unsolicited Commercial Email (UCE, aka SPAM) from your
michael@191 69 incoming email. It uses a genetic-algorithm evolved scoring system
michael@191 70 to identify messages which look spammy, then adds headers to the
michael@191 71 message so they can be filtered by the user's mail reading software.
michael@191 72 This distribution includes the spamd/spamc components which create a
michael@191 73 server that considerably speeds processing of mail.
michael@191 74
michael@191 75 %track
michael@191 76 prog spamassassin = {
michael@191 77 version = %{V_real}
michael@191 78 url = http://www.apache.org/dist/spamassassin/source/
michael@191 79 regex = Mail-SpamAssassin-(\d+\.\d+\.\d+)\.tar\.gz
michael@191 80 }
michael@191 81
michael@191 82 %prep
michael@191 83 %setup -q -n Mail-SpamAssassin-%{V_sdir}
michael@374 84 %patch -p0
michael@191 85
michael@191 86 %build
michael@191 87 # configure package
michael@191 88 %{l_prefix}/bin/perl-openpkg prepare
michael@191 89 export CC="%{l_cc}"
michael@191 90 export CFLAGS="%{l_cflags -O} -Ispamc %{l_cppflags}"
michael@191 91 export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}"
michael@191 92 export LIBS="%{l_ldflags} %{l_fsl_ldflags} %{l_fsl_libs}"
michael@191 93 %{l_prefix}/bin/perl-openpkg configure \
michael@191 94 -A DESTDIR="$RPM_BUILD_ROOT" \
michael@191 95 -A PREFIX="%{l_prefix}" \
michael@191 96 -A SYSCONFDIR="%{l_prefix}/etc/spamassassin" \
michael@191 97 -A LOCALRULESDIR="%{l_prefix}/etc/spamassassin" \
michael@191 98 -A DATADIR="%{l_prefix}/share/spamassassin" \
michael@191 99 -A PERL_BIN="%{l_prefix}/bin/perl"
michael@191 100
michael@191 101 # build package
michael@191 102 %{l_make} %{l_mflags}
michael@191 103
michael@191 104 %install
michael@191 105 rm -rf $RPM_BUILD_ROOT
michael@191 106
michael@191 107 # install package
michael@191 108 %{l_make} %{l_mflags} install
michael@191 109
michael@191 110 # install default configuration
michael@191 111 %{l_shtool} mkdir -f -p -m 755 \
michael@191 112 $RPM_BUILD_ROOT%{l_prefix}/etc/spamassassin
michael@191 113 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@191 114 %{SOURCE local.cf} \
michael@191 115 $RPM_BUILD_ROOT%{l_prefix}/etc/spamassassin/
michael@191 116
michael@192 117 # create directories for PID file and virtual users
michael@191 118 %{l_shtool} mkdir -f -p -m 755 \
michael@192 119 $RPM_BUILD_ROOT%{l_prefix}/var/spamassassin/spool
michael@191 120
michael@191 121 # strip installation
michael@191 122 chmod u+w $RPM_BUILD_ROOT%{l_prefix}/bin/*
michael@191 123 strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
michael@191 124 rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
michael@191 125
michael@192 126 # install runcommand script
michael@191 127 %{l_shtool} mkdir -f -p -m 755 \
michael@191 128 $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
michael@191 129 %{l_shtool} install -c -m 755 %{l_value -s -a} \
michael@191 130 %{SOURCE rc.spamassassin} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
michael@191 131
michael@191 132 # install OSSP fsl configuration
michael@191 133 %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
michael@191 134 %{l_shtool} install -c -m 644 %{l_value -s -a} \
michael@191 135 %{SOURCE fsl.spamassassin} \
michael@191 136 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
michael@191 137
michael@191 138 # determine installation files
michael@191 139 %{l_prefix}/bin/perl-openpkg \
michael@191 140 -F perl-openpkg-files \
michael@191 141 fixate cleanup
michael@191 142 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@191 143 %{l_files_std} \
michael@191 144 '%config %{l_prefix}/etc/fsl/fsl.spamassassin' \
michael@191 145 '%config %{l_prefix}/etc/spamassassin/*' \
michael@191 146 '%attr(775,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/spamassassin' \
michael@192 147 '%attr(755,%{l_susr},%{l_sgrp}) %{l_prefix}/var/spamassassin/spool' \
michael@191 148 '%attr(4755,%{l_rusr},%{l_mgrp}) %{l_prefix}/bin/spamc' \
michael@191 149 `cat perl-openpkg-files`
michael@191 150
michael@191 151 %files -f files
michael@191 152
michael@191 153 %clean
michael@191 154 rm -rf $RPM_BUILD_ROOT
michael@191 155
michael@191 156 %post
michael@191 157 # after upgrade, restart service
michael@191 158 [ $1 -eq 2 ] || exit 0
michael@191 159 eval `%{l_rc} spamassassin status 2>/dev/null`
michael@191 160 [ ".$spamassassin_active" = .yes ] && %{l_rc} spamassassin restart
michael@191 161 exit 0
michael@191 162
michael@191 163 %preun
michael@191 164 # before erase, stop service
michael@191 165 [ $1 -eq 0 ] || exit 0
michael@191 166 %{l_rc} spamassassin stop 2>/dev/null
michael@191 167 rm -f $RPM_INSTALL_PREFIX/var/spamassassin/*.pid >/dev/null 2>&1 || true
michael@191 168 rm -f $RPM_INSTALL_PREFIX/var/spamassassin/*.log* >/dev/null 2>&1 || true
michael@191 169 exit 0
michael@191 170

mercurial