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

Contents of /mail-filter/spamassassin/spamassassin-3.1.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20