/[gentoo-x86]/mail-filter/qmail-scanner/qmail-scanner-2.08.ebuild
Gentoo

Contents of /mail-filter/qmail-scanner/qmail-scanner-2.08.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Tue Jun 5 00:04:07 2012 UTC (2 years, 6 months ago) by zmedico
Branch: MAIN
Changes since 1.4: +2 -2 lines
inherit user for enewgroup and enewuser

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

1 vapier 1.3 # Copyright 1999-2012 Gentoo Foundation
2 tupone 1.1 # Distributed under the terms of the GNU General Public License v2
3 zmedico 1.5 # $Header: /var/cvsroot/gentoo-x86/mail-filter/qmail-scanner/qmail-scanner-2.08.ebuild,v 1.4 2012/02/05 17:55:47 armin76 Exp $
4 tupone 1.1 EAPI=2
5    
6 zmedico 1.5 inherit fixheadtails toolchain-funcs eutils user
7 tupone 1.1
8     Q_S_DATE=20091012
9     DESCRIPTION="E-Mail virus scanner for qmail."
10     HOMEPAGE="http://qmail-scanner.sourceforge.net/
11     http://toribio.apollinare.org/qmail-scanner/"
12     SRC_URI="mirror://sourceforge/${PN}/${PV}/${P}.tgz
13     http://toribio.apollinare.org/qmail-scanner/download/q-s-${PV}st-${Q_S_DATE}.patch.gz"
14    
15     IUSE="clamav spamassassin"
16    
17     LICENSE="GPL-2"
18     SLOT="0"
19 armin76 1.4 KEYWORDS="~amd64 ~ppc ~x86"
20 tupone 1.1 RESTRICT="userpriv"
21    
22     RDEPEND="dev-lang/perl
23     virtual/perl-Time-HiRes
24     net-mail/tnef
25     virtual/perl-DB_File
26     mail-filter/maildrop
27     virtual/qmail
28     app-arch/unzip
29 bangert 1.2 virtual/daemontools
30 tupone 1.1 clamav? ( app-antivirus/clamav )
31     spamassassin? ( mail-filter/spamassassin )"
32     DEPEND="${RDEPEND}"
33    
34     pkg_setup() {
35     enewgroup qscand 210
36     enewuser qscand 210 -1 /var/spool/qscan qscand
37     use clamav && usermod -a -G qscand,nofiles clamav
38     }
39    
40     pkg_preinst() {
41     local oldname="/var/qmail/bin/qmail-scanner-queue.pl"
42     if [ -f ${oldname} ]; then
43     newname=${oldname}.`date +%Y%m%d%H%M%S`
44     elog "Backing up old qmail-scanner as $newname in case of modifications."
45     cp ${oldname} ${newname}
46     chmod 600 ${newname}
47     fi
48     }
49    
50     src_prepare() {
51     epatch "${DISTDIR}"/q-s-${PV}st-${Q_S_DATE}.patch.gz
52 vapier 1.3 epatch "${FILESDIR}"/${PN}-2.08-disable-suid-check.patch #364123
53 tupone 1.1 ht_fix_file autoupdaters/* configure
54     sed -i \
55     -e "s:/var/spool/qscand:/var/spool/qscan:g" \
56     README-st-patch.html \
57     README-st-patch.txt || die "Fixing doc with sed failed"
58    
59     EXTRA_VIRII="bagle,beagle,mydoom,sco,maldal,mimail,novarg,shimg,bugler,cissi,cissy,dloade,netsky,qizy"
60     elog "Adding items to the SILENT_VIRUSES list (${EXTRA_VIRII})"
61     sed -i \
62     -e "/^SILENT_VIRUSES/s/\"$/,${EXTRA_VIRII}\"/g" \
63     -e '/DD/s/1\\.0/ 1\\.0/' \
64     configure
65     }
66    
67     src_configure() {
68     local myconf
69    
70     addpredict /var/log/kav/kavscan.log
71     addpredict /opt/bdc/plugins.htm
72    
73     use spamassassin && myconf="--virus-to-delete yes --sa-quarantine 2.1 --sa-delete 4.2 --sa-reject no --sa-subject SPAM: --sa-delta 0.5 --sa-alt yes"
74    
75     PATH=${PATH}:/opt/f-prot:/opt/vlnx ./configure \
76     --domain localhost \
77     --batch \
78     --log-details yes \
79     --skip-setuid-test \
80     ${myconf} \
81     || die "./configure failed!"
82    
83     # build for qmail-scanner-queue wrapper, so we don't need suidperl
84     cd contrib
85     $(tc-getCC) ${CFLAGS} -o qmail-scanner-queue qmail-scanner-queue.c || die
86     }
87    
88     src_install () {
89     # Create Directory Structure
90     diropts -m 755 -o qscand -g qscand
91     dodir /var/spool/qscan
92     keepdir /var/spool/qscan
93     diropts -m 750 -o qscand -g qscand
94     dodir /var/spool/qscan/quarantine
95     for i in quarantine/{viruses,policy,spam} working archives; do
96     for j in tmp new cur; do
97     dodir /var/spool/qscan/${i}/${j}
98     keepdir /var/spool/qscan/${i}/${j}
99     done
100     done
101     dodir /var/spool/qscan/tmp
102     keepdir /var/spool/qscan/tmp
103    
104     # Install standard quarantine events file
105     insinto /var/spool/qscan
106     insopts -m 644 -o qscand -g qscand
107     doins quarantine-events.txt
108    
109     # create quarantine.log and viruses.log
110     touch quarantine.log
111     insinto /var/spool/qscan
112     insopts -m 644 -o qscand -g qscand
113     doins quarantine.log
114     dosym quarantine.log ${DESTDIR}/var/spool/qscan/viruses.log
115    
116     # Install qmail-scanner wrapper
117     insinto /var/qmail/bin
118     insopts -m 4755 -o qscand -g qscand
119     doins contrib/qmail-scanner-queue
120    
121     # Install qmail-scanner script
122     insinto /var/qmail/bin
123     insopts -m 0755 -o qscand -g qscand
124     doins qmail-scanner-queue.pl
125    
126     insinto /etc/logrotate.d/
127     insopts -m 644 -o root -g root
128     newins "${FILESDIR}"/${P}.logrotate qmail-scanner
129    
130     exeinto /etc/cron.daily/
131     newexe "${FILESDIR}"/qmailscanner.cronjob qmail-scanner
132    
133     # Install documentation
134     dodoc README CHANGES
135     dohtml README.html FAQ.php TODO.php configure-options.php manual-install.php perlscanner.php
136    
137     docinto contrib
138     cd "${S}"/contrib
139     dodoc spamc-nice.eml \
140     test-trophie.pl \
141     logrotate.qmail-scanner \
142     sub-avpdaemon.pl \
143     logging_first_80_chars.eml \
144     spamc-nasty.eml \
145     avpdeamon.init \
146     test_installation.sh \
147     test-sophie.pl \
148     reformime-test.eml \
149     sub-sender-cache.pl \
150     rbl_scanner.txt \
151     test-clamd.pl \
152     qs2mrtg.pl \
153     mrtg-qmail-scanner.cfg \
154     check_AV_daemons \
155     patch_for_nod32_single_user.eml \
156     qmail-delay \
157     qs-scanner-report.sh \
158     qs_config.sh \
159     qscan-spam-to-users.pl \
160     test-avgd.pl \
161     test_password.zip \
162     vpopmail-issues.eml
163     }
164    
165     pkg_postinst () {
166     einfo "Fixing ownerships"
167     chown -R qscand:qscand /var/spool/qscan
168     touch /var/qmail/bin/qmail-scanner-queue.pl
169    
170     # Setup perlscanner + Version Info
171     chmod -s "${ROOT}"/var/qmail/bin/qmail-scanner-queue.pl
172     "${ROOT}"/var/qmail/bin/qmail-scanner-queue -z
173     "${ROOT}"/var/qmail/bin/qmail-scanner-queue -g
174    
175     elog "To activate qmail-scanner, please edit your"
176     elog "/var/qmail/control/conf-common file and set:"
177     elog "export QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue"
178     elog "Or place it in your tcprules file."
179     ewarn "Please note that it was a call to qmail-scanner-queue.pl before,"
180     ewarn "but this is now changed to use a wrapper to improve security!"
181     ewarn "Once you have changed to the wrapper, you can remove the setuid "
182     ewarn "bit on qmail-scanner-queue.pl"
183    
184     ewarn "If this is an upgrade from <=2.0.1 the home directory of the qscand"
185     ewarn "user is changed. Please update it manually to /var/spool/qscan"
186     ewarn "or remove the user and emerge again this package"
187    
188     if use clamav; then
189     ewarn "To allow clamav integration comment-out in /etc/clamd.conf:"
190     ewarn "AllowSupplementaryGroups putting yes."
191     ewarn "After that, restart clamd with"
192     ewarn "/etc/init.d/clamd restart"
193     fi
194     }

  ViewVC Help
Powered by ViewVC 1.1.20