/[gentoo-x86]/mail-filter/amavisd-new/amavisd-new-2.6.4.ebuild
Gentoo

Contents of /mail-filter/amavisd-new/amavisd-new-2.6.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Mon Jun 4 21:00:17 2012 UTC (11 months, 1 week ago) by zmedico
Branch: MAIN
Changes since 1.2: +3 -3 lines
inherit user for enewgroup and enewuser

(Portage version: 2.2.0_alpha109_p6/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/mail-filter/amavisd-new/amavisd-new-2.6.4.ebuild,v 1.2 2009/07/19 17:52:28 tove Exp $
4
5 inherit eutils user
6
7 DESCRIPTION="High-performance interface between the MTA and content checkers."
8 HOMEPAGE="http://www.ijs.si/software/amavisd/"
9 SRC_URI="http://www.ijs.si/software/amavisd/${P}.tar.gz"
10
11 LICENSE="GPL-2"
12 SLOT="0"
13 KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
14 IUSE="courier dkim ldap milter mysql postgres qmail razor spamassassin"
15
16 DEPEND=">=sys-apps/sed-4
17 >=dev-lang/perl-5.8.2
18 milter? ( || ( mail-filter/libmilter >=mail-mta/sendmail-8.12 ) )"
19
20 RDEPEND="${DEPEND}
21 >=sys-apps/coreutils-5.0-r3
22 app-arch/gzip
23 app-arch/bzip2
24 app-arch/arc
25 app-arch/cabextract
26 app-arch/freeze
27 app-arch/lha
28 app-arch/unarj
29 || ( app-arch/unrar app-arch/rar )
30 app-arch/zoo
31 >=dev-perl/Archive-Zip-1.14
32 >=virtual/perl-IO-Compress-1.35
33 dev-perl/Convert-TNEF
34 >=dev-perl/Convert-UUlib-1.08
35 virtual/perl-MIME-Base64
36 >=dev-perl/MIME-tools-5.415
37 >=dev-perl/MailTools-1.58
38 >=dev-perl/net-server-0.91
39 virtual/perl-Digest-MD5
40 dev-perl/IO-stringy
41 >=virtual/perl-Time-HiRes-1.49
42 dev-perl/Unix-Syslog
43 >=sys-libs/db-3.2
44 dev-perl/BerkeleyDB
45 dev-perl/Convert-BinHex
46 >=dev-perl/Mail-DKIM-0.31
47 virtual/mta
48 ldap? ( >=dev-perl/perl-ldap-0.33 )
49 mysql? ( dev-perl/DBD-mysql )
50 postgres? ( dev-perl/DBD-Pg )
51 razor? ( mail-filter/razor )
52 spamassassin? ( mail-filter/spamassassin )"
53
54 AMAVIS_ROOT="/var/amavis"
55
56 src_unpack() {
57 unpack ${A}
58 cd "${S}"
59
60 if use courier ; then
61 epatch amavisd-new-courier.patch
62 fi
63
64 if use qmail ; then
65 epatch amavisd-new-qmqpqq.patch
66 fi
67
68 epatch "${FILESDIR}/${PN}-2.6.3-amavisd.conf-gentoo.patch"
69
70 if ! use dkim ; then
71 epatch "${FILESDIR}/${PN}-2.6.3-dkimconf.patch"
72 fi
73 }
74
75 src_compile() {
76 if use milter ; then
77 cd "${S}/helper-progs"
78
79 econf --with-runtime-dir=${AMAVIS_ROOT} \
80 --with-sockname=${AMAVIS_ROOT}/amavisd.sock \
81 --with-user=amavis || die "helper-progs econf failed"
82 emake || die "helper-progs compile problem"
83
84 cd "${S}"
85 fi
86 }
87
88 src_install() {
89 dosbin amavisd amavisd-agent amavisd-nanny amavisd-release
90 dobin p0f-analyzer.pl
91
92 insinto /etc
93 insopts -m0640
94 newins amavisd.conf-sample amavisd.conf
95
96 dosed "s:^#\\?\\\$MYHOME[^;]*;:\$MYHOME = '$AMAVIS_ROOT';:" \
97 /etc/amavisd.conf
98
99 newinitd "${FILESDIR}/amavisd.rc6" amavisd
100 dosed "s:/var/run/amavis/:$AMAVIS_ROOT/:g" /etc/init.d/amavisd
101
102 keepdir ${AMAVIS_ROOT}
103 keepdir ${AMAVIS_ROOT}/db
104 keepdir ${AMAVIS_ROOT}/quarantine
105 keepdir ${AMAVIS_ROOT}/tmp
106
107 newdoc test-messages/README README.samples
108 dodoc AAAREADME.first INSTALL MANIFEST RELEASE_NOTES README_FILES/README.* \
109 test-messages/sample* amavisd.conf-default amavisd-agent \
110 amavisd-custom.conf
111
112 dodir /usr/share/doc/${PF}/html
113 insinto /usr/share/doc/${PF}/html
114 doins README_FILES/*.{html,css}
115 dodir /usr/share/doc/${PF}/html/images
116 insinto /usr/share/doc/${PF}/html/images
117 doins README_FILES/images/*
118
119 if use milter ; then
120 cd "${S}/helper-progs"
121 einstall
122 cd "${S}"
123 fi
124
125 for i in whitelist blacklist spam_lovers; do
126 if [ -f ${AMAVIS_ROOT}/${i} ]; then
127 cp "${AMAVIS_ROOT}/${i}" "${D}/${AMAVIS_ROOT}"
128 else
129 touch "${D}"/${AMAVIS_ROOT}/${i}
130 fi
131 done
132
133 if use ldap ; then
134 elog "Adding ${P} schema to openldap schema dir."
135 dodir /etc/openldap/schema
136 insinto /etc/openldap/schema
137 insopts -o root -g root -m 644
138 newins LDAP.schema ${PN}.schema || die
139 newins LDAP.schema ${PN}.schema.default || die
140 fi
141
142 find "${D}"/${AMAVIS_ROOT} -name "*" -type d -exec chmod 0750 \{\} \;
143 find "${D}"/${AMAVIS_ROOT} -name "*" -type f -exec chmod 0640 \{\} \;
144 }
145
146 pkg_preinst() {
147 enewgroup amavis
148 enewuser amavis -1 -1 ${AMAVIS_ROOT} amavis
149
150 if [ -z "$(dnsdomainname)" ] ; then
151 dosed "s:^#\\?\\\$mydomain[^;]*;:\$mydomain = '$(hostname)';:" \
152 /etc/amavisd.conf
153 else
154 dosed "s:^#\\?\\\$mydomain[^;]*;:\$mydomain = '$(dnsdomainname)';:" \
155 /etc/amavisd.conf
156 fi
157
158 if use razor ; then
159 if [ ! -d ${AMAVIS_ROOT}/.razor ] ; then
160 elog "Setting up initial razor config files..."
161
162 razor-admin -create -home="${D}"/${AMAVIS_ROOT}/.razor
163 sed -i -e "s:debuglevel\([ ]*\)= .:debuglevel\1= 0:g" \
164 "${D}"/${AMAVIS_ROOT}/.razor/razor-agent.conf
165 fi
166 fi
167
168 if ! use spamassassin ; then
169 einfo "Disabling anti-spam code in amavisd.conf..."
170
171 dosed "s:^#[\t ]*@bypass_spam_checks_maps[\t ]*=[\t ]*(1);:\@bypass_spam_checks_maps = (1);:" \
172 /etc/amavisd.conf
173 fi
174 }
175
176 pkg_postinst() {
177 if ! use spamassassin ; then
178 echo
179 elog "Amavisd-new no longer requires SpamAssassin, but no anti-spam checking"
180 elog "will be performed without it. Since you do not have SpamAssassin installed,"
181 elog "all spam checks have been disabled. To enable them, install SpamAssassin"
182 elog "and comment out the line containing: "
183 elog "@bypass_spam_checks_maps = (1); in /etc/amavisd.conf."
184 fi
185 echo
186 ewarn "As of amavisd-new-2.4.5 p0f-analyzer.pl only binds to the loopback interface"
187 ewarn "by default instead of to all interfaces. You will need to change $bind_addr"
188 ewarn "in p0f-analyzer.pl to '0.0.0.0' if p0f-analyzer.pl is running on a different"
189 ewarn "host from amavisd or from other querying clients."
190 echo
191 ewarn "Adjusting permissions for /etc/amavisd.conf (0 for world, owner root:amavis)"
192 echo
193 chmod o-rwx /etc/amavisd.conf
194 chown root:amavis /etc/amavisd.conf
195 chown -R amavis:amavis ${AMAVIS_ROOT}
196 }

  ViewVC Help
Powered by ViewVC 1.1.13