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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20