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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Sun Mar 20 07:58:48 2011 UTC (9 years ago) by tove
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Cleanup

(Portage version: 2.2.0_alpha28/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20