updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / amavisd-new / PKGBUILD
blob081cdbf1924014d8b92aec378c7d36c1313ee625
1 # Maintainer: Techlive Zheng <techlivezheng [at] gmail [dot] com>
2 # Contributor: Piotr Beling <qwak@stud.ics.p.lodz.pl>
3 # Contributor: Wael Nasreddine <wael@phoenixlinux.org>
4 # Contributor: Guillermo A. Amaral <me@guillermoamaral.com> (thewonka)
6 pkgname=amavisd-new
7 pkgver=2.6.4
8 pkgrel=4
9 pkgdesc="A high-performance interface between mailer (MTA) and content checkers. Written in Perl for maintainability."
10 arch=('any')
11 url="http://www.ijs.si/software/amavisd/"
12 license=('GPL')
13 depends=(
14     'perl'
15     'perl-archive-tar'
16     'perl-archive-zip>=1.14'
17     'perl-compress-zlib>=1.35'
18     'perl-compress-raw-zlib>=2.0.17'
19     'perl-convert-tnef'
20     'perl-convert-uulib>=1.08'
21     'perl-mime-base64'
22     'perl-mime-tools'
23     'perl-mailtools>=1.58'
24     'perl-net-server>=0.88'
25     'perl-digest-md5>=2.22'
26     'perl-io-stringy'
27     'perl-time-hires>=1.49'
28     'perl-unix-syslog'
29     'perl-mail-dkim>=0.31'
30     'perl-berkeleydb>=0.42'
32 optdepends=(
33     'gzip:Decoder for .gz files or .z files.'
34     'bzip2:Decoder for .bz2 fiels.'
35     'arc:Alternative decoder for .arc files.'
36     'nomarch:Alternative decoder for .arc files.'
37     'lha:Decoder for .lha files or .exe files.'
38     'p7zip:Decoder for .7z files.'
39     'arj:Alternative decoder for .arj files or .exe files.'
40     'unarj:Alternative decoder for .arj files or .exe files.'
41     'rar:Alternative decoder for .rar files or .exe files.'
42     'unrar:Alternative decoder for .rar files or .exe files.'
43 #    'zoo:MISSING:Alternative decoder for .zoo files.'
44 #    'unzoo:MISSING:Alternative decoder for .zoo files.'
45 #    'freeze:MISSING:Decoder for .f files.'
46 #    'ripole:MISSING:A small program/library designed to pull out attachments from OLE2 data files (ie, MS Office documents).'
47     'lzop:Decoder for .lzo files.'
48     'tnef:Decoder for .tnef files.'
49     'pax:ALternative decoder for .tar files or .cpio files.'
50     'cpio:Alternative decoder for .tar files or .cpio files.'
51     'gcpio:Alternative decoder for .tar files or .cpio files.'
52     'rpm2cpio:Decoder for .rpm files.'
53     'cabextract:Decoder for .cab files.'
54     'perl-dbi:Needed if using SQL lookups or SQL logging/quarantining.'
55     'perl-ldap:Needed if using LDAP lookups.'
56     'perl-authen-sasl:Authenticating on mail forwarding and on submitting DSN.'
57 #    'savi:The Sophos Anti-Virus Interface.'
58 #    'perl-savi>=0.30:Perl module interface to Sophos library.'
59 #    'clamav:Open source antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats.'
60 #    'perl-mail-clamav:Perl module interface to ClamAV library.'
61 #    'spamassassin>=3.1: Perl-based spam filter using text analysis.'
62 #    'perl-mail-spamassassin:Perl-based spam filter using text analysis.'
63 #    'p0f:Passive OS fingerprinting tool.'
64 #    'bdb:Berkeley db libr. used via BerkeleyDB.'
65 #    'dspam:A scalable, open-source statistical anti-spam filter.'
66 #    'mailzu:Quarantine management web UI.'
67 #    'amavisd-milter:alternative sendmail milter helper program supporting the new AM.PDP protocol.'
69 backup=('etc/amavisd/amavisd.conf' 'etc/amavisd/amavisd-custom.conf')
70 changelog=Changelog
71 source=("http://www.ijs.si/software/amavisd/amavisd-new-${pkgver}.tar.gz" "amavisd" "amavisd.conf")
72 install=${pkgname}.install
74 build(){
76     cd ${srcdir}/amavisd-new-${pkgver}
78     # Disable anti-virus and anti-spam support by default,must be enable manually after install clamav or spamassassin.
79     sed -i \
80         -e "s/# @bypass_virus_checks_maps = (1)/@bypass_virus_checks_maps = (1)/g" \
81         -e "s/# @bypass_spam_checks_maps  = (1)/@bypass_spam_checks_maps = (1)/g" \
82         amavisd.conf
84     # Change default amavsid daemon user.
85     sed -i \
86         -e "s/\\\$daemon_user  = 'vscan'/\\\$daemon_user  = 'amavis'/g" \
87         -e "s/\\\$daemon_group = 'vscan'/\\\$daemon_group = 'amavis'/g" \
88         amavisd.conf
90     # Change default amavisd home directory.
91     sed -i \
92         -e "sX# \\\$MYHOME = '/var/amavis'X\\\$MYHOME = '/var/lib/amavis'Xg" \
93         -e "sX\\\$QUARANTINEDIR = '/var/virusmails'X\\\$QUARANTINEDIR = '\\\$MYHOME/virus'Xg" \
94         amavisd.conf
96     # Change default location of amavisd pid and lock file.
97     sed -i \
98         -e "sX# \\\$pid_file  = \"\\\$MYHOME/var/amavisd.pid\"X\\\$pid_file = \"/var/run/amavisd/amavisd.pid\"Xg" \
99         -e "sX# \\\$lock_file = \"\\\$MYHOME/var/amavisd.lock\"X\\\$lock_file = \"/var/run/amavisd/amavisd.lock\"Xg" \
100         amavisd.conf
102     # Change default location of amavisd socket.
103     sed -i \
104         -e "sX\\\$unix_socketname = \"\\\$MYHOME/amavisd.sock\"X\\\$unix_socketname = \"/var/run/amavisd/amavisd.sock\"Xg" \
105         amavisd.conf
109 package(){
111     cd ${srcdir}/amavisd-new-${pkgver}
113     install -D -m755 ${srcdir}/amavisd         ${pkgdir}/etc/rc.d/amavisd                                    || return 1
114     install -D -m755 ${srcdir}/amavisd.conf    ${pkgdir}/etc/conf.d/amavisd.conf                             || return 1
116     install -D -m644 amavisd.conf              ${pkgdir}/etc/amavisd/amavisd.conf                            || return 1
117     install -D -m644 amavisd-custom.conf       ${pkgdir}/etc/amavisd/amavisd-custom.conf                     || return 1
118     install -D -m644 amavisd.conf-sample       ${pkgdir}/etc/amavisd/amavisd.conf-sample                     || return 1
119     install -D -m644 amavisd.conf-default      ${pkgdir}/etc/amavisd/amavisd.conf-default                    || return 1
121     install -D -m755 amavisd                   ${pkgdir}/usr/sbin/amavisd                                    || return 1
122     install -D -m755 amavisd-agent             ${pkgdir}/usr/sbin/amavisd-agent                              || return 1
123     install -D -m755 amavisd-nanny             ${pkgdir}/usr/sbin/amavisd-nanny                              || return 1
124     install -D -m755 amavisd-release           ${pkgdir}/usr/sbin/amavisd-release                            || return 1
125     install -D -m755 amavisd-snmp-subagent     ${pkgdir}/usr/sbin/amavisd-snmp-subagent                      || return 1
127     install -D -m755 p0f-analyzer.pl           ${pkgdir}/usr/sbin/p0f-analyzer.pl                            || return 1
129     install -D -m755 JpegTester.pm             ${pkgdir}/usr/share/perl5/vendor_perl/JpegTester.pm           || return 1
131     install -D -m755 TODO                      ${pkgdir}/usr/share/doc/amavisd-new/TODO                      || return 1
132     install -D -m755 LICENSE                   ${pkgdir}/usr/share/doc/amavisd-new/LICENSE                   || return 1
133     install -D -m755 LDAP.ldif                 ${pkgdir}/usr/share/doc/amavisd-new/LDAP.ldif                 || return 1
134     install -D -m755 LDAP.schema               ${pkgdir}/usr/share/doc/amavisd-new/LDAP.schema               || return 1
135     install -D -m755 RELEASE_NOTES             ${pkgdir}/usr/share/doc/amavisd-new/RELEASE_NOTES             || return 1
136     install -D -m755 AMAVIS-MIB.txt            ${pkgdir}/usr/share/doc/amavisd-new/AMAVIS-MIB.txt            || return 1
137     install -D -m755 AAAREADME.first           ${pkgdir}/usr/share/doc/amavisd-new/README.first              || return 1
138     install -D -m755 amavisd-new-qmqpqq.patch  ${pkgdir}/usr/share/doc/amavisd-new/amavisd-new-qmqpqq.patch  || return 1
139     install -D -m755 amavisd-new-courier.patch ${pkgdir}/usr/share/doc/amavisd-new/amavisd-new-courier.patch || return 1
141     find "README_FILES"  -type f -exec install -D -m644 {,${pkgdir}/usr/share/doc/amavisd-new/}{} \;         || return 1
142     find "test-messages" -type f -exec install -D -m644 {,${pkgdir}/usr/share/doc/amavisd-new/}{} \;         || return 1
145 md5sums=('03d31657f14cd64c1cb38786214234b4'
146          '3ec6da7f0a659d1a017bd73b0c7c3aa3'
147          '756fe29fece79d135850e1cd8c6660a5')