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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Sep 28 18:01:23 2014 UTC (5 years, 6 months ago) by zlogene
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Drop old.

(Portage version: 2.2.8-r2/cvs/Linux x86_64, signed Manifest commit with key 0xC42EB5D6)

1 # Copyright 1999-2014 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-r4.ebuild,v 1.2 2014/07/21 19:04:56 dilfridge Exp $
4
5 EAPI=4
6
7 inherit perl-module toolchain-funcs eutils systemd
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 GPL-2"
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-Pod-Parser-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 keepdir /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 systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service
146 systemd_install_serviced "${FILESDIR}"/${PN}.service.conf
147
148 if use postgres; then
149 sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd"
150
151 dodoc sql/*_pg.sql
152 else
153 sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd"
154 fi
155
156 if use mysql; then
157 sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd"
158
159 dodoc sql/*_mysql.sql
160 else
161 sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd"
162 fi
163
164 dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
165 sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
166 sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
167 spamd-apache2/README.apache
168
169 # Rename some docu files so they don't clash with others
170 newdoc spamd/README README.spamd
171 newdoc sql/README README.sql
172 newdoc ldap/README README.ldap
173
174 if use qmail; then
175 dodoc spamc/README.qmail
176 fi
177
178 cp "${FILESDIR}"/secrets.cf "${ED}"/etc/mail/spamassassin/secrets.cf.example || die
179 fperms 0400 /etc/mail/spamassassin/secrets.cf.example
180
181 cat <<-EOF > "${T}/local.cf.example"
182 # Sensitive data, such as database connection info, should be stored in
183 # /etc/mail/spamassassin/secrets.cf with appropriate permissions
184 EOF
185
186 insinto /etc/mail/spamassassin/
187 doins "${T}/local.cf.example"
188 }
189
190 pkg_postinst() {
191 perl-module_pkg_postinst
192 elog "If you plan on using the -u flag to spamd, please read the notes"
193 elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
194 elog "If you build ${PN} with optional dependancy support,"
195 elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
196 elog "You need to configure your database to be able to use Bayes filter"
197 elog "with database backend, otherwise it will still use (and need) the"
198 elog "Berkeley DB support."
199 elog "Look at the sql/README.bayes file in the documentation directory"
200 elog "for how to configure it.\n"
201 elog "If you plan to use Vipul's Razor, note that versions up to and"
202 elog "including version 2.82 include a bug that will slow down the entire"
203 elog "perl interpreter. Version 2.83 or later fixes this."
204 elog "If you do not plan to use this plugin, be sure to comment out"
205 elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
206 elog "The DKIM plugin is now enabled by default for new installs,"
207 elog "if the perl module Mail::DKIM is installed."
208 elog "However, installation of SpamAssassin will not overwrite existing"
209 elog ".pre configuration files, so to use DKIM when upgrading from a"
210 elog "previous release that did not use DKIM, a directive:\n"
211 elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
212 elog "will need to be uncommented in file 'v312.pre', or added"
213 elog "to some other .pre file, such as local.pre.\n"
214 ewarn "Rules are no longer included with SpamAssassin out of the box".
215 ewarn "You will need to immediately run sa-update, or download"
216 ewarn "the additional rules .tgz package and run sa-update --install"
217 ewarn "with it, to get a ruleset.\n"
218 elog "If when you run sa-update and receive a GPG validation error."
219 elog "Then you need to import an updated sa-update key."
220 elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
221 }

  ViewVC Help
Powered by ViewVC 1.1.20