2 changed files with 176 additions and 0 deletions
@ -0,0 +1,154 @@
|
||||
## |
||||
## amavisd.spec -- OpenPKG RPM Specification |
||||
## Copyright (c) 2000-2003 Cable & Wireless Deutschland GmbH |
||||
## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/> |
||||
## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com> |
||||
## |
||||
## Permission to use, copy, modify, and distribute this software for |
||||
## any purpose with or without fee is hereby granted, provided that |
||||
## the above copyright notice and this permission notice appear in all |
||||
## copies. |
||||
## |
||||
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
||||
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
||||
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
||||
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
||||
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
||||
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
||||
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
||||
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
||||
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
||||
## SUCH DAMAGE. |
||||
## |
||||
|
||||
# FIXME mlelstv - junk because untested, especially milter option |
||||
|
||||
# version numbers |
||||
%define V_base 20030314 |
||||
%define V_pl 1 |
||||
%define V_openpkg %{V_base}_p%{V_pl} |
||||
%define V_vendor %{V_base}-p%{V_pl} |
||||
|
||||
# package information |
||||
Name: amavisd |
||||
Summary: Badly Packaged Program |
||||
URL: http://www.amavisd.org/ |
||||
Vendor: John Doe |
||||
Packager: The OpenPKG Project |
||||
Distribution: OpenPKG [JUNK] |
||||
Group: Mail |
||||
License: GPL |
||||
Version: %{V_openpkg} |
||||
Release: 20030422 |
||||
|
||||
# package options |
||||
%option with_milter no |
||||
|
||||
# list of sources |
||||
Source0: http://www.ijs.si/software/amavisd/amavisd-new-%{V_vendor}.tar.gz |
||||
Source1: rc.amavisd |
||||
|
||||
# build information |
||||
Prefix: %{l_prefix} |
||||
BuildRoot: %{l_buildroot} |
||||
BuildPreReq: OpenPKG, openpkg >= 20030103 |
||||
PreReq: OpenPKG, openpkg >= 20030103, perl |
||||
PreReq: perl-net, perl-util, perl-mail, perl-time |
||||
PreReq: perl-sys, perl-comp, perl-conv, spamassassin |
||||
%if "%{with_milter}" == "yes" |
||||
BuildPreReq: sendmail, sendmail::with_milter |
||||
PreReq: sendmail, sendmail::with_milter |
||||
%endif |
||||
AutoReq: no |
||||
AutoReqProv: no |
||||
|
||||
%description |
||||
amavisd-new is a high-performance interface between mailer (MTA) and |
||||
content checkers: virus scanners, and/or SpamAssasin. It is written |
||||
in Perl for maintainability, without paying a significant price |
||||
for speed. It talks to MTA via (E)SMTP or LMTP, or by using helper |
||||
programs. Best with Postfix, works with Exim, sendmail/milter, or |
||||
with any MTA as a SMTP relay. |
||||
|
||||
%prep |
||||
%setup -q -n %{name}-new-%{V_base} |
||||
|
||||
%build |
||||
%if "%{with_milter}" == "yes" |
||||
cd helper-progs |
||||
CC="%{l_cc}" \ |
||||
CFLAGS="%{l_cflags -O}" \ |
||||
LDFLAGS="%{l_ldflags}" \ |
||||
./configure |
||||
--prefix="%{l_prefix}" \ |
||||
--with-sendmail="%{l_prefix}/sbin/sendmail" \ |
||||
--with-runtime-dir="%{l_prefix}/var/amavisd" \ |
||||
--with-sockname="%{l_prefix}/var/amavisd/amavisd.sock" \ |
||||
--with-user="@l_rusr@" \ |
||||
--with-milterinc="%{l_prefix}/include/libmilter" \ |
||||
--with-milterlib="%{l_prefix}/lib" |
||||
%endif |
||||
|
||||
%install |
||||
rm -rf $RPM_BUILD_ROOT |
||||
|
||||
%{l_shtool} mkdir -f -p -m 755 \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/sbin \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/amavisd \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/test-messages \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/share/amavisd/README_FILES \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/var/amavisd \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/var/amavisd/virusmails |
||||
|
||||
%{l_shtool} install -c -m 755 \ |
||||
-e '1s;/usr/bin/perl;%{l_prefix}/bin/perl;' \ |
||||
-e 's;/var/amavis;%{l_prefix}/var/amavisd;g' \ |
||||
-e 's;/etc/amavisd.conf;%{l_prefix}/etc/amavisd/amavisd.conf;g' \ |
||||
amavisd \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/sbin/ |
||||
|
||||
%{l_shtool} install -c -m 644 \ |
||||
-e 's;/var/amavis;%{l_prefix}/var/amavisd;g' \ |
||||
-e 's;/var/virusmails;%{l_prefix}/var/amavisd/virusmails;g' \ |
||||
-e 's;/usr/bin/sendmail;%{l_prefix}/bin/sendmail;g' \ |
||||
-e 's; -C/etc/sendmail.orig.cf ;;g' \ |
||||
-e 's;/usr/bin/exim;%{l_prefix}/bin/exim;g' \ |
||||
-e 's;/usr/local/sbin;%{l_prefix}/sbin;g' \ |
||||
-e 's;/usr/local/bin;%{l_prefix}/bin;g' \ |
||||
-e 's;\(daemon_user *= \)[^;]*;\1q{%{l_rusr}};' \ |
||||
-e 's;\(daemon_group *= \)[^;]*;\1q{%{l_rgrp}};' \ |
||||
amavisd.conf \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/ |
||||
|
||||
%{l_shtool} install -c -m 644 \ |
||||
test-messages/* \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/amavisd/test-messages/ |
||||
|
||||
%{l_shtool} install -c -m 644 \ |
||||
README_FILES/* \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/share/amavisd/README_FILES/ |
||||
|
||||
%{l_shtool} install -c -m 644 \ |
||||
RELEASE_NOTES \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/share/amavisd/ |
||||
|
||||
%{l_shtool} install -c -m 755 \ |
||||
-e 's;@l_prefix@;%{l_prefix};g' \ |
||||
-e 's;@l_rusr@;%{l_rusr};g' \ |
||||
%{SOURCE rc.amavisd} \ |
||||
$RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
||||
|
||||
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} \ |
||||
'%config %{l_prefix}/etc/amavisd/amavisd.conf' \ |
||||
'%config %{l_prefix}/etc/amavisd/test-message/*' \ |
||||
'%attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/amavisd' \ |
||||
'%attr(0750,%{l_rusr},%{l_rgrp}) %{l_prefix}/var/amavisd/virusmails' |
||||
|
||||
%files -f files |
||||
|
||||
%clean |
||||
rm -rf $RPM_BUILD_ROOT |
||||
|
||||
@ -0,0 +1,22 @@
|
||||
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc |
||||
## |
||||
## rc.amavisd -- AmavisD Administration Run-Commands |
||||
## |
||||
|
||||
%config |
||||
amavisd_enable="yes" |
||||
amavisd_config="@l_prefix@/etc/amavisd/amavisd.conf" |
||||
|
||||
%start -p 200 -u @l_rusr@ |
||||
opServiceEnabled amavisd || exit 0 |
||||
@l_prefix@/sbin/amavisd -c $amavisd_config |
||||
|
||||
%stop -p 200 -u @l_rusr@ |
||||
opServiceEnabled amavisd || exit 0 |
||||
@l_prefix@/sbin/amavisd -c $amavisd_config stop |
||||
|
||||
%restart -u @l_rusr@ |
||||
opServiceEnabled amavisd || exit 0 |
||||
@l_prefix@/sbin/amavisd -c $amavisd_config stop |
||||
@l_prefix@/sbin/amavisd -c $amavisd_config |
||||
|
||||
Loading…
Reference in new issue