/[gentoo-x86]/mail-filter/spamassassin/spamassassin-3.2.5-r2.ebuild
Gentoo

Contents of /mail-filter/spamassassin/spamassassin-3.2.5-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.9 - (show annotations) (download)
Sun Mar 20 07:58:48 2011 UTC (9 years ago) by tove
Branch: MAIN
CVS Tags: HEAD
Changes since 1.8: +1 -1 lines
FILE REMOVED
Cleanup

(Portage version: 2.2.0_alpha28/cvs/Linux x86_64)

1 # Copyright 1999-2010 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.2.5-r2.ebuild,v 1.8 2010/10/22 19:35:05 ssuominen 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 mirror://gentoo/${MY_P}.tar.bz2"
12
13 SRC_TEST="do"
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="alpha amd64 hppa ia64 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.43
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-1.04
31 >=dev-util/re2c-0.12.0
32 ssl? (
33 dev-perl/IO-Socket-SSL
34 dev-libs/openssl
35 )
36 berkdb? (
37 virtual/perl-DB_File
38 )
39 ldap? ( dev-perl/perl-ldap )
40 mysql? (
41 dev-perl/DBI
42 dev-perl/DBD-mysql
43 )
44 postgres? (
45 dev-perl/DBI
46 dev-perl/DBD-Pg
47 )
48 sqlite? (
49 dev-perl/DBI
50 dev-perl/DBD-SQLite
51 )
52
53 ipv6? (
54 dev-perl/IO-Socket-INET6
55 )"
56 RDEPEND="${DEPEND}"
57
58 PATCHES=( "${FILESDIR}/${PN}-3.2.5-DESTDIR.patch"
59 "${FILESDIR}/FH_DATE_PAST_20XX.patch" )
60
61 src_compile() {
62 # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
63 # (just to be sure, nobody knows how it could happen in the first place).
64 myconf="SYSCONFDIR=/etc DATADIR=/usr/share/spamassassin"
65
66 # If ssl is enabled, spamc can be built with ssl support
67 if use ssl; then
68 myconf="${myconf} ENABLE_SSL=yes"
69 else
70 myconf="${myconf} ENABLE_SSL=no"
71 fi
72
73 # Set the path to the Perl executable explictly. This will be used to
74 # create the initial sharpbang line in the scripts and might cause
75 # a versioned app name end in there, see
76 # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
77 myconf="${myconf} PERL_BIN=/usr/bin/perl"
78
79 # If you are going to enable taint mode, make sure that the bug where
80 # spamd doesn't start when the PATH contains . is addressed, and make
81 # sure you deal with versions of razor <2.36-r1 not being taint-safe.
82 # <http://bugzilla.spamassassin.org/show_bug.cgi?id=2511> and
83 # <http://spamassassin.org/released/Razor2.patch>.
84 myconf="${myconf} PERL_TAINT=no"
85
86 # No settings needed for 'make all'.
87 mymake=""
88
89 # Neither for 'make install'.
90 myinst=""
91
92 # Add Gentoo tag to make it easier for the upstream devs to spot
93 # possible modifications or patches.
94 version_tag="g${PV:6}${PR}"
95 version_str="${PV//_/-}-${version_tag}"
96
97 # Create the Gentoo config file before Makefile.PL is called so it
98 # is copied later on.
99 echo "version_tag ${version_tag}" > rules/11_gentoo.cf
100
101 # Setting the following env var ensures that no questions are asked.
102 export PERL_MM_USE_DEFAULT=1
103 perl-module_src_prep
104 # Run the autoconf stuff now, just to make the build sequence look more
105 # familiar to the user :) Plus feeding the VERSION_STRING skips some
106 # calls to Perl.
107 make spamc/Makefile VERSION_STRING="${version_str}"
108
109 # Now compile all the stuff selected.
110 perl-module_src_compile
111 if use qmail; then
112 make spamc/qmail-spamc || die building qmail-spamc failed
113 fi
114
115 # Remove the MANIFEST files as they aren't docu files
116 rm -f MANIFEST*
117
118 use doc && make text_html_doc
119 }
120
121 src_test() {
122 perl-module_src_test
123 }
124
125 src_install () {
126 perl-module_src_install
127
128 # Create the stub dir used by sa-update and friends
129 dodir /var/lib/spamassassin
130
131 # Move spamd to sbin where it belongs.
132 dodir /usr/sbin
133 mv "${D}"/usr/bin/spamd "${D}"/usr/sbin/spamd || die
134
135 use qmail && dobin spamc/qmail-spamc
136
137 dosym /etc/mail/spamassassin /etc/spamassassin
138
139 # Disable plugin by default
140 sed -i -e 's/^loadplugin/\#loadplugin/g' "${D}"/etc/mail/spamassassin/init.pre
141
142 # Add the init and config scripts.
143 newinitd "${FILESDIR}"/3.0.0-spamd.init spamd
144 newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
145
146 if use doc; then
147 dodoc NOTICE TRADEMARK CREDITS INSTALL INSTALL.VMS UPGRADE USAGE \
148 sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
149 sample-spam.txt spamassassin.spec spamd/PROTOCOL spamd/README.vpopmail \
150 spamd-apache2/README.apache
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.example
170 fperms 0400 /etc/mail/spamassassin/secrets.cf.example
171 echo "">>${D}/etc/mail/spamassassin/local.cf.example
172 echo "# Sensitive data, such as database connection info, should">>${D}/etc/mail/spamassassin/local.cf.example
173 echo "# be stored in /etc/mail/spamassassin/secrets.cf with">>${D}/etc/mail/spamassassin/local.cf.example
174 echo "# appropriate permissions">>${D}/etc/mail/spamassassin/local.cf.example
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 INSTALL in"
199 einfo " /usr/share/doc/${PF}/"
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 UPGRADE in"
204 einfo " /usr/share/doc/${PF}/"
205 einfo
206 fi
207
208 ewarn
209 ewarn "spamd is not designed to listen to an untrusted network"
210 ewarn "and is vulnerable to DoS attacks (and eternal doom) if"
211 ewarn "configured to do so"
212 ewarn
213 elog "If you plan on using the -u flag to spamd, please read the notes"
214 elog "in /etc/conf.d/spamd regarding the location of the pid file."
215
216 einfo
217 einfo "If you build ${PN} with optional dependancy support,"
218 einfo "you can enable them in /etc/mail/spamassassin/init.pre"
219 einfo
220
221 if has_version '>=dev-lang/perl-5.8.8'; then
222 elog "A note from the SA developers:"
223 elog "Perl 5.8 now uses Unicode internally by default, which causes trouble for"
224 elog "SpamAssassin (and almost all other reasonably complex pieces of perl"
225 elog "code!)."
226 elog ""
227 elog "We've worked around this in most places, as far as we know, but there may"
228 elog "still be some issues. In addition, there is a speed hit, which it would"
229 elog "be nice to avoid."
230 elog ""
231 elog "Setting the LANG environment variable before any invocation of"
232 elog "SpamAssassin sometimes seems to help fix it, like so:"
233 elog ""
234 elog " export LANG=en_US"
235 elog ""
236 elog "Notably, the LANG setting must not include \"utf8\". However, some folks"
237 elog "have reported that this makes no difference. ;)"
238 fi
239 einfo
240 if ! has_version 'dev-perl/Mail-SPF-Query'; then
241 elog "For spf support, please emerge dev-perl/Mail-SPF-Query"
242 fi
243 if ! has_version 'mail-filter/dcc'; then
244 elog "For dcc support, please emerge mail-filter/dcc"
245 fi
246 if ! has_version 'dev-python/pyzor'; then
247 elog "For pyzor support, please emerge dev-python/pyzor"
248 fi
249 if ! has_version 'mail-filter/razor'; then
250 elog "For razor support, please emerge mail-filter/razor"
251 fi
252 einfo
253 elog "For addtional functionality, you may wish to emerge:"
254 elog "dev-perl/IP-Country dev-perl/Net-Ident "
255 elog "dev-perl/Mail-DKIM"
256
257 }

  ViewVC Help
Powered by ViewVC 1.1.20