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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations) (download)
Sun Jul 16 09:20:32 2006 UTC (13 years, 8 months ago) by ian
Branch: MAIN
CVS Tags: HEAD
Changes since 1.15: +1 -1 lines
FILE REMOVED
Clean up for bug #140527
(Portage version: 2.1.1_pre3)
 (Unsigned Manifest commit)

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

  ViewVC Help
Powered by ViewVC 1.1.20