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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Tue Aug 21 04:30:17 2012 UTC (2 years ago) by ottxor
Branch: MAIN
Changes since 1.9: +12 -12 lines
added prefix keywords

(Portage version: 2.2.0_alpha121/cvs/Linux i686)

1 # Copyright 1999-2012 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.3.2-r1.ebuild,v 1.9 2012/06/17 14:46:52 armin76 Exp $
4
5 EAPI=4
6
7 inherit perl-module toolchain-funcs eutils
8
9 MY_P=Mail-SpamAssassin-${PV//_/-}
10 S=${WORKDIR}/${MY_P}
11 DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam"
12 HOMEPAGE="http://spamassassin.apache.org/"
13 SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2"
14
15 LICENSE="Apache-2.0"
16 SLOT="0"
17 KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos"
18 # need keyword request for Mail-SPF ppc ppc64
19 IUSE="berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
20
21 DEPEND=">=dev-lang/perl-5.8.8-r8
22 virtual/perl-MIME-Base64
23 >=virtual/perl-PodParser-1.32
24 virtual/perl-Storable
25 virtual/perl-Time-HiRes
26 >=dev-perl/HTML-Parser-3.43
27 >=dev-perl/Mail-DKIM-0.37
28 >=dev-perl/Net-DNS-0.53
29 dev-perl/Digest-SHA1
30 dev-perl/libwww-perl
31 >=virtual/perl-Archive-Tar-1.26
32 app-crypt/gnupg
33 >=virtual/perl-IO-Zlib-1.04
34 >=dev-util/re2c-0.12.0
35 dev-perl/Mail-SPF
36 dev-perl/NetAddr-IP
37 ssl? (
38 dev-perl/IO-Socket-SSL
39 dev-libs/openssl
40 )
41 berkdb? (
42 virtual/perl-DB_File
43 )
44 ldap? ( dev-perl/perl-ldap )
45 mysql? (
46 dev-perl/DBI
47 dev-perl/DBD-mysql
48 )
49 postgres? (
50 dev-perl/DBI
51 dev-perl/DBD-Pg
52 )
53 sqlite? (
54 dev-perl/DBI
55 dev-perl/DBD-SQLite
56 )
57 ipv6? (
58 dev-perl/IO-Socket-INET6
59 )"
60 RDEPEND="${DEPEND}"
61
62 SRC_TEST="do"
63
64 src_prepare() {
65 # http://old.nabble.com/Migrating-bayes-to-mysql-fails-with-parsing-errors-td31889789i20.html
66
67 # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6624
68 epatch "${FILESDIR}/${P}-mysql_count_rows.patch"
69
70 #https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6625
71 epatch "${FILESDIR}/${P}-binary_token.patch"
72
73 # https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6626
74 epatch "${FILESDIR}/${P}-innodb.patch"
75 }
76
77 src_configure() {
78 # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
79 # (just to be sure, nobody knows how it could happen in the first place).
80 myconf="SYSCONFDIR=${EPREFIX}/etc DATADIR=${EPREFIX}/usr/share/spamassassin"
81
82 # If ssl is enabled, spamc can be built with ssl support
83 if use ssl; then
84 myconf+=" ENABLE_SSL=yes"
85 else
86 myconf+=" ENABLE_SSL=no"
87 fi
88
89 # Set the path to the Perl executable explictly. This will be used to
90 # create the initial sharpbang line in the scripts and might cause
91 # a versioned app name end in there, see
92 # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
93 myconf+=" PERL_BIN=${EPREFIX}/usr/bin/perl"
94
95 # Add Gentoo tag to make it easy 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 perl-module_src_configure
106 # Configure spamc
107 emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
108 }
109
110 src_compile() {
111 export PERL_MM_USE_DEFAULT=1
112
113 # Now compile all the stuff selected.
114 perl-module_src_compile
115
116 if use qmail; then
117 emake spamc/qmail-spamc
118 fi
119
120 }
121
122 src_install () {
123 perl-module_src_install
124
125 # Create the stub dir used by sa-update and friends
126 dodir /var/lib/spamassassin
127
128 # Move spamd to sbin where it belongs.
129 dodir /usr/sbin
130 mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
131
132 if use qmail; then
133 dobin spamc/qmail-spamc
134 fi
135
136 ln -s mail/spamassassin "${ED}"/etc/spamassassin || die
137
138 # Disable plugin by default
139 sed -i -e 's/^loadplugin/\#loadplugin/g' "${ED}"/etc/mail/spamassassin/init.pre || die
140
141 # Add the init and config scripts.
142 newinitd "${FILESDIR}"/3.3.1-spamd.init spamd
143 newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
144
145 if use postgres; then
146 sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd"
147
148 dodoc sql/*_pg.sql
149 else
150 sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd"
151 fi
152
153 if use mysql; then
154 sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd"
155
156 dodoc sql/*_mysql.sql
157 else
158 sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd"
159 fi
160
161 dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
162 sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
163 sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
164 spamd-apache2/README.apache
165
166 # Rename some docu files so they don't clash with others
167 newdoc spamd/README README.spamd
168 newdoc sql/README README.sql
169 newdoc ldap/README README.ldap
170
171 if use qmail; then
172 dodoc spamc/README.qmail
173 fi
174
175 cp "${FILESDIR}"/secrets.cf "${ED}"/etc/mail/spamassassin/secrets.cf.example || die
176 fperms 0400 /etc/mail/spamassassin/secrets.cf.example
177
178 cat <<-EOF > "${T}/local.cf.example"
179 # Sensitive data, such as database connection info, should be stored in
180 # /etc/mail/spamassassin/secrets.cf with appropriate permissions
181 EOF
182
183 insinto /etc/mail/spamassassin/
184 doins "${T}/local.cf.example"
185 }
186
187 pkg_postinst() {
188 perl-module_pkg_postinst
189 elog "If you plan on using the -u flag to spamd, please read the notes"
190 elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
191 elog "If you build ${PN} with optional dependancy support,"
192 elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
193 elog "You need to configure your database to be able to use Bayes filter"
194 elog "with database backend, otherwise it will still use (and need) the"
195 elog "Berkeley DB support."
196 elog "Look at the sql/README.bayes file in the documentation directory"
197 elog "for how to configure it.\n"
198 elog "If you plan to use Vipul's Razor, note that versions up to and"
199 elog "including version 2.82 include a bug that will slow down the entire"
200 elog "perl interpreter. Version 2.83 or later fixes this."
201 elog "If you do not plan to use this plugin, be sure to comment out"
202 elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
203 elog "The DKIM plugin is now enabled by default for new installs,"
204 elog "if the perl module Mail::DKIM is installed."
205 elog "However, installation of SpamAssassin will not overwrite existing"
206 elog ".pre configuration files, so to use DKIM when upgrading from a"
207 elog "previous release that did not use DKIM, a directive:\n"
208 elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
209 elog "will need to be uncommented in file 'v312.pre', or added"
210 elog "to some other .pre file, such as local.pre.\n"
211 ewarn "Rules are no longer included with SpamAssassin out of the box".
212 ewarn "You will need to immediately run sa-update, or download"
213 ewarn "the additional rules .tgz package and run sa-update --install"
214 ewarn "with it, to get a ruleset.\n"
215 elog "If when you run sa-update and receive a GPG validation error."
216 elog "Then you need to import an updated sa-update key."
217 elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
218 }

  ViewVC Help
Powered by ViewVC 1.1.20