/[gentoo-x86]/mail-filter/spamassassin/spamassassin-3.1.0-r1.ebuild
Gentoo

Contents of /mail-filter/spamassassin/spamassassin-3.1.0-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Sun Jul 16 09:20:32 2006 UTC (13 years, 8 months ago) by ian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +1 -1 lines
FILE REMOVED
Clean up for bug #140527
(Portage version: 2.1.1_pre3)
 (Unsigned Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/mail-filter/spamassassin/spamassassin-3.1.0-r1.ebuild,v 1.12 2006/03/14 01:55:33 gustavoz Exp $
4
5 inherit perl-module
6
7 MY_P=Mail-SpamAssassin-${PV//_/-}
8 S=${WORKDIR}/${MY_P}
9 DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam."
10 HOMEPAGE="http://spamassassin.apache.org/"
11 SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2"
12
13 LICENSE="Apache-2.0"
14 SLOT="0"
15 #KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~mips"
16 KEYWORDS="~alpha ~hppa ~ppc ~ppc64 ~sparc ~x86"
17 IUSE="berkdb qmail ssl doc dcc mysql postgres pyzor razor sqlite spf tools"
18
19 # To consider (not all may be in tree at this time - mcummings):
20 # dev-perl/Net-SMTP
21 # dev-perl/IP-Country-Fast
22
23 DEPEND=">=dev-lang/perl-5.8.2-r1
24 >=virtual/perl-PodParser-1.22
25 virtual/perl-MIME-Base64
26 virtual/perl-Storable
27 virtual/perl-Time-HiRes
28 >=dev-perl/HTML-Parser-3.31
29 >=dev-perl/Net-DNS-0.53
30 dev-perl/Digest-SHA1
31 dev-perl/libwww-perl
32 >=dev-perl/Archive-Tar-1.26
33 dev-perl/IO-Zlib
34 ssl? (
35 dev-perl/IO-Socket-SSL
36 dev-libs/openssl
37 )
38 berkdb? (
39 virtual/perl-DB_File
40 )
41 mysql? (
42 dev-perl/DBI
43 dev-perl/DBD-mysql
44 )
45 postgres? (
46 dev-perl/DBI
47 dev-perl/DBD-Pg
48 )
49 sqlite? (
50 dev-perl/DBI
51 dev-perl/DBD-SQLite
52 )
53 spf? (
54 dev-perl/Mail-SPF-Query
55 )
56
57 pyzor? (
58 dev-python/pyzor
59 )
60 razor? (
61 mail-filter/razor
62 )
63 dcc? (
64 mail-filter/dcc
65 )"
66
67 src_compile() {
68 # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
69 # (just to be sure, nobody knows how it could happen in the first place).
70 myconf="SYSCONFDIR=/etc DATADIR=/usr/share/spamassassin"
71
72 # If ssl is enabled, spamc can be built with ssl support
73 if use ssl; then
74 myconf="${myconf} ENABLE_SSL=yes"
75 else
76 myconf="${myconf} ENABLE_SSL=no"
77 fi
78
79 # Set the path to the Perl executable explictly. This will be used to
80 # create the initial sharpbang line in the scripts and might cause
81 # a versioned app name end in there, see
82 # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
83 myconf="${myconf} PERL_BIN=/usr/bin/perl"
84
85 # If you are going to enable taint mode, make sure that the bug where
86 # spamd doesn't start when the PATH contains . is addressed, and make
87 # sure you deal with versions of razor <2.36-r1 not being taint-safe.
88 # <http://bugzilla.spamassassin.org/show_bug.cgi?id=2511> and
89 # <http://spamassassin.org/released/Razor2.patch>.
90 myconf="${myconf} PERL_TAINT=no"
91
92 # No settings needed for 'make all'.
93 mymake=""
94
95 # Neither for 'make install'.
96 myinst=""
97
98 # Add Gentoo tag to make it easier for the upstream devs to spot
99 # possible modifications or patches.
100 version_tag="g${PV:6}${PR}"
101 version_str="${PV//_/-}-${version_tag}"
102
103 # Create the Gentoo config file before Makefile.PL is called so it
104 # is copied later on.
105 echo "version_tag ${version_tag}" > rules/11_gentoo.cf
106
107 # Setting the following env var ensures that no questions are asked.
108 export PERL_MM_USE_DEFAULT=1
109 perl-module_src_prep
110 # Run the autoconf stuff now, just to make the build sequence look more
111 # familiar to the user :) Plus feeding the VERSION_STRING skips some
112 # calls to Perl.
113 make spamc/Makefile VERSION_STRING="${version_str}"
114
115 # Now compile all the stuff selected.
116 perl-module_src_compile
117 if use qmail; then
118 make spamc/qmail-spamc || die building qmail-spamc failed
119 fi
120
121 # Remove the MANIFEST files as they aren't docu files
122 rm -f MANIFEST*
123
124 use doc && make text_html_doc
125 }
126
127 src_install () {
128 perl-module_src_install
129
130 # Move spamd to sbin where it belongs.
131 dodir /usr/sbin
132 mv "${D}"/usr/bin/spamd "${D}"/usr/sbin/spamd || die
133
134 use qmail && dobin spamc/qmail-spamc
135
136 dosym /etc/mail/spamassassin /etc/spamassassin
137
138 # Disable plugin by default
139 sed -i -e 's/^loadplugin/\#loadplugin/g' ${D}/etc/mail/spamassassin/init.pre
140
141 # Add the init and config scripts.
142 newinitd "${FILESDIR}"/3.0.0-spamd.init spamd
143 newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
144
145 if use doc; then
146 dodoc NOTICE TRADEMARK CREDITS INSTALL UPGRADE BUGS USAGE \
147 sql/README.bayes sql/README.awl README.ldap procmailrc.example \
148 sample-nonspam.txt sample-spam.txt rules/STATISTICS-set0.txt \
149 STATISTICS-set1.txt STATISTICS-set2.txt STATISTICS-set3.txt \
150 spamd/PROTOCOL
151
152 # Rename some docu files so they don't clash with others
153 newdoc spamd/README README.spamd
154 newdoc sql/README README.sql
155 newdoc ldap/README README.ldap
156 use qmail && newdoc spamc/README.qmail README.qmail
157
158 dohtml doc/*.html
159 docinto sql
160 dodoc sql/*.sql
161 fi
162
163 # Install provided tools. See bug 108168
164 if use tools; then
165 docinto tools
166 dodoc tools/*
167 fi
168
169 cp ${FILESDIR}/secrets.cf ${D}/etc/mail/spamassassin/secrets.cf
170 fperms 0400 /etc/mail/spamassassin/secrets.cf
171 echo "">>${D}/etc/mail/spamassassin/local.cf
172 echo "# Sensitive data, such as database connection info, should">>${D}/etc/mail/spamassassin/local.cf
173 echo "# be stored in /etc/mail/spamassassin/secrets.cf with">>${D}/etc/mail/spamassassin/local.cf
174 echo "# appropriate permissions">>${D}/etc/mail/spamassassin/local.cf
175 }
176
177 pkg_postinst() {
178 perl-module_pkg_postinst
179
180 if ! has_version "perl-core/DB_File"; then
181 einfo "The Bayes backend requires the Berkeley DB to store its data. You"
182 einfo "need to emerge perl-core/DB_File or USE=berkdb to make it available."
183 fi
184
185 if has_version "mail-filter/razor"; then
186 if ! has_version ">=mail-filter/razor-2.61"; then
187 ewarn "You have $(best_version mail-filter/razor) installed but SpamAssassin"
188 if has_version "<mail-filter/razor-2.40"; then
189 ewarn "requires at least version 2.40, version 2.61 or later is recommended."
190 else
191 ewarn "recommends at least version 2.61."
192 fi
193 fi
194 fi
195
196 if use doc; then
197 einfo
198 einfo "Please read the file"
199 einfo " /usr/share/doc/${PF}/INSTALL.gz"
200 einfo "to find out which optional modules you need to install to enable"
201 einfo "additional features which depend on them."
202 einfo
203 einfo "If upgraded from 2.x, please read the file"
204 einfo " /usr/share/doc/${PF}/UPGRADE.gz"
205 einfo
206 fi
207 ewarn
208 ewarn "spamd is not designed to listen to an untrusted network"
209 ewarn "and is vulnerable to DoS attacks (and eternal doom) if"
210 ewarn "configured to do so"
211 ewarn
212 ewarn "If you plan on using the -u flag to spamd, please read the notes"
213 ewarn "in /etc/conf.d/spamd regarding the location of the pid file."
214
215 einfo
216 einfo "If you build ${PN} with optional dependancy support,"
217 einfo "you can enable them in /etc/mail/spamassassin/init.pre"
218 einfo
219 einfo "You may also consider installing the following for add on"
220 einfo "benefits: dev-perl/IO-Socket-INET6 dev-perl/Mail-DomainKeys"
221 einfo "dev-perl/Net-Ident dev-perl/IP-Country"
222 }

  ViewVC Help
Powered by ViewVC 1.1.20