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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jun 25 13:30:11 2011 UTC (8 years, 11 months ago) by tove
Branch: MAIN
Version bump

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

  ViewVC Help
Powered by ViewVC 1.1.20