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.68.6.1.ebuild MailScanner-4.67.6.1-r2.ebuild MailScanner-4.67.6.1.ebuild MailScanner-4.67.6.1-r1.ebuild
Date: Thu, 27 Mar 2008 12:18:45
Message-Id: E1Jer45-00079n-Fe@stork.gentoo.org
1 jokey 08/03/27 12:18:41
2
3 Modified: ChangeLog
4 Added: MailScanner-4.68.6.1.ebuild
5 MailScanner-4.67.6.1-r2.ebuild
6 Removed: MailScanner-4.67.6.1.ebuild
7 MailScanner-4.67.6.1-r1.ebuild
8 Log:
9 More config sed's and add masked beta version
10 (Portage version: 2.1.4.4)
11
12 Revision Changes Path
13 1.3 mail-filter/MailScanner/ChangeLog
14
15 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/ChangeLog?rev=1.3&view=markup
16 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/ChangeLog?rev=1.3&content-type=text/plain
17 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/ChangeLog?r1=1.2&r2=1.3
18
19 Index: ChangeLog
20 ===================================================================
21 RCS file: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v
22 retrieving revision 1.2
23 retrieving revision 1.3
24 diff -u -r1.2 -r1.3
25 --- ChangeLog 27 Mar 2008 01:33:23 -0000 1.2
26 +++ ChangeLog 27 Mar 2008 12:18:40 -0000 1.3
27 @@ -1,6 +1,14 @@
28 # ChangeLog for mail-filter/MailScanner
29 # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
30 -# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v 1.2 2008/03/27 01:33:23 jokey Exp $
31 +# $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/ChangeLog,v 1.3 2008/03/27 12:18:40 jokey Exp $
32 +
33 +*MailScanner-4.68.6.1 (27 Mar 2008)
34 +*MailScanner-4.67.6.1-r2 (27 Mar 2008)
35 +
36 + 27 Mar 2008; Markus Ullmann <jokey@g.o>
37 + -MailScanner-4.67.6.1.ebuild, -MailScanner-4.67.6.1-r1.ebuild,
38 + +MailScanner-4.67.6.1-r2.ebuild, +MailScanner-4.68.6.1.ebuild:
39 + More config sed's and add masked beta version
40
41 *MailScanner-4.67.6.1-r1 (27 Mar 2008)
42
43
44
45
46 1.1 mail-filter/MailScanner/MailScanner-4.68.6.1.ebuild
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/MailScanner-4.68.6.1.ebuild?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/MailScanner-4.68.6.1.ebuild?rev=1.1&content-type=text/plain
50
51 Index: MailScanner-4.68.6.1.ebuild
52 ===================================================================
53 # Copyright 1999-2008 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 # $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/MailScanner-4.68.6.1.ebuild,v 1.1 2008/03/27 12:18:40 jokey Exp $
56
57 inherit eutils versionator
58
59 MY_PV=$(get_version_component_range 1-3 )
60 MY_PVR=$(replace_version_separator 3 '-' )
61
62 DESCRIPTION="Free Anti-Virus and Anti-Spam Filter"
63 HOMEPAGE="http://www.mailscanner.info/"
64 SRC_URI="http://www.mailscanner.info/files/4/tar/${PN}-install-${MY_PVR}.tar.gz"
65
66 LICENSE="GPL-2"
67 SLOT="0"
68 KEYWORDS="~x86"
69 IUSE="bitdefender clamav doc exim f-prot postfix spamassassin"
70
71 DEPEND="dev-lang/perl"
72 RDEPEND="${DEPEND}
73 dev-perl/Archive-Zip
74 dev-perl/Compress-Zlib
75 dev-perl/Convert-BinHex
76 dev-perl/Convert-TNEF
77 dev-perl/DBD-SQLite
78 dev-perl/DBI
79 >=dev-perl/HTML-Parser-3.45
80 dev-perl/HTML-Tagset
81 dev-perl/IO-stringy
82 >=dev-perl/MIME-tools-5.417
83 dev-perl/MailTools
84 dev-perl/Net-CIDR
85 dev-perl/Net-DNS
86 dev-perl/TimeDate
87 dev-perl/Sys-Hostname-Long
88 dev-perl/Filesys-Df
89 >=net-mail/tnef-1.4.3
90 virtual/perl-File-Spec
91 virtual/perl-File-Temp
92 virtual/perl-Getopt-Long
93 >=virtual/perl-Sys-Syslog-0.18
94 >=virtual/perl-MIME-Base64-3.05
95 virtual/cron
96 postfix? ( mail-mta/postfix )
97 exim? ( !postfix? ( mail-mta/exim ) )
98 !postfix? ( !exim? ( mail-mta/sendmail ) )
99 bitdefender? ( app-antivirus/bitdefender-console )
100 clamav? ( >=app-antivirus/clamav-0.88.4 )
101 f-prot? ( app-antivirus/f-prot )
102 spamassassin? ( >=mail-filter/spamassassin-3.1.5 )"
103
104 S="${WORKDIR}/${PN}-${MY_PVR}"
105 BASE="/usr"
106
107 src_unpack() {
108 unpack ${A}
109 unpack ./${PN}-install-${MY_PV}/perl-tar/${PN}-${MY_PVR}.tar.gz
110
111 # setup MTA
112 if use postfix ; then
113 RUNASUSER='postfix'
114 RUNASGROUP='postfix'
115 INQUEUE='/var/spool/postfix.in/deferred'
116 OUTQUEUE='/var/spool/postfix/incoming'
117 MTA='postfix'
118 SENDMAIL='/usr/lib/sendmail'
119 SENDMAIL2='/usr/lib/sendmail'
120 elif use exim ; then
121 RUNASUSER='mail'
122 RUNASGROUP='mail'
123 INQUEUE='/var/spool/exim.in/input'
124 OUTQUEUE='/var/spool/exim/input'
125 MTA='exim'
126 SENDMAIL='/usr/sbin/exim -oMr MailScanner'
127 SENDMAIL2='/usr/sbin/exim -C /etc/exim/exim_out.conf -oMr MailScanner'
128 else
129 # use sendmail as default, but we should add more as needed
130 # RUNASUSER='mail'
131 # RUNASGROUP='mail'
132 INQUEUE='/var/spool/mqueue.in'
133 OUTQUEUE='/var/spool/mqueue'
134 MTA='sendmail'
135 SENDMAIL='/usr/lib/sendmail'
136 SENDMAIL2='/usr/lib/sendmail'
137 fi
138
139 # setup virus scanner(s)
140 VIRUS_SCANNERS=""
141 use bitdefender && VIRUS_SCANNERS="bitdefender ${VIRUS_SCANNERS}"
142 use clamav && VIRUS_SCANNERS="clamav ${VIRUS_SCANNERS}"
143 use f-prot && VIRUS_SCANNERS="f-prot ${VIRUS_SCANNERS}"
144
145 if [ "$VIRUS_SCANNERS" == "" ]; then
146 VIRUS_SCANNERS="none"
147 VIRUS_SCANNING="no"
148 else
149 VIRUS_SCANNING="yes"
150 fi
151
152 sed -i \
153 -e "s/^\(Virus Scanning[ \t]*=\).*/\1 ${VIRUS_SCANNING}/" \
154 -e "s/^\(Virus Scanners[ \t]*=\).*/\1 ${VIRUS_SCANNERS}/" \
155 "${S}/etc/MailScanner.conf"
156
157 # setup spamassassin
158 if use spamassassin ; then
159 sed -i \
160 -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 yes/" \
161 "${S}/etc/MailScanner.conf"
162 else
163 sed -i \
164 -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 no/" \
165 "${S}/etc/MailScanner.conf"
166 fi
167
168 # update bin files
169 sed -i \
170 -e "s#msbindir=/opt/MailScanner/bin#msbindir=/usr/sbin#g" \
171 -e "s#config=/opt/MailScanner/etc/MailScanner.conf#config=/etc/MailScanner/MailScanner.conf#g" \
172 "${S}/bin/check_mailscanner"
173 for each in update_virus_scanners update_phishing_sites update_bad_phishing_sites ; do
174 sed -i \
175 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
176 "${S}"/bin/${each}
177 done
178 sed -i \
179 -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/MailScanner#g" \
180 "${S}"/bin/update_spamassassin
181 sed -i \
182 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
183 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
184 "${S}"/bin/MailScanner
185
186 # update cron files
187 sed -i \
188 -e "s#/opt/MailScanner/bin/check_mailscanner#/usr/sbin/check_MailScanner#g" \
189 "${S}"/bin/cron/check_MailScanner.cron
190 for cronfile in update_virus_scanners.cron update_{,bad_}phishing_sites.cron; do
191 sed -i \
192 -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/mailscanner#g" \
193 -e "s#/opt/MailScanner/bin#/usr/sbin#g" \
194 "${S}"/bin/cron/${cronfile}
195 done
196
197 # Determine some things that may need to be changed in conf file
198 # (need to arrive at sensible replacement for yoursite)
199 YOURSITE=`dnsdomainname | sed -e "s/\./-/g"`
200 BASEBIN="${BASE}/sbin"
201
202 # ClamAV requires some specific changes to MailScanner.conf
203 # when mailscanner is running as root (i.e. sendmail)
204 if use clamav ; then
205 if [ "$MTA" == "sendmail" ] ; then
206 WORKGRP="clamav"
207 WORKPERM="0640"
208 else
209 WORKGRP=""
210 WORKPERM="0600"
211 fi
212 else
213 WORKGRP=""
214 WORKPERM="0600"
215 fi
216
217 # update conf files
218 sed -i \
219 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
220 -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
221 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
222 -e "s#^\(Run As User[ \t]*=\).*#\1 $RUNASUSER#" \
223 -e "s#^\(Run As Group[ \t]*=\).*#\1 $RUNASGROUP#" \
224 -e "s#^\(Incoming Queue Dir[ \t]*=\).*#\1 $INQUEUE#" \
225 -e "s#^\(Outgoing Queue Dir[ \t]*=\).*#\1 $OUTQUEUE#" \
226 -e "s#^\(MTA[ \t]*=\).*#\1 $MTA#" \
227 -e "s/^#\(TNEF.*internal\)$/\1/" \
228 -e "s/^\(TNEF.*0000\)$/#\1/" \
229 -e "s#^\(PID file[ \t]=\).*#\1 /var/run/mailscanner.pid#" \
230 -e "s#^\(%org-name%\)[ \t]*=.*#\1 = ${YOURSITE}#" \
231 -e "s#^\(Sendmail[ \t]*=\).*#\1 ${SENDMAIL}#" \
232 -e "s#^\(Sendmail2[ \t]*=\).*#\1 ${SENDMAIL2}#" \
233 -e "s#^\(Incoming Work Group[ \t]*=\).*#\1 ${WORKGRP}#" \
234 -e "s#^\(Incoming Work Permissions[ \t]*=\).*#\1 ${WORKPERM}#" \
235 "${S}/etc/MailScanner.conf"
236
237 # update spam.assassin.prefs.conf
238 sed -i -e "s#YOURDOMAIN-COM#${YOURSITE}#" ${S}/etc/spam.assassin.prefs.conf
239
240 # net-mail/clamav net-mail/f-prot package compatibility
241 sed -i \
242 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#" \
243 -e 's#^\(clamav\t.*/usr\)/local$#\1#' \
244 -e 's#^\(f-prot.*\)/usr/local/f-prot$#\1/opt/f-prot#' \
245 "${S}/etc/virus.scanners.conf"
246
247 # update lib files
248 sed -i \
249 -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
250 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
251 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
252 "${S}/lib/MailScanner/ConfigDefs.pl"
253 sed -i \
254 -e "s#/etc/MailScanner#/etc/MailScanner#g" \
255 "${S}/lib/MailScanner/CustomConfig.pm"
256
257 # finally, change MailScanner.conf into MailScanner.conf.sample
258 cp "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.${MY_PV}"
259 mv "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.sample"
260
261 }
262
263 src_install() {
264 exeinto ${BASE}/sbin
265 doexe bin/MailScanner
266 newexe bin/check_mailscanner check_MailScanner
267 doexe bin/d2mbox bin/df2mbox
268 doexe bin/update_virus_scanners
269 doexe bin/upgrade_MailScanner_conf
270 doexe bin/update_bad_phishing_sites bin/update_phishing_sites
271 newexe bin/Sophos.install.linux Sophos.install
272
273 insinto /etc/MailScanner
274 doins etc/*.conf
275 doins etc/mailscanner.conf.with.mcp
276 doins etc/MailScanner.conf.${MY_PV}
277 doins etc/MailScanner.conf.sample
278
279 insinto /etc/MailScanner/rules
280 doins etc/rules/*
281 insinto /etc/MailScanner/mcp
282 doins etc/mcp/*
283
284 insinto /etc/MailScanner
285 doins -r etc/reports
286
287 insinto ${BASE}/$(get_libdir)/MailScanner
288 doins lib/*.prf
289
290 exeinto ${BASE}/$(get_libdir)/MailScanner
291 doexe lib/*-wrapper
292 doexe lib/*-autoupdate
293 doexe lib/*-autoupdate.old
294 doexe lib/*.pm
295
296 exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
297 doexe lib/MailScanner/*.pm
298 doexe lib/MailScanner/*.pl
299
300 insinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
301 doins lib/MailScanner/*.txt
302
303 exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner/CustomFunctions
304 doexe lib/MailScanner/CustomFunctions/MyExample.pm
305
306 newinitd "${FILESDIR}"/initd.mailscanner MailScanner
307 newconfd "${FILESDIR}"/confd.mailscanner MailScanner
308
309 #Set up cron jobs
310 exeinto /etc/cron.hourly
311 newexe "${S}/bin/cron/check_MailScanner.cron" check_MailScanner
312 for cronfile in update_{virus_scanners,{bad_,}phishing_sites}; do
313 newexe "${S}/bin/cron/${cronfile}.cron" ${cronfile}
314 done
315
316 exeinto /etc/cron.daily
317 newexe "${S}/bin/cron/clean.quarantine.cron" clean.quarantine
318
319 dodoc README
320 insinto /usr/share/doc/${PF}
321 doins MailScanner.conf.index.html
322
323 keepdir /var/spool/MailScanner/incoming
324 keepdir /var/spool/MailScanner/quarantine
325 keepdir /var/spool/MailScanner/spamassassin
326 keepdir /var/spool/MailScanner/archive
327 keepdir ${BASE}/var
328
329 if use postfix ; then
330 chown -R postfix:postfix "${D}/var/spool/MailScanner/"
331 elif use exim ; then
332 chown -R mail:mail "${D}/var/spool/MailScanner/"
333 else
334 keepdir /var/spool/mqueue.in
335 fi
336 use spamassassin && dosym /etc/MailScanner/spam.assassin.prefs.conf /etc/mail/spamassassin/mailscanner.cf
337
338 }
339
340 pkg_postinst() {
341 if use postfix; then
342 elog "Note that postfix 2.4 now supports HOLD of messages"
343 elog "and reinjection without second postfix instance"
344 elog "Inbound path is now ${ROOT}var/spool/postfix/hold"
345 elog
346 elog "See http://mailscanner.info/postfix.html for details"
347 elog "or check (english) gentoo-wiki.com page which has been updated"
348 fi
349
350 if [ -f "/etc/MailScanner/MailScanner.conf" ]; then
351 einfo "Upgrading the MailScanner.conf file"
352 cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV}
353 /usr/sbin/upgrade_MailScanner_conf \
354 /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV} \
355 /etc/MailScanner/MailScanner.conf.${MY_PV} \
356 > /etc/MailScanner/MailScanner.conf 2> /dev/null
357 else
358 cp /etc/MailScanner/MailScanner.conf.sample /etc/MailScanner/MailScanner.conf
359 fi
360 }
361
362
363
364 1.1 mail-filter/MailScanner/MailScanner-4.67.6.1-r2.ebuild
365
366 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/MailScanner-4.67.6.1-r2.ebuild?rev=1.1&view=markup
367 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-filter/MailScanner/MailScanner-4.67.6.1-r2.ebuild?rev=1.1&content-type=text/plain
368
369 Index: MailScanner-4.67.6.1-r2.ebuild
370 ===================================================================
371 # Copyright 1999-2008 Gentoo Foundation
372 # Distributed under the terms of the GNU General Public License v2
373 # $Header: /var/cvsroot/gentoo-x86/mail-filter/MailScanner/MailScanner-4.67.6.1-r2.ebuild,v 1.1 2008/03/27 12:18:40 jokey Exp $
374
375 inherit eutils versionator
376
377 MY_PV=$(get_version_component_range 1-3 )
378 MY_PVR=$(replace_version_separator 3 '-' )
379
380 DESCRIPTION="Free Anti-Virus and Anti-Spam Filter"
381 HOMEPAGE="http://www.mailscanner.info/"
382 SRC_URI="http://www.mailscanner.info/files/4/tar/${PN}-install-${MY_PVR}.tar.gz"
383
384 LICENSE="GPL-2"
385 SLOT="0"
386 KEYWORDS="~x86"
387 IUSE="bitdefender clamav doc exim f-prot postfix spamassassin"
388
389 DEPEND="dev-lang/perl"
390 RDEPEND="${DEPEND}
391 dev-perl/Archive-Zip
392 dev-perl/Compress-Zlib
393 dev-perl/Convert-BinHex
394 dev-perl/Convert-TNEF
395 dev-perl/DBD-SQLite
396 dev-perl/DBI
397 >=dev-perl/HTML-Parser-3.45
398 dev-perl/HTML-Tagset
399 dev-perl/IO-stringy
400 >=dev-perl/MIME-tools-5.417
401 dev-perl/MailTools
402 dev-perl/Net-CIDR
403 dev-perl/Net-DNS
404 dev-perl/TimeDate
405 dev-perl/Sys-Hostname-Long
406 dev-perl/Filesys-Df
407 >=net-mail/tnef-1.4.3
408 virtual/perl-File-Spec
409 virtual/perl-File-Temp
410 virtual/perl-Getopt-Long
411 >=virtual/perl-Sys-Syslog-0.18
412 >=virtual/perl-MIME-Base64-3.05
413 virtual/cron
414 postfix? ( mail-mta/postfix )
415 exim? ( !postfix? ( mail-mta/exim ) )
416 !postfix? ( !exim? ( mail-mta/sendmail ) )
417 bitdefender? ( app-antivirus/bitdefender-console )
418 clamav? ( >=app-antivirus/clamav-0.88.4 )
419 f-prot? ( app-antivirus/f-prot )
420 spamassassin? ( >=mail-filter/spamassassin-3.1.5 )"
421
422 S="${WORKDIR}/${PN}-${MY_PVR}"
423 BASE="/usr"
424
425 src_unpack() {
426 unpack ${A}
427 unpack ./${PN}-install-${MY_PV}/perl-tar/${PN}-${MY_PVR}.tar.gz
428
429 # setup MTA
430 if use postfix ; then
431 RUNASUSER='postfix'
432 RUNASGROUP='postfix'
433 INQUEUE='/var/spool/postfix.in/deferred'
434 OUTQUEUE='/var/spool/postfix/incoming'
435 MTA='postfix'
436 SENDMAIL='/usr/lib/sendmail'
437 SENDMAIL2='/usr/lib/sendmail'
438 elif use exim ; then
439 RUNASUSER='mail'
440 RUNASGROUP='mail'
441 INQUEUE='/var/spool/exim.in/input'
442 OUTQUEUE='/var/spool/exim/input'
443 MTA='exim'
444 SENDMAIL='/usr/sbin/exim -oMr MailScanner'
445 SENDMAIL2='/usr/sbin/exim -C /etc/exim/exim_out.conf -oMr MailScanner'
446 else
447 # use sendmail as default, but we should add more as needed
448 # RUNASUSER='mail'
449 # RUNASGROUP='mail'
450 INQUEUE='/var/spool/mqueue.in'
451 OUTQUEUE='/var/spool/mqueue'
452 MTA='sendmail'
453 SENDMAIL='/usr/lib/sendmail'
454 SENDMAIL2='/usr/lib/sendmail'
455 fi
456
457 # setup virus scanner(s)
458 VIRUS_SCANNERS=""
459 use bitdefender && VIRUS_SCANNERS="bitdefender ${VIRUS_SCANNERS}"
460 use clamav && VIRUS_SCANNERS="clamav ${VIRUS_SCANNERS}"
461 use f-prot && VIRUS_SCANNERS="f-prot ${VIRUS_SCANNERS}"
462
463 if [ "$VIRUS_SCANNERS" == "" ]; then
464 VIRUS_SCANNERS="none"
465 VIRUS_SCANNING="no"
466 else
467 VIRUS_SCANNING="yes"
468 fi
469
470 sed -i \
471 -e "s/^\(Virus Scanning[ \t]*=\).*/\1 ${VIRUS_SCANNING}/" \
472 -e "s/^\(Virus Scanners[ \t]*=\).*/\1 ${VIRUS_SCANNERS}/" \
473 "${S}/etc/MailScanner.conf"
474
475 # setup spamassassin
476 if use spamassassin ; then
477 sed -i \
478 -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 yes/" \
479 "${S}/etc/MailScanner.conf"
480 else
481 sed -i \
482 -e "s/^\(Use SpamAssassin[ \t]*=\).*$/\1 no/" \
483 "${S}/etc/MailScanner.conf"
484 fi
485
486 # update bin files
487 sed -i \
488 -e "s#msbindir=/opt/MailScanner/bin#msbindir=/usr/sbin#g" \
489 -e "s#config=/opt/MailScanner/etc/MailScanner.conf#config=/etc/MailScanner/MailScanner.conf#g" \
490 "${S}/bin/check_mailscanner"
491 for each in update_virus_scanners update_phishing_sites update_bad_phishing_sites ; do
492 sed -i \
493 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
494 "${S}"/bin/${each}
495 done
496 sed -i \
497 -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/MailScanner#g" \
498 "${S}"/bin/update_spamassassin
499 sed -i \
500 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
501 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
502 "${S}"/bin/MailScanner
503
504 # update cron files
505 sed -i \
506 -e "s#/opt/MailScanner/bin/check_mailscanner#/usr/sbin/check_MailScanner#g" \
507 "${S}"/bin/cron/check_MailScanner.cron
508 for cronfile in update_virus_scanners.cron update_{,bad_}phishing_sites.cron; do
509 sed -i \
510 -e "s#/etc/sysconfig/MailScanner#/etc/conf.d/mailscanner#g" \
511 -e "s#/opt/MailScanner/bin#/usr/sbin#g" \
512 "${S}"/bin/cron/${cronfile}
513 done
514
515 # Determine some things that may need to be changed in conf file
516 # (need to arrive at sensible replacement for yoursite)
517 YOURSITE=`dnsdomainname | sed -e "s/\./-/g"`
518 BASEBIN="${BASE}/sbin"
519
520 # ClamAV requires some specific changes to MailScanner.conf
521 # when mailscanner is running as root (i.e. sendmail)
522 if use clamav ; then
523 if [ "$MTA" == "sendmail" ] ; then
524 WORKGRP="clamav"
525 WORKPERM="0640"
526 else
527 WORKGRP=""
528 WORKPERM="0600"
529 fi
530 else
531 WORKGRP=""
532 WORKPERM="0600"
533 fi
534
535 # update conf files
536 sed -i \
537 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
538 -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
539 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
540 -e "s#^\(Run As User[ \t]*=\).*#\1 $RUNASUSER#" \
541 -e "s#^\(Run As Group[ \t]*=\).*#\1 $RUNASGROUP#" \
542 -e "s#^\(Incoming Queue Dir[ \t]*=\).*#\1 $INQUEUE#" \
543 -e "s#^\(Outgoing Queue Dir[ \t]*=\).*#\1 $OUTQUEUE#" \
544 -e "s#^\(MTA[ \t]*=\).*#\1 $MTA#" \
545 -e "s/^#\(TNEF.*internal\)$/\1/" \
546 -e "s/^\(TNEF.*0000\)$/#\1/" \
547 -e "s#^\(PID file[ \t]=\).*#\1 /var/run/mailscanner.pid#" \
548 -e "s#^\(%org-name%\)[ \t]*=.*#\1 = ${YOURSITE}#" \
549 -e "s#^\(Sendmail[ \t]*=\).*#\1 ${SENDMAIL}#" \
550 -e "s#^\(Sendmail2[ \t]*=\).*#\1 ${SENDMAIL2}#" \
551 -e "s#^\(Incoming Work Group[ \t]*=\).*#\1 ${WORKGRP}#" \
552 -e "s#^\(Incoming Work Permissions[ \t]*=\).*#\1 ${WORKPERM}#" \
553 "${S}/etc/MailScanner.conf"
554
555 # update spam.assassin.prefs.conf
556 sed -i -e "s#YOURDOMAIN-COM#${YOURSITE}#" ${S}/etc/spam.assassin.prefs.conf
557
558 # net-mail/clamav net-mail/f-prot package compatibility
559 sed -i \
560 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#" \
561 -e 's#^\(clamav\t.*/usr\)/local$#\1#' \
562 -e 's#^\(f-prot.*\)/usr/local/f-prot$#\1/opt/f-prot#' \
563 "${S}/etc/virus.scanners.conf"
564
565 # update lib files
566 sed -i \
567 -e "s#/opt/MailScanner/bin#$BASEBIN#g" \
568 -e "s#/opt/MailScanner/etc#/etc/MailScanner#g" \
569 -e "s#/opt/MailScanner/lib#/usr/lib/MailScanner#g" \
570 "${S}/lib/MailScanner/ConfigDefs.pl"
571 sed -i \
572 -e "s#/etc/MailScanner#/etc/MailScanner#g" \
573 "${S}/lib/MailScanner/CustomConfig.pm"
574
575 # finally, change MailScanner.conf into MailScanner.conf.sample
576 cp "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.${MY_PV}"
577 mv "${S}/etc/MailScanner.conf" "${S}/etc/MailScanner.conf.sample"
578
579 }
580
581 src_install() {
582 exeinto ${BASE}/sbin
583 doexe bin/MailScanner
584 newexe bin/check_mailscanner check_MailScanner
585 doexe bin/d2mbox bin/df2mbox
586 doexe bin/update_virus_scanners
587 doexe bin/upgrade_MailScanner_conf
588 doexe bin/update_bad_phishing_sites bin/update_phishing_sites
589 newexe bin/Sophos.install.linux Sophos.install
590
591 insinto /etc/MailScanner
592 doins etc/*.conf
593 doins etc/mailscanner.conf.with.mcp
594 doins etc/MailScanner.conf.${MY_PV}
595 doins etc/MailScanner.conf.sample
596
597 insinto /etc/MailScanner/rules
598 doins etc/rules/*
599 insinto /etc/MailScanner/mcp
600 doins etc/mcp/*
601
602 insinto /etc/MailScanner
603 doins -r etc/reports
604
605 insinto ${BASE}/$(get_libdir)/MailScanner
606 doins lib/*.prf
607
608 exeinto ${BASE}/$(get_libdir)/MailScanner
609 doexe lib/*-wrapper
610 doexe lib/*-autoupdate
611 doexe lib/*-autoupdate.old
612 doexe lib/*.pm
613
614 exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
615 doexe lib/MailScanner/*.pm
616 doexe lib/MailScanner/*.pl
617
618 insinto ${BASE}/$(get_libdir)/MailScanner/MailScanner
619 doins lib/MailScanner/*.txt
620
621 exeinto ${BASE}/$(get_libdir)/MailScanner/MailScanner/CustomFunctions
622 doexe lib/MailScanner/CustomFunctions/MyExample.pm
623
624 newinitd "${FILESDIR}"/initd.mailscanner MailScanner
625 newconfd "${FILESDIR}"/confd.mailscanner MailScanner
626
627 #Set up cron jobs
628 exeinto /etc/cron.hourly
629 newexe "${S}/bin/cron/check_MailScanner.cron" check_MailScanner
630 for cronfile in update_{virus_scanners,{bad_,}phishing_sites}; do
631 newexe "${S}/bin/cron/${cronfile}.cron" ${cronfile}
632 done
633
634 exeinto /etc/cron.daily
635 newexe "${S}/bin/cron/clean.quarantine.cron" clean.quarantine
636
637 dodoc README
638 insinto /usr/share/doc/${PF}
639 doins MailScanner.conf.index.html
640
641 keepdir /var/spool/MailScanner/incoming
642 keepdir /var/spool/MailScanner/quarantine
643 keepdir /var/spool/MailScanner/spamassassin
644 keepdir /var/spool/MailScanner/archive
645 keepdir ${BASE}/var
646
647 if use postfix ; then
648 chown -R postfix:postfix "${D}/var/spool/MailScanner/"
649 elif use exim ; then
650 chown -R mail:mail "${D}/var/spool/MailScanner/"
651 else
652 keepdir /var/spool/mqueue.in
653 fi
654 use spamassassin && dosym /etc/MailScanner/spam.assassin.prefs.conf /etc/mail/spamassassin/mailscanner.cf
655
656 }
657
658 pkg_postinst() {
659 if use postfix; then
660 elog "Note that postfix 2.4 now supports HOLD of messages"
661 elog "and reinjection without second postfix instance"
662 elog "Inbound path is now ${ROOT}var/spool/postfix/hold"
663 elog
664 elog "See http://mailscanner.info/postfix.html for details"
665 elog "or check (english) gentoo-wiki.com page which has been updated"
666 fi
667
668 if [ -f "/etc/MailScanner/MailScanner.conf" ]; then
669 einfo "Upgrading the MailScanner.conf file"
670 cp /etc/MailScanner/MailScanner.conf /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV}
671 /usr/sbin/upgrade_MailScanner_conf \
672 /etc/MailScanner/MailScanner.conf.pre_upgrade.${MY_PV} \
673 /etc/MailScanner/MailScanner.conf.${MY_PV} \
674 > /etc/MailScanner/MailScanner.conf 2> /dev/null
675 else
676 cp /etc/MailScanner/MailScanner.conf.sample /etc/MailScanner/MailScanner.conf
677 fi
678 }
679
680
681
682 --
683 gentoo-commits@l.g.o mailing list