Gentoo Archives: gentoo-commits

From: "Markus Ullmann (jokey)" <jokey@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-filter/MailScanner: ChangeLog MailScanner-4.70.7.1.ebuild
Date: Sat, 30 Aug 2008 20:32:26
Message-Id: E1KZX7O-0007iL-MK@stork.gentoo.org
1 jokey 08/08/30 20:32:22
2
3 Modified: ChangeLog
4 Added: MailScanner-4.70.7.1.ebuild
5 Log:
6 Version bump
7 (Portage version: 2.2_rc8/cvs/Linux 2.6.26-gentoo i686)
8
9 Revision Changes Path
10 1.5 mail-filter/MailScanner/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/ChangeLog?rev=1.5&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/ChangeLog?rev=1.5&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/ChangeLog?r1=1.4&r2=1.5
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v
19 retrieving revision 1.4
20 retrieving revision 1.5
21 diff -u -r1.4 -r1.5
22 --- ChangeLog 23 Aug 2008 05:56:12 -0000 1.4
23 +++ ChangeLog 30 Aug 2008 20:32:22 -0000 1.5
24 @@ -1,6 +1,12 @@
25 # ChangeLog for mail-filter/MailScanner
26 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v 1.4 2008/08/23 05:56:12 cardoe Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v 1.5 2008/08/30 20:32:22 jokey Exp $
29 +
30 +*MailScanner-4.70.7.1 (30 Aug 2008)
31 +
32 + 30 Aug 2008; Markus Ullmann <jokey@g.o>
33 + +MailScanner-4.70.7.1.ebuild:
34 + Version bump
35
36 23 Aug 2008; Doug Goldstein <cardoe@g.o> metadata.xml:
37 add GLEP 56 USE flag desc from use.local.desc
38
39
40
41 1.1 mail-filter/MailScanner/MailScanner-4.70.7.1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/MailScanner-4.70.7.1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/MailScanner-4.70.7.1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: MailScanner-4.70.7.1.ebuild
47 ===================================================================
48 # Copyright 1999-2008 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/MailScanner-4.70.7.1.ebuild,v 1.1 2008/08/30 20:32:22 jokey Exp $
51
52 inherit eutils versionator
53
54 MY_PV=$(get_version_component_range 1-3 )
55 MY_PVR=$(replace_version_separator 3 '-' )
56
57 DESCRIPTION="Free Anti-Virus and Anti-Spam Filter"
58 HOMEPAGE="http://www.mailscanner.info/"
59 SRC_URI="http://www.mailscanner.info/files/4/tar/${PN}-install-${MY_PVR}.tar.gz"
60
61 LICENSE="GPL-2"
62 SLOT="0"
63 KEYWORDS="~x86"
64 IUSE="bitdefender clamav doc exim f-prot postfix spamassassin"
65
66 DEPEND="dev-lang/perl"
67 RDEPEND="${DEPEND}
68 dev-perl/Archive-Zip
69 dev-perl/Compress-Zlib
70 dev-perl/Convert-BinHex
71 dev-perl/Convert-TNEF
72 dev-perl/DBD-SQLite
73 dev-perl/DBI
74 >=dev-perl/HTML-Parser-3.45
75 dev-perl/HTML-Tagset
76 dev-perl/IO-stringy
77 >=dev-perl/MIME-tools-5.417
78 dev-perl/MailTools
79 dev-perl/Net-CIDR
80 dev-perl/Net-DNS
81 dev-perl/TimeDate
82 dev-perl/Sys-Hostname-Long
83 dev-perl/Filesys-Df
84 >=net-mail/tnef-1.4.3
85 virtual/perl-File-Spec
86 virtual/perl-File-Temp
87 virtual/perl-Getopt-Long
88 >=virtual/perl-Sys-Syslog-0.18
89 >=virtual/perl-MIME-Base64-3.05
90 virtual/cron
91 postfix? ( mail-mta/postfix )
92 exim? ( !postfix? ( mail-mta/exim ) )
93 !postfix? ( !exim? ( mail-mta/sendmail ) )
94 bitdefender? ( app-antivirus/bitdefender-console )
95 clamav? ( >=app-antivirus/clamav-0.88.4 )
96 f-prot? ( app-antivirus/f-prot )
97 spamassassin? ( >=mail-filter/spamassassin-3.1.5 )"
98
99 S="${WORKDIR}/${PN}-${MY_PVR}"
100 BASE="/usr"
101
102 src_unpack() {
103 unpack ${A}
104 unpack ./${PN}-install-${MY_PV}/perl-tar/${PN}-${MY_PVR}.tar.gz
105
106 # setup MTA
107 if use postfix ; then
108 RUNASUSER='postfix'
109 RUNASGROUP='postfix'
110 INQUEUE='/var/spool/postfix.in/deferred'
111 OUTQUEUE='/var/spool/postfix/incoming'
112 MTA='postfix'
113 SENDMAIL='/usr/lib/sendmail'
114 SENDMAIL2='/usr/lib/sendmail'
115 elif use exim ; then
116 RUNASUSER='mail'
117 RUNASGROUP='mail'
118 INQUEUE='/var/spool/exim.in/input'
119 OUTQUEUE='/var/spool/exim/input'
120 MTA='exim'
121 SENDMAIL='/usr/sbin/exim -oMr MailScanner'
122 SENDMAIL2='/usr/sbin/exim -C /etc/exim/exim_out.conf -oMr MailScanner'
123 else
124 # use sendmail as default, but we should add more as needed
125 # RUNASUSER='mail'
126 # RUNASGROUP='mail'
127 INQUEUE='/var/spool/mqueue.in'
128 OUTQUEUE='/var/spool/mqueue'
129 MTA='sendmail'
130 SENDMAIL='/usr/lib/sendmail'
131 SENDMAIL2='/usr/lib/sendmail'
132 fi
133
134 # setup virus scanner(s)
135 VIRUS_SCANNERS=""
136 use bitdefender && VIRUS_SCANNERS="bitdefender ${VIRUS_SCANNERS}"
137 use clamav && VIRUS_SCANNERS="clamav ${VIRUS_SCANNERS}"
138 use f-prot && VIRUS_SCANNERS="f-prot ${VIRUS_SCANNERS}"
139
140 if [ "$VIRUS_SCANNERS" == "" ]; then
141 VIRUS_SCANNERS="none"
142 VIRUS_SCANNING="no"
143 else
144 VIRUS_SCANNING="yes"
145 fi
146
147 sed -i \
148 -e "s/^\(Virus Scanning[ \t]*=\).*/\1 ${VIRUS_SCANNING}/" \
149 -e "s/^\(Virus Scanners[ \t]*=\).*/\1 ${VIRUS_SCANNERS}/" \
150 "${S}/etc/MailScanner.conf"
151
152 # setup spamassassin
153 if use spamassassin ; then
154 sed -i \
155 -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 yes/" \
156 "${S}/etc/MailScanner.conf"
157 else
158 sed -i \
159 -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 no/" \
160 "${S}/etc/MailScanner.conf"
161 fi
162
163 # update bin files
164 sed -i \
165 -e "s#msbindir=/opt/MailScanner/bin#msbindir=/usr/sbin#g" \
166 -e "s#config=/opt/MailScanner/etc/MailScanner.conf#config=/etc/MailScanner/MailScanner.conf#g" \
167 "${S}/bin/check_mailscanner"
168 for each in update_virus_scanners update_phishing_sites update_bad_phishing_sites ; do
169 sed -i \
170 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
171 "${S}"/bin/${each}
172 done
173 sed -i \
174 -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/MailScanner#g" \
175 "${S}"/bin/update_spamassassin
176 sed -i \
177 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
178 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
179 "${S}"/bin/MailScanner
180
181 # update cron files
182 sed -i \
183 -e "s#/opt/MailScanner/bin/check_mailscanner#/usr/sbin/check_MailScanner#g" \
184 "${S}"/bin/cron/check_MailScanner.cron
185 for cronfile in update_virus_scanners.cron update_{,bad_}phishing_sites.cron; do
186 sed -i \
187 -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/mailscanner#g" \
188 -e "s#/opt/MailScanner/bin#/usr/sbin#g" \
189 "${S}"/bin/cron/${cronfile}
190 done
191
192 # Determine some things that may need to be changed in conf file
193 # (need to arrive at sensible replacement for yoursite)
194 YOURSITE=`dnsdomainname | sed -e "s/\./-/g"`
195 BASEBIN="${BASE}/sbin"
196
197 # ClamAV requires some specific changes to MailScanner.conf
198 # when mailscanner is running as root (i.e. sendmail)
199 if use clamav ; then
200 if [ "$MTA" == "sendmail" ] ; then
201 WORKGRP="clamav"
202 WORKPERM="0640"
203 else
204 WORKGRP=""
205 WORKPERM="0600"
206 fi
207 else
208 WORKGRP=""
209 WORKPERM="0600"
210 fi
211
212 # update conf files
213 sed -i \
214 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
215 -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
216 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
217 -e "s#^\(Run As User[ \t]*=\).*#\1 $RUNASUSER#" \
218 -e "s#^\(Run As Group[ \t]*=\).*#\1 $RUNASGROUP#" \
219 -e "s#^\(Incoming Queue Dir[ \t]*=\).*#\1 $INQUEUE#" \
220 -e "s#^\(Outgoing Queue Dir[ \t]*=\).*#\1 $OUTQUEUE#" \
221 -e "s#^\(MTA[ \t]*=\).*#\1 $MTA#" \
222 -e "s/^#\(TNEF.*internal\)$/\1/" \
223 -e "s/^\(TNEF.*0000\)$/#\1/" \
224 -e "s#^\(PID file[ \t]=\).*#\1 /var/run/mailscanner.pid#" \
225 -e "s#^\(%org-name%\)[ \t]*=.*#\1 = ${YOURSITE}#" \
226 -e "s#^\(Sendmail[ \t]*=\).*#\1 ${SENDMAIL}#" \
227 -e "s#^\(Sendmail2[ \t]*=\).*#\1 ${SENDMAIL2}#" \
228 -e "s#^\(Incoming Work Group[ \t]*=\).*#\1 ${WORKGRP}#" \
229 -e "s#^\(Incoming Work Permissions[ \t]*=\).*#\1 ${WORKPERM}#" \
230 "${S}/etc/MailScanner.conf"
231
232 # update spam.assassin.prefs.conf
233 sed -i -e "s#YOURDOMAIN-COM#${YOURSITE}#" ${S}/etc/spam.assassin.prefs.conf
234
235 # net-mail/clamav net-mail/f-prot package compatibility
236 sed -i \
237 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#" \
238 -e 's#^\(clamav\t.*/usr\)/local$#\1#' \
239 -e 's#^\(f-prot.*\)/usr/local/f-prot$#\1/opt/f-prot#' \
240 "${S}/etc/virus.scanners.conf"
241
242 # update lib files
243 sed -i \
244 -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
245 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
246 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
247 "${S}/lib/MailScanner/ConfigDefs.pl"
248 sed -i \
249 -e "s#/etc/MailScanner#/etc/MailScanner#g" \
250 "${S}/lib/MailScanner/CustomConfig.pm"
251
252 # finally, change MailScanner.conf into MailScanner.conf.sample
253 cp "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.${MY_PV}"
254 mv "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.sample"
255
256 }
257
258 src_install() {
259 exeinto ${BASE}/sbin
260 doexe bin/MailScanner
261 newexe bin/check_mailscanner check_MailScanner
262 doexe bin/d2mbox bin/df2mbox
263 doexe bin/update_virus_scanners
264 doexe bin/upgrade_MailScanner_conf
265 doexe bin/update_bad_phishing_sites bin/update_phishing_sites
266 newexe bin/Sophos.install.linux Sophos.install
267
268 insinto /etc/MailScanner
269 doins etc/*.conf
270 doins etc/mailscanner.conf.with.mcp
271 doins etc/MailScanner.conf.${MY_PV}
272 doins etc/MailScanner.conf.sample
273
274 insinto /etc/MailScanner/rules
275 doins etc/rules/*
276 insinto /etc/MailScanner/mcp
277 doins etc/mcp/*
278
279 insinto /etc/MailScanner
280 doins -r etc/reports
281
282 insinto ${BASE}/$(get_libdir)/MailScanner
283 doins lib/*.prf
284
285 exeinto ${BASE}/$(get_libdir)/MailScanner
286 doexe lib/*-wrapper
287 doexe lib/*-autoupdate
288 doexe lib/*-autoupdate.old
289 doexe lib/*.pm
290
291 exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
292 doexe lib/MailScanner/*.pm
293 doexe lib/MailScanner/*.pl
294
295 insinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
296 doins lib/MailScanner/*.txt
297
298 exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner/CustomFunctions
299 doexe lib/MailScanner/CustomFunctions/MyExample.pm
300
301 newinitd "${FILESDIR}"/initd.mailscanner MailScanner
302 newconfd "${FILESDIR}"/confd.mailscanner MailScanner
303
304 #Set up cron jobs
305 exeinto /etc/cron.hourly
306 newexe "${S}/bin/cron/check_MailScanner.cron" check_MailScanner
307 for cronfile in update_{virus_scanners,{bad_,}phishing_sites}; do
308 newexe "${S}/bin/cron/${cronfile}.cron" ${cronfile}
309 done
310
311 exeinto /etc/cron.daily
312 newexe "${S}/bin/cron/clean.quarantine.cron" clean.quarantine
313
314 dodoc README
315 insinto /usr/share/doc/${PF}
316 doins MailScanner.conf.index.html
317
318 keepdir /var/spool/MailScanner/incoming
319 keepdir /var/spool/MailScanner/quarantine
320 keepdir /var/spool/MailScanner/spamassassin
321 keepdir /var/spool/MailScanner/archive
322 keepdir ${BASE}/var
323
324 if use postfix ; then
325 chown -R postfix:postfix "${D}/var/spool/MailScanner/"
326 elif use exim ; then
327 chown -R mail:mail "${D}/var/spool/MailScanner/"
328 else
329 keepdir /var/spool/mqueue.in
330 fi
331 use spamassassin && dosym /etc/MailScanner/spam.assassin.prefs.conf /etc/mail/spamassassin/mailscanner.cf
332
333 }
334
335 pkg_postinst() {
336 if use postfix; then
337 elog "Note that postfix 2.4 now supports HOLD of messages"
338 elog "and reinjection without second postfix instance"
339 elog "Inbound path is now ${ROOT}var/spool/postfix/hold"
340 elog
341 elog "See http://mailscanner.info/postfix.html for details"
342 elog "or check (english) gentoo-wiki.com page which has been updated"
343 fi
344
345 if [ -f "/etc/MailScanner/MailScanner.conf" ]; then
346 einfo "Upgrading the MailScanner.conf file"
347 cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV}
348 /usr/sbin/upgrade_MailScanner_conf \
349 /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV} \
350 /etc/MailScanner/MailScanner.conf.${MY_PV} \
351 > /etc/MailScanner/MailScanner.conf 2> /dev/null
352 else
353 cp /etc/MailScanner/MailScanner.conf.sample /etc/MailScanner/MailScanner.conf
354 fi
355 }