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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Sun Jun 17 15:05:52 2012 UTC (7 years, 9 months ago) by ago
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +1 -1 lines
FILE REMOVED
Remove old

(Portage version: 2.1.10.49/cvs/Linux x86_64)

1 # Copyright 1999-2011 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.1-r4.ebuild,v 1.9 2011/12/01 19:25:10 vapier Exp $
4
5 EAPI="2"
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"
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
61 PATCHES=( "${FILESDIR}/${P}-PERL-5-12.patch"
62 "${FILESDIR}"/${P}-uninitialized_value.patch )
63
64 RDEPEND="${DEPEND}"
65
66 # - Disable tests as they will fail
67 # - Please see http://www.cpantesters.org/distro/M/Mail-SpamAssassin.html#Mail-SpamAssassin-3.3.1
68 # - for more info, upstream problem not specific to Gentoo
69 SRC_TEST="skip"
70
71 src_configure() {
72 # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
73 # (just to be sure, nobody knows how it could happen in the first place).
74 myconf="SYSCONFDIR=/etc DATADIR=/usr/share/spamassassin"
75
76 # If ssl is enabled, spamc can be built with ssl support
77 if use ssl; then
78 myconf+=" ENABLE_SSL=yes"
79 else
80 myconf+=" ENABLE_SSL=no"
81 fi
82
83 # Set the path to the Perl executable explictly. This will be used to
84 # create the initial sharpbang line in the scripts and might cause
85 # a versioned app name end in there, see
86 # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
87 myconf+=" PERL_BIN=/usr/bin/perl"
88
89 # Add Gentoo tag to make it easy for the upstream devs to spot
90 # possible modifications or patches.
91 #version_tag="g${PV:6}${PR}"
92 #version_str="${PV//_/-}-${version_tag}"
93
94 # Create the Gentoo config file before Makefile.PL is called so it
95 # is copied later on.
96 #echo "version_tag ${version_tag}" > rules/11_gentoo.cf
97
98 # Setting the following env var ensures that no questions are asked.
99 perl-module_src_configure
100 # Configure spamc
101 emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile || die "emake failed"
102 }
103
104 src_compile() {
105 export PERL_MM_USE_DEFAULT=1
106
107 # Now compile all the stuff selected.
108 perl-module_src_compile
109
110 if use qmail; then
111 emake spamc/qmail-spamc || die "building qmail-spamc emake failed"
112 fi
113
114 }
115
116 src_install () {
117 perl-module_src_install
118
119 # Create the stub dir used by sa-update and friends
120 dodir /var/lib/spamassassin || die
121
122 # Move spamd to sbin where it belongs.
123 dodir /usr/sbin
124 mv "${D}"/usr/bin/spamd "${D}"/usr/sbin/spamd || die "move spamd failed"
125
126 if use qmail; then
127 dobin spamc/qmail-spamc || die
128 fi
129
130 dosym /etc/mail/spamassassin /etc/spamassassin || die
131
132 # Disable plugin by default
133 sed -i -e 's/^loadplugin/\#loadplugin/g' "${D}"/etc/mail/spamassassin/init.pre || die
134
135 # Add the init and config scripts.
136 newinitd "${FILESDIR}"/3.3.1-spamd.init spamd || die
137 newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd || die
138
139 use postgres && \
140 sed -i -e 's:@USEPOSTGRES@::' "${D}/etc/init.d/spamd" || \
141 sed -i -e '/@USEPOSTGRES@/d' "${D}/etc/init.d/spamd"
142
143 use mysql && \
144 sed -i -e 's:@USEMYSQL@::' "${D}/etc/init.d/spamd" || \
145 sed -i -e '/@USEMYSQL@/d' "${D}/etc/init.d/spamd"
146
147 dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \
148 sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \
149 sample-spam.txt spamassassin.spec spamd/PROTOCOL spamd/README.vpopmail \
150 spamd-apache2/README.apache || die
151
152 # Rename some docu files so they don't clash with others
153 newdoc spamd/README README.spamd || die
154 newdoc sql/README README.sql || die
155 newdoc ldap/README README.ldap || die
156
157 if use qmail; then
158 dodoc spamc/README.qmail || die
159 fi
160
161 cp "${FILESDIR}"/secrets.cf "${D}"/etc/mail/spamassassin/secrets.cf.example || die
162 fperms 0400 /etc/mail/spamassassin/secrets.cf.example
163
164 cat <<EOF > "${T}/local.cf.example"
165 # Sensitive data, such as database connection info, should be stored in
166 # /etc/mail/spamassassin/secrets.cf with appropriate permissions
167 EOF
168
169 insinto /etc/mail/spamassassin/
170 doins "${T}/local.cf.example" || die
171 }
172
173 pkg_postinst() {
174 perl-module_pkg_postinst
175 elog "If you plan on using the -u flag to spamd, please read the notes"
176 elog "in /etc/conf.d/spamd regarding the location of the pid file.\n"
177 elog "If you build ${PN} with optional dependancy support,"
178 elog "you can enable them in /etc/mail/spamassassin/init.pre\n"
179 elog "You need to configure your database to be able to use Bayes filter"
180 elog "with database backend, otherwise it will still use (and need) the"
181 elog "Berkeley DB support."
182 elog "Look at the sql/README.bayes file in the documentation directory"
183 elog "for how to configure it.\n"
184 elog "If you plan to use Vipul's Razor, note that versions up to and"
185 elog "including version 2.82 include a bug that will slow down the entire"
186 elog "perl interpreter. Version 2.83 or later fixes this."
187 elog "If you do not plan to use this plugin, be sure to comment out"
188 elog "its loadplugin line in /etc/mail/spamassassin/v310.pre.\n"
189 elog "The DKIM plugin is now enabled by default for new installs,"
190 elog "if the perl module Mail::DKIM is installed."
191 elog "However, installation of SpamAssassin will not overwrite existing"
192 elog ".pre configuration files, so to use DKIM when upgrading from a"
193 elog "previous release that did not use DKIM, a directive:\n"
194 elog "loadplugin Mail::SpamAssassin::Plugin::DKIM"
195 elog "will need to be uncommented in file 'v312.pre', or added"
196 elog "to some other .pre file, such as local.pre.\n"
197 ewarn "Rules are no longer included with SpamAssassin out of the box".
198 ewarn "You will need to immediately run sa-update, or download"
199 ewarn "the additional rules .tgz package and run sa-update --install"
200 ewarn "with it, to get a ruleset.\n"
201 elog "If when you run sa-update and receive a GPG validation error."
202 elog "Then you need to import an updated sa-update key."
203 elog "sa-update --import /usr/share/spamassassin/sa-update-pubkey.txt\n"
204 }

  ViewVC Help
Powered by ViewVC 1.1.20