1 |
commit: ac6dc0d2e553c43edb05cc7203364c68eb7fd9cd |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 3 20:40:59 2016 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 3 21:37:06 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac6dc0d2 |
7 |
|
8 |
mail-filter/spamassassin: new major revision to install module man pages. |
9 |
|
10 |
In bug 494260, it was reported that several man pages for |
11 |
SpamAssassin's perl modules are missing. This turns out to be the |
12 |
fault of the perl-module eclass, which deletes those man pages after |
13 |
they've been installed in src_install. To fix it, at the very least, |
14 |
would require avoiding perl-module_src_install(). |
15 |
|
16 |
It appears that we're not using too much functionality of that eclass, |
17 |
especially once a workaround for src_install is in place. So in this |
18 |
commit, I have removed the dependency on perl-module.eclass entirely |
19 |
and configured/built/installed the package "manually." This fixes the |
20 |
documentation bug. |
21 |
|
22 |
Now with the eclass gone, it became possible to move to EAPI=6, and |
23 |
this allowed even more code cleanup, such as the removal of |
24 |
src_prepare() and the use of the default src_test(). The eutils eclass |
25 |
is then no longer needed, and einstalldocs() can be used. After adding |
26 |
"test" to IUSE, I noticed that the "doc" USE flag was redundant and |
27 |
removed it. |
28 |
|
29 |
Finally, the postinst message was updated to point to a new wiki page, |
30 |
https://wiki.gentoo.org/wiki/SpamAssassin, which partially addresses |
31 |
bug 532094 and gets rid of some outdated information. |
32 |
|
33 |
Gentoo-Bug: 494260 |
34 |
Gentoo-Bug: 532094 |
35 |
|
36 |
Package-Manager: portage-2.2.28 |
37 |
|
38 |
.../spamassassin/spamassassin-3.4.1-r4.ebuild | 195 +++++++++++++++++++++ |
39 |
1 file changed, 195 insertions(+) |
40 |
|
41 |
diff --git a/mail-filter/spamassassin/spamassassin-3.4.1-r4.ebuild b/mail-filter/spamassassin/spamassassin-3.4.1-r4.ebuild |
42 |
new file mode 100644 |
43 |
index 0000000..c694645 |
44 |
--- /dev/null |
45 |
+++ b/mail-filter/spamassassin/spamassassin-3.4.1-r4.ebuild |
46 |
@@ -0,0 +1,195 @@ |
47 |
+# Copyright 1999-2016 Gentoo Foundation |
48 |
+# Distributed under the terms of the GNU General Public License v2 |
49 |
+# $Id$ |
50 |
+ |
51 |
+EAPI=6 |
52 |
+ |
53 |
+inherit toolchain-funcs systemd |
54 |
+ |
55 |
+MY_P=Mail-SpamAssassin-${PV//_/-} |
56 |
+S=${WORKDIR}/${MY_P} |
57 |
+DESCRIPTION="An extensible mail filter which can identify and tag spam" |
58 |
+HOMEPAGE="http://spamassassin.apache.org/" |
59 |
+SRC_URI="mirror://apache/spamassassin/source/${MY_P}.tar.bz2" |
60 |
+ |
61 |
+LICENSE="Apache-2.0 GPL-2" |
62 |
+SLOT="0" |
63 |
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~x86-macos" |
64 |
+IUSE="+bayes berkdb ipv6 ldap libressl mysql postgres qmail sqlite ssl test" |
65 |
+ |
66 |
+# You can do without a database unless you need the Bayes features. |
67 |
+REQUIRED_USE="bayes? ( || ( berkdb mysql postgres sqlite ) )" |
68 |
+ |
69 |
+DEPEND=">=dev-lang/perl-5.8.8-r8 |
70 |
+ virtual/perl-MIME-Base64 |
71 |
+ >=virtual/perl-Pod-Parser-1.510.0-r2 |
72 |
+ virtual/perl-Storable |
73 |
+ virtual/perl-Time-HiRes |
74 |
+ >=dev-perl/HTML-Parser-3.43 |
75 |
+ >=dev-perl/Mail-DKIM-0.37 |
76 |
+ >=dev-perl/Net-DNS-0.53 |
77 |
+ dev-perl/Digest-SHA1 |
78 |
+ dev-perl/libwww-perl |
79 |
+ >=virtual/perl-Archive-Tar-1.23 |
80 |
+ app-crypt/gnupg |
81 |
+ >=virtual/perl-IO-Zlib-1.04 |
82 |
+ >=dev-util/re2c-0.12.0 |
83 |
+ dev-perl/Mail-SPF |
84 |
+ >=dev-perl/NetAddr-IP-4.0.1 |
85 |
+ dev-perl/Geo-IP |
86 |
+ dev-perl/Encode-Detect |
87 |
+ dev-perl/Net-Patricia |
88 |
+ ssl? ( |
89 |
+ dev-perl/IO-Socket-SSL |
90 |
+ !libressl? ( dev-libs/openssl:0 ) |
91 |
+ libressl? ( dev-libs/libressl ) |
92 |
+ ) |
93 |
+ berkdb? ( |
94 |
+ virtual/perl-DB_File |
95 |
+ ) |
96 |
+ ldap? ( dev-perl/perl-ldap ) |
97 |
+ mysql? ( |
98 |
+ dev-perl/DBI |
99 |
+ dev-perl/DBD-mysql |
100 |
+ ) |
101 |
+ postgres? ( |
102 |
+ dev-perl/DBI |
103 |
+ dev-perl/DBD-Pg |
104 |
+ ) |
105 |
+ sqlite? ( |
106 |
+ dev-perl/DBI |
107 |
+ dev-perl/DBD-SQLite |
108 |
+ ) |
109 |
+ ipv6? ( |
110 |
+ || ( dev-perl/IO-Socket-INET6 |
111 |
+ virtual/perl-IO-Socket-IP ) |
112 |
+ )" |
113 |
+RDEPEND="${DEPEND}" |
114 |
+ |
115 |
+# Some spamd tests fail, and it looks like the whole suite eventually |
116 |
+# hangs. |
117 |
+RESTRICT=test |
118 |
+ |
119 |
+PATCHES=( |
120 |
+ "${FILESDIR}/spamassassin-3.4.1-bug_7223.patch" |
121 |
+ "${FILESDIR}/spamassassin-3.4.1-bug_7231.patch" |
122 |
+ "${FILESDIR}/spamassassin-3.4.1-bug_7265.patch" |
123 |
+) |
124 |
+ |
125 |
+src_configure() { |
126 |
+ # spamc can be built with ssl support. |
127 |
+ local use_ssl="no" |
128 |
+ if use ssl; then |
129 |
+ use_ssl="yes" |
130 |
+ fi |
131 |
+ |
132 |
+ # Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again |
133 |
+ # (just to be sure, nobody knows how it could happen in the first place). |
134 |
+ # |
135 |
+ # We also set the path to the perl executable explictly. This will be |
136 |
+ # used to create the initial shebang line in the scripts (bug 62276). |
137 |
+ perl Makefile.PL \ |
138 |
+ PREFIX="${EPREFIX}/usr" \ |
139 |
+ INSTALLDIRS=vendor \ |
140 |
+ SYSCONFDIR="${EPREFIX}/etc" \ |
141 |
+ DATADIR="${EPREFIX}/usr/share/spamassassin" \ |
142 |
+ PERL_BIN="${EPREFIX}/usr/bin/perl" \ |
143 |
+ ENABLE_SSL="${use_ssl}" \ |
144 |
+ DESTDIR="${D}" \ |
145 |
+ || die "Unable to build!" |
146 |
+ |
147 |
+ # Now configure spamc. |
148 |
+ emake CC="$(tc-getCC)" LDFLAGS="${LDFLAGS}" spamc/Makefile |
149 |
+} |
150 |
+ |
151 |
+src_compile() { |
152 |
+ PERL_MM_USE_DEFAULT=1 emake |
153 |
+ |
154 |
+ if use qmail; then |
155 |
+ emake spamc/qmail-spamc |
156 |
+ fi |
157 |
+} |
158 |
+ |
159 |
+src_install () { |
160 |
+ emake install |
161 |
+ einstalldocs |
162 |
+ |
163 |
+ # Create the stub dir used by sa-update and friends |
164 |
+ keepdir /var/lib/spamassassin |
165 |
+ |
166 |
+ # Move spamd to sbin where it belongs. |
167 |
+ dodir /usr/sbin |
168 |
+ mv "${ED}"/usr/bin/spamd "${ED}"/usr/sbin/spamd || die "move spamd failed" |
169 |
+ |
170 |
+ if use qmail; then |
171 |
+ dobin spamc/qmail-spamc |
172 |
+ fi |
173 |
+ |
174 |
+ ln -s mail/spamassassin "${ED}"/etc/spamassassin || die |
175 |
+ |
176 |
+ # Disable plugin by default |
177 |
+ sed -i -e 's/^loadplugin/\#loadplugin/g' \ |
178 |
+ "${ED}"/etc/mail/spamassassin/init.pre \ |
179 |
+ || die "failed to disable plugins by default" |
180 |
+ |
181 |
+ # Add the init and config scripts. |
182 |
+ newinitd "${FILESDIR}"/3.3.1-spamd.init spamd |
183 |
+ newconfd "${FILESDIR}"/3.0.0-spamd.conf spamd |
184 |
+ |
185 |
+ systemd_newunit "${FILESDIR}"/${PN}.service-r1 ${PN}.service |
186 |
+ systemd_install_serviced "${FILESDIR}"/${PN}.service.conf |
187 |
+ |
188 |
+ if use postgres; then |
189 |
+ sed -i -e 's:@USEPOSTGRES@::' "${ED}/etc/init.d/spamd" || die |
190 |
+ |
191 |
+ dodoc sql/*_pg.sql |
192 |
+ else |
193 |
+ sed -i -e '/@USEPOSTGRES@/d' "${ED}/etc/init.d/spamd" || die |
194 |
+ fi |
195 |
+ |
196 |
+ if use mysql; then |
197 |
+ sed -i -e 's:@USEMYSQL@::' "${ED}/etc/init.d/spamd" || die |
198 |
+ |
199 |
+ dodoc sql/*_mysql.sql |
200 |
+ else |
201 |
+ sed -i -e '/@USEMYSQL@/d' "${ED}/etc/init.d/spamd" || die |
202 |
+ fi |
203 |
+ |
204 |
+ dodoc NOTICE TRADEMARK CREDITS INSTALL.VMS UPGRADE USAGE \ |
205 |
+ sql/README.bayes sql/README.awl procmailrc.example sample-nonspam.txt \ |
206 |
+ sample-spam.txt spamd/PROTOCOL spamd/README.vpopmail \ |
207 |
+ spamd-apache2/README.apache |
208 |
+ |
209 |
+ # Rename some docu files so they don't clash with others |
210 |
+ newdoc spamd/README README.spamd |
211 |
+ newdoc sql/README README.sql |
212 |
+ newdoc ldap/README README.ldap |
213 |
+ |
214 |
+ if use qmail; then |
215 |
+ dodoc spamc/README.qmail |
216 |
+ fi |
217 |
+ |
218 |
+ insinto /etc/mail/spamassassin/ |
219 |
+ insopts -m0400 |
220 |
+ newins "${FILESDIR}"/secrets.cf secrets.cf.example |
221 |
+ |
222 |
+ # Create the directory where sa-update stores its GPG key (if you |
223 |
+ # choose to import one). If this directory does not exist, the |
224 |
+ # import will fail. This is bug 396307. We expect that the import |
225 |
+ # will be performed as root, and making the directory accessible |
226 |
+ # only to root prevents a warning on the command-line. |
227 |
+ diropts -m0700 |
228 |
+ dodir /etc/mail/spamassassin/sa-update-keys |
229 |
+} |
230 |
+ |
231 |
+pkg_postinst() { |
232 |
+ elog |
233 |
+ elog "No rules are install by default. You will need to run sa-update" |
234 |
+ elog "at least once, and most likely configure SpamAssassin before it" |
235 |
+ elog "will work. You should also consider a cron job for sa-update." |
236 |
+ elog |
237 |
+ elog "Configuration and update help can be found on the wiki:" |
238 |
+ elog |
239 |
+ elog " https://wiki.gentoo.org/wiki/SpamAssassin" |
240 |
+ elog |
241 |
+} |