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

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

  ViewVC Help
Powered by ViewVC 1.1.20