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

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

  ViewVC Help
Powered by ViewVC 1.1.20