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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu Jan 7 08:44:59 2010 UTC (10 years, 2 months ago) by tove
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Cleanup. Kill ~mips (#177144)
(Portage version: 2.2_rc61/cvs/Linux x86_64)

1 # Copyright 1999-2008 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.8-r1.ebuild,v 1.6 2008/11/18 16:13:26 tove Exp $
4
5 inherit perl-module eutils
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="http://archive.apache.org/dist/spamassassin/source/${MY_P}.tar.bz2"
12
13 SRC_TEST="do"
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~alpha amd64 ~hppa ia64 ~mips ~ppc ~ppc64 sparc x86"
17 IUSE="berkdb qmail ssl doc ldap mysql postgres sqlite tools ipv6"
18
19 DEPEND=">=dev-lang/perl-5.8.2-r1
20 virtual/perl-MIME-Base64
21 >=virtual/perl-PodParser-1.32
22 virtual/perl-Storable
23 virtual/perl-Time-HiRes
24 >=dev-perl/HTML-Parser-3.31
25 >=dev-perl/Net-DNS-0.53
26 dev-perl/Digest-SHA1
27 dev-perl/libwww-perl
28 >=virtual/perl-Archive-Tar-1.26
29 app-crypt/gnupg
30 virtual/perl-IO-Zlib
31 ssl? (
32 dev-perl/IO-Socket-SSL
33 dev-libs/openssl
34 )
35 berkdb? (
36 virtual/perl-DB_File
37 )
38 ldap? ( dev-perl/perl-ldap )
39 mysql? (
40 dev-perl/DBI
41 dev-perl/DBD-mysql
42 )
43 postgres? (
44 dev-perl/DBI
45 dev-perl/DBD-Pg
46 )
47 sqlite? (
48 dev-perl/DBI
49 dev-perl/DBD-SQLite
50 )
51
52 ipv6? (
53 dev-perl/IO-Socket-INET6
54 )"
55
56 src_unpack() {
57 unpack ${A}
58 cd ${S}
59
60 # - bug #167515 - should be fixed by upstream in 3.1.9
61 epatch ${FILESDIR}/3.1.8-archive-iterator.patch
62 }
63
64 src_compile() {
65 # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
66 # (just to be sure, nobody knows how it could happen in the first place).
67 myconf="SYSCONFDIR=/etc DATADIR=/usr/share/spamassassin"
68
69 # If ssl is enabled, spamc can be built with ssl support
70 if use ssl; then
71 myconf="${myconf} ENABLE_SSL=yes"
72 else
73 myconf="${myconf} ENABLE_SSL=no"
74 fi
75
76 # Set the path to the Perl executable explictly. This will be used to
77 # create the initial sharpbang line in the scripts and might cause
78 # a versioned app name end in there, see
79 # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
80 myconf="${myconf} PERL_BIN=/usr/bin/perl"
81
82 # If you are going to enable taint mode, make sure that the bug where
83 # spamd doesn't start when the PATH contains . is addressed, and make
84 # sure you deal with versions of razor <2.36-r1 not being taint-safe.
85 # <http://bugzilla.spamassassin.org/show_bug.cgi?id=2511> and
86 # <http://spamassassin.org/released/Razor2.patch>.
87 myconf="${myconf} PERL_TAINT=no"
88
89 # No settings needed for 'make all'.
90 mymake=""
91
92 # Neither for 'make install'.
93 myinst=""
94
95 # Add Gentoo tag to make it easier for the upstream devs to spot
96 # possible modifications or patches.
97 version_tag="g${PV:6}${PR}"
98 version_str="${PV//_/-}-${version_tag}"
99
100 # Create the Gentoo config file before Makefile.PL is called so it
101 # is copied later on.
102 echo "version_tag ${version_tag}" > rules/11_gentoo.cf
103
104 # Setting the following env var ensures that no questions are asked.
105 export PERL_MM_USE_DEFAULT=1
106 perl-module_src_prep
107 # Run the autoconf stuff now, just to make the build sequence look more
108 # familiar to the user :) Plus feeding the VERSION_STRING skips some
109 # calls to Perl.
110 make spamc/Makefile VERSION_STRING="${version_str}"
111
112 # Now compile all the stuff selected.
113 perl-module_src_compile
114 if use qmail; then
115 make spamc/qmail-spamc || die building qmail-spamc failed
116 fi
117
118 # Remove the MANIFEST files as they aren't docu files
119 rm -f MANIFEST*
120
121 use doc && make text_html_doc
122 }
123
124 src_install () {
125 perl-module_src_test
126 }
127
128 src_install () {
129 perl-module_src_install
130
131 # Create the stub dir used by sa-update and friends
132 dodir /var/lib/spamassassin
133
134 # Move spamd to sbin where it belongs.
135 dodir /usr/sbin
136 mv "${D}"/usr/bin/spamd "${D}"/usr/sbin/spamd || die
137
138 use qmail && dobin spamc/qmail-spamc
139
140 dosym /etc/mail/spamassassin /etc/spamassassin
141
142 # Disable plugin by default
143 sed -i -e 's/^loadplugin/\#loadplugin/g' ${D}/etc/mail/spamassassin/init.pre
144
145 # Add the init and config scripts.
146 newinitd "${FILESDIR}"/3.0.0-spamd.init spamd
147 newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
148
149 if use doc; then
150 dodoc NOTICE TRADEMARK CREDITS INSTALL UPGRADE BUGS USAGE \
151 sql/README.bayes sql/README.awl README.ldap procmailrc.example \
152 sample-nonspam.txt sample-spam.txt rules/STATISTICS-set0.txt \
153 STATISTICS-set1.txt STATISTICS-set2.txt STATISTICS-set3.txt \
154 spamd/PROTOCOL
155
156 # Rename some docu files so they don't clash with others
157 newdoc spamd/README README.spamd
158 newdoc sql/README README.sql
159 newdoc ldap/README README.ldap
160 use qmail && newdoc spamc/README.qmail README.qmail
161
162 dohtml doc/*.html
163 docinto sql
164 dodoc sql/*.sql
165 fi
166
167 # Install provided tools. See bug 108168
168 if use tools; then
169 docinto tools
170 dodoc tools/*
171 fi
172
173 cp ${FILESDIR}/secrets.cf ${D}/etc/mail/spamassassin/secrets.cf.example
174 fperms 0400 /etc/mail/spamassassin/secrets.cf.example
175 echo "">>${D}/etc/mail/spamassassin/local.cf.example
176 echo "# Sensitive data, such as database connection info, should">>${D}/etc/mail/spamassassin/local.cf.example
177 echo "# be stored in /etc/mail/spamassassin/secrets.cf with">>${D}/etc/mail/spamassassin/local.cf.example
178 echo "# appropriate permissions">>${D}/etc/mail/spamassassin/local.cf.example
179 }
180
181 pkg_postinst() {
182 perl-module_pkg_postinst
183
184 if ! has_version "perl-core/DB_File"; then
185 einfo "The Bayes backend requires the Berkeley DB to store its data. You"
186 einfo "need to emerge perl-core/DB_File or USE=berkdb to make it available."
187 fi
188
189 if has_version "mail-filter/razor"; then
190 if ! has_version ">=mail-filter/razor-2.61"; then
191 ewarn "You have $(best_version mail-filter/razor) installed but SpamAssassin"
192 if has_version "<mail-filter/razor-2.40"; then
193 ewarn "requires at least version 2.40, version 2.61 or later is recommended."
194 else
195 ewarn "recommends at least version 2.61."
196 fi
197 fi
198 fi
199
200 if use doc; then
201 einfo
202 einfo "Please read the file"
203 einfo " /usr/share/doc/${PF}/INSTALL.gz"
204 einfo "to find out which optional modules you need to install to enable"
205 einfo "additional features which depend on them."
206 einfo
207 einfo "If upgraded from 2.x, please read the file"
208 einfo " /usr/share/doc/${PF}/UPGRADE.gz"
209 einfo
210 fi
211
212 ewarn
213 ewarn "spamd is not designed to listen to an untrusted network"
214 ewarn "and is vulnerable to DoS attacks (and eternal doom) if"
215 ewarn "configured to do so"
216 ewarn
217 elog "If you plan on using the -u flag to spamd, please read the notes"
218 elog "in /etc/conf.d/spamd regarding the location of the pid file."
219
220 einfo
221 einfo "If you build ${PN} with optional dependancy support,"
222 einfo "you can enable them in /etc/mail/spamassassin/init.pre"
223 einfo
224
225 if has_version '>=dev-lang/perl-5.8.8'; then
226 elog "A note from the SA developers:"
227 elog "Perl 5.8 now uses Unicode internally by default, which causes trouble for"
228 elog "SpamAssassin (and almost all other reasonably complex pieces of perl"
229 elog "code!)."
230 elog ""
231 elog "We've worked around this in most places, as far as we know, but there may"
232 elog "still be some issues. In addition, there is a speed hit, which it would"
233 elog "be nice to avoid."
234 elog ""
235 elog "Setting the LANG environment variable before any invocation of"
236 elog "SpamAssassin sometimes seems to help fix it, like so:"
237 elog ""
238 elog " export LANG=en_US"
239 elog ""
240 elog "Notably, the LANG setting must not include \"utf8\". However, some folks"
241 elog "have reported that this makes no difference. ;)"
242 fi
243 einfo
244 if ! has_version 'dev-perl/Mail-SPF-Query'; then
245 elog "For spf support, please emerge dev-perl/Mail-SPF-Query"
246 fi
247 if ! has_version 'mail-filter/dcc'; then
248 elog "For dcc support, please emerge mail-filter/dcc"
249 fi
250 if ! has_version 'dev-python/pyzor'; then
251 elog "For pyzor support, please emerge dev-python/pyzor"
252 fi
253 if ! has_version 'mail-filter/razor'; then
254 elog "For razor support, please emerge mail-filter/razor"
255 fi
256 einfo
257 elog "For addtional functionality, you may wish to emerge:"
258 elog "dev-perl/IP-Country dev-perl/Net-Ident "
259 elog "dev-perl/Mail-DomainKeys"
260
261 }

  ViewVC Help
Powered by ViewVC 1.1.20