spamassassin/spamassassin.spec

changeset 191
d980506f80fc
child 192
62106debeb75
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/spamassassin/spamassassin.spec	Thu Apr 23 15:16:09 2009 +0200
     1.3 @@ -0,0 +1,167 @@
     1.4 +##
     1.5 +##  spamassassin.spec -- OpenPKG RPM Package Specification
     1.6 +##  Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
     1.7 +##
     1.8 +##  Permission to use, copy, modify, and distribute this software for
     1.9 +##  any purpose with or without fee is hereby granted, provided that
    1.10 +##  the above copyright notice and this permission notice appear in all
    1.11 +##  copies.
    1.12 +##
    1.13 +##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
    1.14 +##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    1.15 +##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    1.16 +##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
    1.17 +##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    1.18 +##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    1.19 +##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
    1.20 +##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    1.21 +##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
    1.22 +##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
    1.23 +##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    1.24 +##  SUCH DAMAGE.
    1.25 +##
    1.26 +
    1.27 +#   package version
    1.28 +%define       V_real 3.2.5
    1.29 +%define       V_here 3.2.5
    1.30 +%define       V_sdir 3.2.5
    1.31 +
    1.32 +#   package information
    1.33 +Name:         spamassassin
    1.34 +Summary:      Mail Filter Identifying Spam
    1.35 +URL:          http://spamassassin.apache.org/
    1.36 +Vendor:       Justin Mason
    1.37 +Packager:     OpenPKG Foundation e.V.
    1.38 +Distribution: OpenPKG Community
    1.39 +Class:        BASE
    1.40 +Group:        Mail
    1.41 +License:      ASF
    1.42 +Version:      %{V_here}
    1.43 +Release:      20090420
    1.44 +
    1.45 +#   package options
    1.46 +%option       with_fsl  yes
    1.47 +
    1.48 +#   list of sources
    1.49 +Source0:      http://www.apache.org/dist/spamassassin/source/Mail-SpamAssassin-%{V_real}.tar.gz
    1.50 +Source1:      rc.spamassassin
    1.51 +Source2:      local.cf
    1.52 +Source3:      fsl.spamassassin
    1.53 +
    1.54 +#   build information
    1.55 +Prefix:       %{l_prefix}
    1.56 +BuildRoot:    %{l_buildroot}
    1.57 +BuildPreReq:  OpenPKG, openpkg >= 20060823, perl, perl-openpkg >= 5.8.4, make
    1.58 +PreReq:       OpenPKG, openpkg >= 20060823, perl
    1.59 +BuildPreReq:  perl-db, perl-crypto, perl-xml, perl-dns
    1.60 +PreReq:       perl-db, perl-crypto, perl-xml, perl-dns
    1.61 +%if "%{with_fsl}" == "yes"
    1.62 +BuildPreReq:  fsl
    1.63 +PreReq:       fsl
    1.64 +%endif
    1.65 +AutoReq:      no
    1.66 +AutoReqProv:  no
    1.67 +
    1.68 +%description
    1.69 +    SpamAssassin provides you with a way to reduce if not completely
    1.70 +    eliminate Unsolicited Commercial Email (UCE, aka SPAM) from your
    1.71 +    incoming email. It uses a genetic-algorithm evolved scoring system
    1.72 +    to identify messages which look spammy, then adds headers to the
    1.73 +    message so they can be filtered by the user's mail reading software.
    1.74 +    This distribution includes the spamd/spamc components which create a
    1.75 +    server that considerably speeds processing of mail.
    1.76 +
    1.77 +%track
    1.78 +    prog spamassassin = {
    1.79 +        version   = %{V_real}
    1.80 +        url       = http://www.apache.org/dist/spamassassin/source/
    1.81 +        regex     = Mail-SpamAssassin-(\d+\.\d+\.\d+)\.tar\.gz
    1.82 +    }
    1.83 +
    1.84 +%prep
    1.85 +    %setup -q -n Mail-SpamAssassin-%{V_sdir}
    1.86 +
    1.87 +%build
    1.88 +    #   configure package
    1.89 +    %{l_prefix}/bin/perl-openpkg prepare
    1.90 +    export CC="%{l_cc}"
    1.91 +    export CFLAGS="%{l_cflags -O} -Ispamc %{l_cppflags}"
    1.92 +    export LDFLAGS="%{l_ldflags} %{l_fsl_ldflags}"
    1.93 +    export LIBS="%{l_ldflags} %{l_fsl_ldflags} %{l_fsl_libs}"
    1.94 +    %{l_prefix}/bin/perl-openpkg configure \
    1.95 +        -A DESTDIR="$RPM_BUILD_ROOT" \
    1.96 +        -A PREFIX="%{l_prefix}" \
    1.97 +        -A SYSCONFDIR="%{l_prefix}/etc/spamassassin" \
    1.98 +        -A LOCALRULESDIR="%{l_prefix}/etc/spamassassin" \
    1.99 +        -A DATADIR="%{l_prefix}/share/spamassassin" \
   1.100 +        -A PERL_BIN="%{l_prefix}/bin/perl"
   1.101 +
   1.102 +    #   build package
   1.103 +    %{l_make} %{l_mflags}
   1.104 +
   1.105 +%install
   1.106 +    rm -rf $RPM_BUILD_ROOT
   1.107 +
   1.108 +    #   install package
   1.109 +    %{l_make} %{l_mflags} install
   1.110 +
   1.111 +    #   install default configuration
   1.112 +    %{l_shtool} mkdir -f -p -m 755 \
   1.113 +        $RPM_BUILD_ROOT%{l_prefix}/etc/spamassassin
   1.114 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.115 +        %{SOURCE local.cf} \
   1.116 +        $RPM_BUILD_ROOT%{l_prefix}/etc/spamassassin/
   1.117 +
   1.118 +    #   create directory for PID file
   1.119 +    %{l_shtool} mkdir -f -p -m 755 \
   1.120 +        $RPM_BUILD_ROOT%{l_prefix}/var/spamassassin
   1.121 +
   1.122 +    #   strip installation
   1.123 +    chmod u+w $RPM_BUILD_ROOT%{l_prefix}/bin/*
   1.124 +    strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
   1.125 +    rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/man3
   1.126 +
   1.127 +    #   install run-command script
   1.128 +    %{l_shtool} mkdir -f -p -m 755 \
   1.129 +        $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d
   1.130 +    %{l_shtool} install -c -m 755 %{l_value -s -a} \
   1.131 +        %{SOURCE rc.spamassassin} $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/
   1.132 +
   1.133 +    #   install OSSP fsl configuration
   1.134 +    %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/etc/fsl
   1.135 +    %{l_shtool} install -c -m 644 %{l_value -s -a} \
   1.136 +        %{SOURCE fsl.spamassassin} \
   1.137 +        $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/
   1.138 +
   1.139 +    #   determine installation files
   1.140 +    %{l_prefix}/bin/perl-openpkg \
   1.141 +        -F perl-openpkg-files \
   1.142 +        fixate cleanup
   1.143 +    %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   1.144 +        %{l_files_std} \
   1.145 +        '%config %{l_prefix}/etc/fsl/fsl.spamassassin' \
   1.146 +        '%config %{l_prefix}/etc/spamassassin/*' \
   1.147 +        '%attr(775,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/spamassassin' \
   1.148 +        '%attr(4755,%{l_rusr},%{l_mgrp}) %{l_prefix}/bin/spamc' \
   1.149 +        `cat perl-openpkg-files`
   1.150 +
   1.151 +%files -f files
   1.152 +
   1.153 +%clean
   1.154 +    rm -rf $RPM_BUILD_ROOT
   1.155 +
   1.156 +%post
   1.157 +    #   after upgrade, restart service
   1.158 +    [ $1 -eq 2 ] || exit 0
   1.159 +    eval `%{l_rc} spamassassin status 2>/dev/null`
   1.160 +    [ ".$spamassassin_active" = .yes ] && %{l_rc} spamassassin restart
   1.161 +    exit 0
   1.162 +
   1.163 +%preun
   1.164 +    #   before erase, stop service
   1.165 +    [ $1 -eq 0 ] || exit 0
   1.166 +    %{l_rc} spamassassin stop 2>/dev/null
   1.167 +    rm -f $RPM_INSTALL_PREFIX/var/spamassassin/*.pid >/dev/null 2>&1 || true
   1.168 +    rm -f $RPM_INSTALL_PREFIX/var/spamassassin/*.log* >/dev/null 2>&1 || true
   1.169 +    exit 0
   1.170 +

mercurial