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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Mon May 11 16:42:23 2015 UTC (4 years, 10 months ago) by robbat2
Branch: MAIN
CVS Tags: HEAD
Bump.

(Portage version: 2.2.18/cvs/Linux x86_64, unsigned Manifest commit)

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-r1.ebuild,v 1.1 2015/02/27 23:30:33 mjo 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="An extensible mail filter which can identify and tag 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="+bayes berkdb qmail ssl doc ldap mysql postgres sqlite ipv6"
19
20 # You can do without a database unless you need the Bayes features.
21 REQUIRED_USE="bayes? ( || ( berkdb mysql postgres sqlite ) )"
22
23 DEPEND=">=dev-lang/perl-5.8.8-r8
24 virtual/perl-MIME-Base64
25 >=virtual/perl-Pod-Parser-1.510.0-r2
26 virtual/perl-Storable
27 virtual/perl-Time-HiRes
28 >=dev-perl/HTML-Parser-3.43
29 >=dev-perl/Mail-DKIM-0.37
30 >=dev-perl/Net-DNS-0.53
31 dev-perl/Digest-SHA1
32 dev-perl/libwww-perl
33 >=virtual/perl-Archive-Tar-1.23
34 app-crypt/gnupg
35 >=virtual/perl-IO-Zlib-1.04
36 >=dev-util/re2c-0.12.0
37 dev-perl/Mail-SPF
38 >=dev-perl/NetAddr-IP-4.0.1
39 dev-perl/Geo-IP
40 dev-perl/Encode-Detect
41 dev-perl/Net-Patricia
42 ssl? (
43 dev-perl/IO-Socket-SSL
44 dev-libs/openssl
45 )
46 berkdb? (
47 virtual/perl-DB_File
48 )
49 ldap? ( dev-perl/perl-ldap )
50 mysql? (
51 dev-perl/DBI
52 dev-perl/DBD-mysql
53 )
54 postgres? (
55 dev-perl/DBI
56 dev-perl/DBD-Pg
57 )
58 sqlite? (
59 dev-perl/DBI
60 dev-perl/DBD-SQLite
61 )
62 ipv6? (
63 || ( dev-perl/IO-Socket-INET6
64 virtual/perl-IO-Socket-IP )
65 )"
66 RDEPEND="${DEPEND}"
67
68 SRC_TEST="do"
69
70 src_prepare() {
71 # Merged upstream
72 #epatch "${FILESDIR}/net-dns-0.76_compatibility.patch"
73 perl-module_src_prepare
74 }
75
76 src_configure() {
77 # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
78 # (just to be sure, nobody knows how it could happen in the first place).
79 myconf="SYSCONFDIR=${EPREFIX}/etc"
80 myconf+=" 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 # Setting the following env var ensures that no questions are asked.
96 perl-module_src_configure
97 # Configure spamc
98 emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile
99 }
100
101 src_compile() {
102 export PERL_MM_USE_DEFAULT=1
103
104 # Now compile all the stuff selected.
105 perl-module_src_compile
106
107 if use qmail; then
108 emake spamc/qmail-spamc
109 fi
110 }
111
112 src_install () {
113 perl-module_src_install
114
115 # Create the stub dir used by sa-update and friends
116 keepdir /var/lib/spamassassin
117
118 # Move spamd to sbin where it belongs.
119 dodir /usr/sbin
120 mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed"
121
122 if use qmail; then
123 dobin spamc/qmail-spamc
124 fi
125
126 ln -s mail/spamassassin "${ED}"/etc/spamassassin || die
127
128 # Disable plugin by default
129 sed -i -e 's/^loadplugin/\#loadplugin/g' \
130 "${ED}"/etc/mail/spamassassin/init.pre \
131 || die "failed to disable plugins by default"
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 insinto /etc/mail/spamassassin/
171 insopts -m0400
172 newins "${FILESDIR}"/secrets.cf secrets.cf.example
173
174 cat <<-EOF > "${T}/local.cf.example"
175 # Sensitive data, such as database connection info, should be stored in
176 # /etc/mail/spamassassin/secrets.cf with appropriate permissions
177 EOF
178
179 insopts -m0644
180 doins "${T}/local.cf.example"
181 }
182
183 pkg_postinst() {
184 elog "If you plan on using the -u flag to spamd, please read the notes"
185 elog "in /etc/conf.d/spamd regarding the location of the pid file."
186 elog
187 elog "If you build ${PN} with optional dependancy support,"
188 elog "you can enable them in /etc/mail/spamassassin/init.pre"
189 elog
190 elog "You need to configure your database to be able to use Bayes filter"
191 elog "with database backend, otherwise it will still use (and need) the"
192 elog "Berkeley DB support."
193 elog "Look at the sql/README.bayes file in the documentation directory"
194 elog "for how to configure it."
195 elog
196 elog "If you plan to use Vipul's Razor, note that versions up to and"
197 elog "including version 2.82 include a bug that will slow down the entire"
198 elog "perl interpreter. Version 2.83 or later fixes this."
199 elog "If you do not plan to use this plugin, be sure to comment out"
200 elog "its loadplugin line in /etc/mail/spamassassin/v310.pre."
201 elog
202 elog "The DKIM plugin is now enabled by default for new installs,"
203 elog "if the perl module Mail::DKIM is installed."
204 elog "However, installation of SpamAssassin will not overwrite existing"
205 elog ".pre configuration files, so to use DKIM when upgrading from a"
206 elog "previous release that did not use DKIM, a directive:"
207 elog
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."
211 elog
212 ewarn "Rules are no longer included with SpamAssassin out of the box".
213 ewarn "You will need to immediately run sa-update, or download"
214 ewarn "the additional rules .tgz package and run sa-update --install"
215 ewarn "with it, to get a ruleset."
216 elog
217 elog "If you run sa-update and receive a GPG validation error."
218 elog "Then you need to import an updated sa-update key."
219 elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt"
220 elog
221 }

  ViewVC Help
Powered by ViewVC 1.1.20