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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu Jun 9 15:27:29 2005 UTC (14 years, 10 months ago) by mcummings
Branch: MAIN
CVS Tags: HEAD
Changes since 1.6: +1 -1 lines
FILE REMOVED
Cleaning. Next task: get mips bumped
(Portage version: 2.0.51.22-r1)

1 # Copyright 1999-2005 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.0.1.ebuild,v 1.6 2005/05/25 14:23:49 mcummings Exp $
4
5 inherit perl-module
6
7 DESCRIPTION="SpamAssassin is an extensible email filter which is used to identify spam."
8 HOMEPAGE="http://spamassassin.apache.org/"
9 LICENSE="Apache-2.0"
10
11 MY_P=Mail-SpamAssassin-${PV//_/-}
12 S=${WORKDIR}/${MY_P}
13
14 SRC_URI="http://www.apache.org/dist/spamassassin/${MY_P}.tar.bz2"
15
16 SLOT="0"
17 KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~ia64 ~amd64"
18 IUSE="berkdb qmail ssl doc"
19
20 DEPEND=">=dev-lang/perl-5.8.2-r1
21 >=dev-perl/PodParser-1.22
22 perl-core/MIME-Base64
23 >=dev-perl/HTML-Parser-3.31
24 >=dev-perl/Net-DNS-0.34
25 dev-perl/Digest-SHA1
26 ssl? (
27 dev-perl/IO-Socket-SSL
28 dev-libs/openssl
29 )
30 berkdb? (
31 perl-core/DB_File
32 )"
33
34
35 # - Set SYSCONFDIR explicitly so we can't get bitten by bug 48205 again
36 # (just to be sure, nobody knows how it could happen in the first place).
37 myconf="SYSCONFDIR=/etc DATADIR=/usr/share/spamassassin"
38
39 # If ssl is enabled, spamc can be built with ssl support
40 if use ssl; then
41 myconf="${myconf} ENABLE_SSL=yes"
42 else
43 myconf="${myconf} ENABLE_SSL=no"
44 fi
45
46 # Set the path to the Perl executable explictly. This will be used to
47 # create the initial sharpbang line in the scripts and might cause
48 # a versioned app name end in there, see
49 # <http://bugs.gentoo.org/show_bug.cgi?id=62276>
50 myconf="${myconf} PERL_BIN=/usr/bin/perl"
51
52 # If you are going to enable taint mode, make sure that the bug where
53 # spamd doesn't start when the PATH contains . is addressed, and make
54 # sure you deal with versions of razor <2.36-r1 not being taint-safe.
55 # <http://bugzilla.spamassassin.org/show_bug.cgi?id=2511> and
56 # <http://spamassassin.org/released/Razor2.patch>.
57 myconf="${myconf} PERL_TAINT=no"
58
59 # No settings needed for 'make all'.
60 mymake=""
61
62 # Neither for 'make install'.
63 myinst=""
64
65 # Some more files to be installed (README* and Changes are already
66 # included per default)
67 mydoc="NOTICE
68 TRADEMARK
69 LICENSE
70 CREDITS
71 INSTALL
72 UPGRADE
73 BUGS
74 USAGE
75 README.spamd
76 README.sql
77 README.ldap
78 procmailrc.example
79 sample-nonspam.txt
80 sample-spam.txt
81 STATISTICS.set0
82 STATISTICS.set1
83 STATISTICS.set2
84 STATISTICS.set3"
85
86 use qmail && mydoc="${mydoc} README.qmail"
87
88
89 src_move_doc() {
90 echo "Renaming $1 to $2"
91 mv $1 $2 || die failed to move documentation
92 }
93
94 src_append_doc() {
95 echo "Appending $1 to $2"
96 cat $1 >> $2 || die failed to append documentation
97 }
98
99 src_compile() {
100 # Add Gentoo tag to make it easier for the upstream devs to spot
101 # possible modifications or patches.
102 version_tag="g${PV:6}${PR}"
103 version_str="${PV//_/-}-${version_tag}"
104
105 # Create the Gentoo config file before Makefile.PL is called so it
106 # is copied later on.
107 echo "version_tag ${version_tag}" > rules/11_gentoo.cf
108
109 # Setting the following env var ensures that no questions are asked.
110 export PERL_MM_USE_DEFAULT=1
111 perl-module_src_prep
112 # Run the autoconf stuff now, just to make the build sequence look more
113 # familiar to the user :) Plus feeding the VERSION_STRING skips some
114 # calls to Perl.
115 make spamc/Makefile VERSION_STRING="${version_str}"
116
117 # Now compile all the stuff selected.
118 perl-module_src_compile
119 if use qmail; then
120 make spamc/qmail-spamc || die building qmail-spamc failed
121 fi
122
123 # Rename some docu files so they don't clash with others
124 src_move_doc spamd/README README.spamd
125 src_move_doc spamc/README.qmail README.qmail
126 src_move_doc sql/README README.sql
127 src_append_doc sql/README.bayes README.sql
128 src_append_doc sql/README.awl README.sql
129 src_move_doc ldap/README README.ldap
130 src_move_doc rules/STATISTICS.txt STATISTICS.set0
131 src_move_doc rules/STATISTICS-set1.txt STATISTICS.set1
132 src_move_doc rules/STATISTICS-set2.txt STATISTICS.set2
133 src_move_doc rules/STATISTICS-set3.txt STATISTICS.set3
134 # Remove the MANIFEST files as they aren't docu files
135 rm -f MANIFEST*
136
137 if use doc; then
138 make text_html_doc
139 fi
140
141 }
142
143 src_install () {
144 perl-module_src_install
145
146 # Move spamd to sbin where it belongs.
147 dodir /usr/sbin
148 mv ${D}/usr/bin/spamd ${D}/usr/sbin/spamd || die
149
150 if use qmail; then
151 into /usr
152 dobin spamc/qmail-spamc
153 fi
154
155 # Add the init and config scripts.
156 dodir /etc/init.d /etc/conf.d
157 insinto /etc/init.d
158 newins ${FILESDIR}/3.0.0-spamd.init spamd
159 fperms 755 /etc/init.d/spamd
160 insinto /etc/conf.d
161 newins ${FILESDIR}/3.0.0-spamd.conf spamd
162 dosym /etc/mail/spamassassin /etc/spamassassin
163
164 if use doc; then
165 dodoc spamd/PROTOCOL
166 for f in doc/*.html; do
167 dodoc $f
168 done
169 fi
170 }
171
172 pkg_postinst() {
173 perl-module_pkg_postinst
174
175 if ! has_version "perl-core/DB_File"; then
176 einfo "The Bayes backend requires the Berkeley DB to store its data. You"
177 einfo "need to emerge perl-core/DB_File or USE=berkdb to make it available."
178 fi
179
180 if has_version "mail-filter/razor"; then
181 if ! has_version ">=mail-filter/razor-2.61"; then
182 ewarn "You have $(best_version mail-filter/razor) installed but SpamAssassin"
183 if has_version "<mail-filter/razor-2.40"; then
184 ewarn "requires at least version 2.40, version 2.61 or later is recommended."
185 else
186 ewarn "recommends at least version 2.61."
187 fi
188 fi
189 fi
190
191 einfo
192 einfo "Please read the file"
193 einfo " /usr/share/doc/${PF}/INSTALL.gz"
194 einfo "to find out which optional modules you need to install to enable"
195 einfo "additional features which depend on them."
196 einfo
197 einfo "If upgraded from 2.x, please read the file"
198 einfo " /usr/share/doc/${PF}/UPGRADE.gz"
199 einfo
200 ewarn
201 ewarn "spamd is not designed to listen to an untrusted network"
202 ewarn "and is vulnerable to DoS attacks (and eternal doom) if"
203 ewarn "configured to do so"
204 ewarn
205 }
206

  ViewVC Help
Powered by ViewVC 1.1.20