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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.22 - (show annotations) (download)
Wed May 13 07:00:41 2015 UTC (4 years, 9 months ago) by jmorgan
Branch: MAIN
CVS Tags: HEAD
Changes since 1.21: +2 -2 lines
ppc64 stable wrt bug #537464

(Portage version: 2.2.18/cvs/Linux x86_64, RepoMan options: --include-arches="ppc64", signed Manifest commit with key )

1 # Copyright 1999-2015 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.4.0.ebuild,v 1.21 2015/05/13 06:33:18 jmorgan Exp $
4
5 EAPI=5
6
7 inherit perl-module toolchain-funcs eutils systemd readme.gentoo
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 IUSE="+berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
19
20 REQUIRED_USE="|| ( berkdb mysql postgres sqlite )"
21
22 DEPEND=">=dev-lang/perl-5.8.8-r8
23 virtual/perl-MIME-Base64
24 >=virtual/perl-Pod-Parser-1.510.0-r2
25 virtual/perl-Storable
26 virtual/perl-Time-HiRes
27 >=dev-perl/HTML-Parser-3.43
28 >=dev-perl/Mail-DKIM-0.37
29 >=dev-perl/Net-DNS-0.53
30 dev-perl/Digest-SHA1
31 dev-perl/libwww-perl
32 >=virtual/perl-Archive-Tar-1.23
33 app-crypt/gnupg
34 >=virtual/perl-IO-Zlib-1.04
35 >=dev-util/re2c-0.12.0
36 dev-perl/Mail-SPF
37 >=dev-perl/NetAddr-IP-4.0.1
38 dev-perl/Geo-IP
39 dev-perl/Encode-Detect
40 dev-perl/Net-Patricia
41 ssl? (
42 dev-perl/IO-Socket-SSL
43 dev-libs/openssl
44 )
45 berkdb? (
46 virtual/perl-DB_File
47 )
48 ldap? ( dev-perl/perl-ldap )
49 mysql? (
50 dev-perl/DBI
51 dev-perl/DBD-mysql
52 )
53 postgres? (
54 dev-perl/DBI
55 dev-perl/DBD-Pg
56 )
57 sqlite? (
58 dev-perl/DBI
59 dev-perl/DBD-SQLite
60 )
61 ipv6? (
62 || ( dev-perl/IO-Socket-INET6
63 virtual/perl-IO-Socket-IP )
64 )"
65 RDEPEND="${DEPEND}"
66
67 SRC_TEST="do"
68
69 src_configure() {
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=${EPREFIX}/etc DATADIR=${EPREFIX}/usr/share/spamassassin"
73
74 # If ssl is enabled, spamc can be built with ssl support
75 if use ssl; then
76 myconf+=" ENABLE_SSL=yes"
77 else
78 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+=" PERL_BIN=${EPREFIX}/usr/bin/perl"
86
87 # Add Gentoo tag to make it easy for the upstream devs to spot
88 # possible modifications or patches.
89 #version_tag="g${PV:6}${PR}"
90 #version_str="${PV//_/-}-${version_tag}"
91
92 # Create the Gentoo config file before Makefile.PL is called so it
93 # is copied later on.
94 #echo "version_tag ${version_tag}" > rules/11_gentoo.cf
95
96 # Setting the following env var ensures that no questions are asked.
97 perl-module_src_configure
98 # Configure spamc
99 emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
100 }
101
102 src_compile() {
103 export PERL_MM_USE_DEFAULT=1
104
105 # Now compile all the stuff selected.
106 perl-module_src_compile
107
108 if use qmail; then
109 emake spamc/qmail-spamc
110 fi
111
112 }
113
114 src_install () {
115 perl-module_src_install
116
117 # Create the stub dir used by sa-update and friends
118 keepdir /var/lib/spamassassin
119
120 # Move spamd to sbin where it belongs.
121 dodir /usr/sbin
122 mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
123
124 if use qmail; then
125 dobin spamc/qmail-spamc
126 fi
127
128 ln -s mail/spamassassin "${ED}"/etc/spamassassin || die
129
130 # Disable plugin by default
131 sed -i -e 's/^loadplugin/\#loadplugin/g' "${ED}"/etc/mail/spamassassin/init.pre || die
132
133 # Add the init and config scripts.
134 newinitd "${FILESDIR}"/3.3.1-spamd.init spamd
135 newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd
136
137 systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service
138 systemd_install_serviced "${FILESDIR}"/${PN}.service.conf
139
140 if use postgres; then
141 sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd" || die
142
143 dodoc sql/*_pg.sql
144 else
145 sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd" || die
146 fi
147
148 if use mysql; then
149 sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd" || die
150
151 dodoc sql/*_mysql.sql
152 else
153 sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd" || die
154 fi
155
156 dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
157 sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
158 sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \
159 spamd-apache2/README.apache
160
161 # Rename some docu files so they don't clash with others
162 newdoc spamd/README README.spamd
163 newdoc sql/README README.sql
164 newdoc ldap/README README.ldap
165
166 if use qmail; then
167 dodoc spamc/README.qmail
168 fi
169
170 cp "${FILESDIR}"/secrets.cf "${ED}"/etc/mail/spamassassin/secrets.cf.example || die
171 fperms 0400 /etc/mail/spamassassin/secrets.cf.example
172
173 cat <<-EOF > "${T}/local.cf.example"
174 # Sensitive data, such as database connection info, should be stored in
175 # /etc/mail/spamassassin/secrets.cf with appropriate permissions
176 EOF
177
178 insinto /etc/mail/spamassassin/
179 doins "${T}/local.cf.example"
180 }
181
182 pkg_postinst() {
183 elog "If you plan on using the -u flag to spamd, please read the notes"
184 elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
185 elog "If you build ${PN} with optional dependancy support,"
186 elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
187 elog "You need to configure your database to be able to use Bayes filter"
188 elog "with database backend, otherwise it will still use (and need) the"
189 elog "Berkeley DB support."
190 elog "Look at the sql/README.bayes file in the documentation directory"
191 elog "for how to configure it.\n"
192 elog "If you plan to use Vipul's Razor, note that versions up to and"
193 elog "including version 2.82 include a bug that will slow down the entire"
194 elog "perl interpreter. Version 2.83 or later fixes this."
195 elog "If you do not plan to use this plugin, be sure to comment out"
196 elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
197 elog "The DKIM plugin is now enabled by default for new installs,"
198 elog "if the perl module Mail::DKIM is installed."
199 elog "However, installation of SpamAssassin will not overwrite existing"
200 elog ".pre configuration files, so to use DKIM when upgrading from a"
201 elog "previous release that did not use DKIM, a directive:\n"
202 elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
203 elog "will need to be uncommented in file 'v312.pre', or added"
204 elog "to some other .pre file, such as local.pre.\n"
205 ewarn "Rules are no longer included with SpamAssassin out of the box".
206 ewarn "You will need to immediately run sa-update, or download"
207 ewarn "the additional rules .tgz package and run sa-update --install"
208 ewarn "with it, to get a ruleset.\n"
209 elog "If you run sa-update and receive a GPG validation error."
210 elog "Then you need to import an updated sa-update key."
211 elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
212 }

  ViewVC Help
Powered by ViewVC 1.1.20