1 |
ulm 08/02/03 11:43:09 |
2 |
|
3 |
Modified: ChangeLog |
4 |
Added: postfix-2.2.11-r1.ebuild postfix-2.3.8-r1.ebuild |
5 |
postfix-2.4.6-r2.ebuild |
6 |
Removed: postfix-2.4.6-r1.ebuild postfix-2.2.11.ebuild |
7 |
postfix-2.3.8.ebuild |
8 |
Log: |
9 |
Replace call to docert by install_cert, bug 201671. |
10 |
(Portage version: 2.1.4.1, RepoMan options: --force) |
11 |
|
12 |
Revision Changes Path |
13 |
1.144 mail-mta/postfix/ChangeLog |
14 |
|
15 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.144&view=markup |
16 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.144&content-type=text/plain |
17 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/ChangeLog?r1=1.143&r2=1.144 |
18 |
|
19 |
Index: ChangeLog |
20 |
=================================================================== |
21 |
RCS file: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v |
22 |
retrieving revision 1.143 |
23 |
retrieving revision 1.144 |
24 |
diff -u -r1.143 -r1.144 |
25 |
--- ChangeLog 12 Dec 2007 16:56:07 -0000 1.143 |
26 |
+++ ChangeLog 3 Feb 2008 11:43:08 -0000 1.144 |
27 |
@@ -1,6 +1,16 @@ |
28 |
# ChangeLog for mail-mta/postfix |
29 |
-# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2 |
30 |
-# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.143 2007/12/12 16:56:07 jer Exp $ |
31 |
+# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 |
32 |
+# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.144 2008/02/03 11:43:08 ulm Exp $ |
33 |
+ |
34 |
+*postfix-2.4.6-r2 (03 Feb 2008) |
35 |
+*postfix-2.3.8-r1 (03 Feb 2008) |
36 |
+*postfix-2.2.11-r1 (03 Feb 2008) |
37 |
+ |
38 |
+ 03 Feb 2008; Ulrich Mueller <ulm@g.o> -postfix-2.2.11.ebuild, |
39 |
+ +postfix-2.2.11-r1.ebuild, -postfix-2.3.8.ebuild, |
40 |
+ +postfix-2.3.8-r1.ebuild, -postfix-2.4.6-r1.ebuild, |
41 |
+ +postfix-2.4.6-r2.ebuild: |
42 |
+ Replace docert by install_cert, bug 201671. |
43 |
|
44 |
12 Dec 2007; Jeroen Roovers <jer@g.o> postfix-2.4.5.ebuild: |
45 |
Stable for HPPA (bug #199332). |
46 |
|
47 |
|
48 |
|
49 |
1.1 mail-mta/postfix/postfix-2.2.11-r1.ebuild |
50 |
|
51 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.2.11-r1.ebuild?rev=1.1&view=markup |
52 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.2.11-r1.ebuild?rev=1.1&content-type=text/plain |
53 |
|
54 |
Index: postfix-2.2.11-r1.ebuild |
55 |
=================================================================== |
56 |
# Copyright 1999-2008 Gentoo Foundation |
57 |
# Distributed under the terms of the GNU General Public License v2 |
58 |
# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-2.2.11-r1.ebuild,v 1.1 2008/02/03 11:43:08 ulm Exp $ |
59 |
|
60 |
inherit eutils ssl-cert toolchain-funcs flag-o-matic pam |
61 |
IUSE="ipv6 pam ldap mysql postgres ssl sasl mailwrapper mbox nis vda selinux hardened cdb" |
62 |
#IUSE="ipv6 pam ldap mysql postgres ssl sasl mailwrapper mbox nis vda selinux hardened devel" |
63 |
|
64 |
MY_PV=${PV} |
65 |
MY_SRC=${PN}-${MY_PV} |
66 |
#DEV_SRC=${MY_SRC}-newdb-nonprod |
67 |
VDA_VER=2.2.10 |
68 |
VDA_P="${PN}-${VDA_VER}-vda" |
69 |
RC_VER="2.2.9" |
70 |
|
71 |
DESCRIPTION="A fast and secure drop-in replacement for sendmail." |
72 |
HOMEPAGE="http://www.postfix.org/" |
73 |
SRC_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official/${MY_SRC}.tar.gz |
74 |
vda? ( http://web.onda.com.br/nadal/postfix/VDA/${VDA_P}.patch.gz ) " |
75 |
# devel? ( ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/${DEV_SRC}.tar.gz ) " |
76 |
|
77 |
LICENSE="IPL-1" |
78 |
SLOT="0" |
79 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
80 |
|
81 |
PROVIDE="virtual/mta virtual/mda" |
82 |
DEPEND="cdb? ( || ( >=dev-db/cdb-0.75-r1 >=dev-db/tinycdb-0.74 ) ) |
83 |
>=sys-libs/db-3.2 |
84 |
>=dev-libs/libpcre-3.4 |
85 |
pam? ( virtual/pam ) |
86 |
ldap? ( >=net-nds/openldap-1.2 ) |
87 |
mysql? ( virtual/mysql ) |
88 |
postgres? ( >=dev-db/postgresql-7.1 ) |
89 |
ssl? ( >=dev-libs/openssl-0.9.6g ) |
90 |
sasl? ( >=dev-libs/cyrus-sasl-2 )" |
91 |
RDEPEND="${DEPEND} |
92 |
>=net-mail/mailbase-0.00 |
93 |
!mailwrapper? ( !virtual/mta ) |
94 |
mailwrapper? ( >=net-mail/mailwrapper-0.2 ) |
95 |
selinux? ( sec-policy/selinux-postfix )" |
96 |
|
97 |
#if use devel; then |
98 |
# MY_SRC=${DEV_SRC} |
99 |
#fi |
100 |
|
101 |
S=${WORKDIR}/${MY_SRC} |
102 |
|
103 |
group_user_check() { |
104 |
einfo "checking for postfix group... create if missing." |
105 |
enewgroup postfix 207 |
106 |
einfo "checking for postdrop group... create if missing." |
107 |
enewgroup postdrop 208 |
108 |
einfo "checking for postfix user... create if missing." |
109 |
enewuser postfix 207 -1 /var/spool/postfix postfix |
110 |
} |
111 |
|
112 |
pkg_setup() { |
113 |
# do not upgrade from postfix-2.1. logic to fix bug #53324 |
114 |
if [[ -f /var/lib/init.d/started/postfix ]] ; then |
115 |
if has_version '<mail-mta/postfix-2.2' ; then |
116 |
if [ "${FORCE_UPGRADE}" ]; then |
117 |
echo |
118 |
ewarn "You are upgrading from a incompatible version and" |
119 |
ewarn "you have FORCE_UPGRADE set, will build this package with postfix running." |
120 |
ewarn "You MUST stop postfix BEFORE install it to your system." |
121 |
echo |
122 |
else |
123 |
echo |
124 |
eerror "You are upgrading from a incompatible version." |
125 |
eerror "You MUST stop postfix BEFORE install it to your system." |
126 |
eerror "If you want a minimal downtime, emerge postfix with:" |
127 |
eerror "\`FORCE_UPGRADE=1 emerge --buildpkgonly postfix\`; then" |
128 |
eerror "\`/etc/init.d/postfix stop && emerge --usepkgonly postfix\`" |
129 |
eerror "run etc-update or dispatch-conf and merge the configuration files." |
130 |
eerror "Next /etc/init.d/postfix start" |
131 |
die "upgrade from an incompatible version!" |
132 |
echo |
133 |
fi |
134 |
|
135 |
else |
136 |
echo |
137 |
ewarn "It is safe to upgrade your current version while it's running." |
138 |
ewarn "If you don't want to take any chance; please hit Ctrl+C now;" |
139 |
ewarn "stop Postfix then emerge again." |
140 |
ewarn "You have been warned!" |
141 |
ewarn "Waiting 5 seconds before continuing." |
142 |
echo |
143 |
epause 5 |
144 |
fi |
145 |
fi |
146 |
|
147 |
echo |
148 |
ewarn "Read \"ftp://ftp.porcupine.org/mirrors/postfix-release/official/${MY_SRC}.RELEASE_NOTES\"" |
149 |
ewarn "for incompatible changes before continue." |
150 |
ewarn "Bugs should be filed at \"http://bugs.gentoo.org\"" |
151 |
ewarn "assign to \"net-mail@g.o\"." |
152 |
echo |
153 |
#epause 5 |
154 |
|
155 |
# put out warnings to work around bug #45764 |
156 |
if has_version '<=mail-mta/postfix-2.0.18'; then |
157 |
echo |
158 |
ewarn "You are upgrading from postfix-2.0.18 or earlier, one of the empty queue" |
159 |
ewarn "directory get deleted during unmerge the older version (#45764). Please run" |
160 |
ewarn "\`etc/postfix/post-install upgrade-source\` to recreate them." |
161 |
echo |
162 |
#epause 5 |
163 |
fi |
164 |
|
165 |
#TLS non-prod warn |
166 |
if use ssl; then |
167 |
echo |
168 |
ewarn "you have \"ssl\" in your USE flags, TLS will be enabled." |
169 |
ewarn "This service entry is incompatible with previous TLS patch." |
170 |
ewarn "Visit http://www.postfix.org/TLS_README.html for more info." |
171 |
echo |
172 |
#epause 5 |
173 |
fi |
174 |
|
175 |
# IPV6 non-prod warn |
176 |
if use ipv6; then |
177 |
echo |
178 |
ewarn "you have \"ipv6\" in your USE flags, IPV6 will be enabled." |
179 |
ewarn "Visit http://www.postfix.org/IPV6_README.html for more info." |
180 |
echo |
181 |
fi |
182 |
|
183 |
# add postfix, postdrop user/group. Bug #77565. |
184 |
group_user_check || die "failed to check/add needed user/group" |
185 |
|
186 |
} |
187 |
|
188 |
src_unpack() { |
189 |
unpack ${A} && cd "${S}" |
190 |
|
191 |
epatch "${FILESDIR}/${PN}-master.cf.patch" |
192 |
|
193 |
if use vda ; then |
194 |
epatch "${WORKDIR}/${VDA_P}.patch" |
195 |
fi |
196 |
|
197 |
# Postfix does not get the FQDN if no hostname is configured. |
198 |
epatch "${FILESDIR}/${PN}-2.0.9-get-FQDN.patch" |
199 |
|
200 |
sed -i -e "/^#define ALIAS_DB_MAP/s|hash:/etc/aliases|hash:/etc/mail/aliases|" \ |
201 |
src/util/sys_defs.h || die "sed failed" |
202 |
|
203 |
} |
204 |
|
205 |
src_compile() { |
206 |
# added -Wl,-z,now wrt 62674. |
207 |
# remove -ldl as it is not necessary, resolve bug #106446. |
208 |
# -Wl,-z,now replaced by $(bindnow-flags) |
209 |
# make sure LDFLAGS get passed down to the executables. |
210 |
local mycc="-DHAS_PCRE" mylibs="$(bindnow-flags) ${LDFLAGS} -lpcre -lcrypt -lpthread" |
211 |
|
212 |
use pam && mylibs="${mylibs} -lpam" |
213 |
|
214 |
if use ldap ; then |
215 |
mycc="${mycc} -DHAS_LDAP" |
216 |
mylibs="${mylibs} -lldap -llber" |
217 |
fi |
218 |
|
219 |
if use mysql ; then |
220 |
mycc="${mycc} -DHAS_MYSQL -I/usr/include/mysql" |
221 |
mylibs="${mylibs} -lmysqlclient -lm -lz" |
222 |
fi |
223 |
|
224 |
if use postgres ; then |
225 |
if best_version '=dev-db/postgresql-7.3*' ; then |
226 |
mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql" |
227 |
else |
228 |
mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql/pgsql" |
229 |
fi |
230 |
mylibs="${mylibs} -lpq" |
231 |
fi |
232 |
|
233 |
if use ssl ; then |
234 |
mycc="${mycc} -DUSE_TLS" |
235 |
mylibs="${mylibs} -lssl -lcrypto" |
236 |
fi |
237 |
|
238 |
if use sasl ; then |
239 |
mycc="${mycc} -DUSE_SASL_AUTH -I/usr/include/sasl" |
240 |
mylibs="${mylibs} -lsasl2" |
241 |
fi |
242 |
|
243 |
if ! use nis; then |
244 |
sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" src/util/sys_defs.h || \ |
245 |
die "sed failed" |
246 |
fi |
247 |
|
248 |
if use cdb; then |
249 |
mycc="${mycc} -DHAS_CDB" |
250 |
CDB_LIBS="" |
251 |
|
252 |
# tinycdb is preferred. |
253 |
if has_version dev-db/tinycdb; then |
254 |
einfo "build with dev-db/tinycdb" |
255 |
# ugly hack because gentoo doesn't install cdb.h |
256 |
cp /usr/include/tinycdb.h "${S}"/src/util/cdb.h || die \ |
257 |
"failed to cp /usr/include/tinycdb.h to ${S}/util/cdb.h" |
258 |
CDB_LIBS="-ltinycdb" |
259 |
else |
260 |
CDB_PATH="/usr/lib" |
261 |
for i in cdb.a alloc.a buffer.a unix.a byte.a |
262 |
do CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}" |
263 |
done |
264 |
fi |
265 |
|
266 |
mylibs="${mylibs} ${CDB_LIBS}" |
267 |
fi |
268 |
|
269 |
mycc="${mycc} -DDEF_DAEMON_DIR=\\\"/usr/lib/postfix\\\"" |
270 |
mycc="${mycc} -DDEF_MANPAGE_DIR=\\\"/usr/share/man\\\"" |
271 |
mycc="${mycc} -DDEF_README_DIR=\\\"/usr/share/doc/${PF}/readme\\\"" |
272 |
mycc="${mycc} -DDEF_HTML_DIR=\\\"/usr/share/doc/${PF}/html\\\"" |
273 |
|
274 |
ebegin "Starting make makefiles..." |
275 |
|
276 |
local my_cc=$(tc-getCC) |
277 |
einfo "CC=${my_cc:=gcc}" |
278 |
|
279 |
# workaround for bug #76512 |
280 |
[ "$(gcc-version)" == "3.4" ] && use hardened && replace-flags -O? -Os |
281 |
|
282 |
make CC="${my_cc:=gcc}" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \ |
283 |
makefiles || die "configure problem" |
284 |
|
285 |
emake || die "compile problem" |
286 |
} |
287 |
|
288 |
src_install () { |
289 |
/bin/sh postfix-install \ |
290 |
-non-interactive \ |
291 |
install_root="${D}" \ |
292 |
config_directory="/usr/share/doc/${PF}/defaults" \ |
293 |
readme_directory="/usr/share/doc/${PF}/readme" \ |
294 |
|| die "postfix-install failed" |
295 |
|
296 |
# Fix spool removal on upgrade. |
297 |
rm -rf "${D}/var" |
298 |
keepdir /var/spool/postfix |
299 |
|
300 |
# Install an rmail for UUCP, closing bug #19127. |
301 |
dobin auxiliary/rmail/rmail |
302 |
|
303 |
# mailwrapper stuff |
304 |
if use mailwrapper ; then |
305 |
mv "${D}/usr/sbin/sendmail" "${D}/usr/sbin/sendmail.postfix" |
306 |
mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.postfix" |
307 |
|
308 |
mv "${D}/usr/share/man/man1/sendmail.1" \ |
309 |
"${D}/usr/share/man/man1/sendmail-postfix.1" |
310 |
mv "${D}/usr/share/man/man1/newaliases.1" \ |
311 |
"${D}/usr/share/man/man1/newaliases-postfix.1" |
312 |
mv "${D}/usr/share/man/man1/mailq.1" \ |
313 |
"${D}/usr/share/man/man1/mailq-postfix.1" |
314 |
mv "${D}/usr/share/man/man5/aliases.5" \ |
315 |
"${D}/usr/share/man/man5/aliases-postfix.5" |
316 |
|
317 |
insinto /etc/mail |
318 |
doins "${FILESDIR}/mailer.conf" |
319 |
else |
320 |
# Provide another link for legacy FSH. |
321 |
dosym /usr/sbin/sendmail /usr/lib/sendmail |
322 |
fi |
323 |
|
324 |
# Install qshape tool. |
325 |
dobin auxiliary/qshape/qshape.pl |
326 |
|
327 |
# performance tuning tools. |
328 |
dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink} |
329 |
doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1 |
330 |
|
331 |
# Set proper permissions on required files/directories. |
332 |
fowners root:postdrop /usr/sbin/post{drop,queue} |
333 |
fperms 02711 /usr/sbin/post{drop,queue} |
334 |
|
335 |
keepdir /etc/postfix |
336 |
mv "${D}"/usr/share/doc/${PF}/defaults/{*.cf,post*-*} "${D}"/etc/postfix |
337 |
if use mbox ; then |
338 |
mypostconf="mail_spool_directory=/var/spool/mail" |
339 |
else |
340 |
mypostconf="home_mailbox=.maildir/" |
341 |
fi |
342 |
|
343 |
"${D}/usr/sbin/postconf" -c "${D}/etc/postfix" -e \ |
344 |
${mypostconf} || die "postconf failed" |
345 |
|
346 |
insinto /etc/postfix |
347 |
newins "${FILESDIR}/smtp.pass" saslpass |
348 |
fperms 600 /etc/postfix/saslpass |
349 |
|
350 |
newinitd "${FILESDIR}/postfix.rc6.${RC_VER}" postfix || \ |
351 |
die "newinitd failed" |
352 |
|
353 |
mv "${S}/examples" "${D}/usr/share/doc/${PF}/" |
354 |
dodoc *README COMPATIBILITY HISTORY INSTALL PORTING RELEASE_NOTES* |
355 |
dohtml html/* |
356 |
|
357 |
pamd_mimic_system smtp auth account |
358 |
|
359 |
if use sasl ; then |
360 |
insinto /etc/sasl2 |
361 |
newins "${FILESDIR}/smtp.sasl" smtpd.conf |
362 |
fi |
363 |
} |
364 |
|
365 |
pkg_postinst() { |
366 |
|
367 |
# add postfix, postdrop user/group. Bug #77565. |
368 |
group_user_check || die "failed to check/add needed user/group" |
369 |
|
370 |
# Do not install server.{key,pem) SSL certificates if they already exist |
371 |
if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \ |
372 |
&& ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then |
373 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}" |
374 |
install_cert /etc/ssl/postfix/server |
375 |
chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem} |
376 |
fi |
377 |
|
378 |
ebegin "Fixing queue directories and permissions" |
379 |
"${ROOT}/etc/postfix/post-install" upgrade-permissions |
380 |
echo |
381 |
ewarn "If you upgraded from postfix-1.x, you must revisit" |
382 |
ewarn "your configuration files. See" |
383 |
ewarn " /usr/share/doc/${PF}/RELEASE_NOTES" |
384 |
ewarn "for a list of changes." |
385 |
|
386 |
if [ ! -e /etc/mail/aliases.db ] ; then |
387 |
echo |
388 |
ewarn "You must edit /etc/mail/aliases to suit your needs" |
389 |
ewarn "and then run /usr/bin/newaliases. Postfix will not" |
390 |
ewarn "work correctly without it." |
391 |
fi |
392 |
|
393 |
if ! use mailwrapper && [[ -e /etc/mailer.conf ]] |
394 |
then |
395 |
einfo |
396 |
einfo "Since you emerged $PN without mailwrapper in USE," |
397 |
einfo "you probably want to 'emerge -C mailwrapper' now." |
398 |
einfo |
399 |
fi |
400 |
|
401 |
} |
402 |
|
403 |
|
404 |
|
405 |
1.1 mail-mta/postfix/postfix-2.3.8-r1.ebuild |
406 |
|
407 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.3.8-r1.ebuild?rev=1.1&view=markup |
408 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.3.8-r1.ebuild?rev=1.1&content-type=text/plain |
409 |
|
410 |
Index: postfix-2.3.8-r1.ebuild |
411 |
=================================================================== |
412 |
# Copyright 1999-2008 Gentoo Foundation |
413 |
# Distributed under the terms of the GNU General Public License v2 |
414 |
# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-2.3.8-r1.ebuild,v 1.1 2008/02/03 11:43:08 ulm Exp $ |
415 |
|
416 |
# NOTE: this ebuild is regular ebuild without mailer-config support |
417 |
# comment lines below "regular ebuild" and uncomment lines below "mailer-config support" |
418 |
# to turn this ebuild to mailer-config supported ebuild. |
419 |
|
420 |
# regular ebuild |
421 |
inherit eutils ssl-cert toolchain-funcs flag-o-matic pam |
422 |
# mailer-config support. |
423 |
#inherit eutils ssl-cert toolchain-funcs flag-o-matic mailer pam |
424 |
|
425 |
# regular ebuild. |
426 |
IUSE="ipv6 pam ldap mysql postgres ssl sasl dovecot-sasl mailwrapper mbox nis selinux hardened cdb vda" |
427 |
# mailer-config support. |
428 |
#IUSE="ipv6 pam ldap mysql postgres ssl sasl dovecot-sasl mbox nis selinux hardened cdb" |
429 |
|
430 |
MY_PV=${PV/_rc/-RC} |
431 |
MY_SRC=${PN}-${MY_PV} |
432 |
MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official" |
433 |
VDA_VER=2.3.3 |
434 |
VDA_P="${PN}-${VDA_VER}-vda" |
435 |
RC_VER="2.2.9" |
436 |
|
437 |
DESCRIPTION="A fast and secure drop-in replacement for sendmail." |
438 |
HOMEPAGE="http://www.postfix.org/" |
439 |
SRC_URI="${MY_URI}/${MY_SRC}.tar.gz |
440 |
vda? ( http://web.onda.com.br/nadal/postfix/VDA/${VDA_P}.patch.gz ) " |
441 |
# devel? ( ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/${DEV_SRC}.tar.gz ) " |
442 |
|
443 |
LICENSE="IPL-1" |
444 |
SLOT="0" |
445 |
#KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" |
446 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" |
447 |
|
448 |
# regular ebuild. |
449 |
PROVIDE="virtual/mta virtual/mda" |
450 |
# mailer-config support. |
451 |
#PROVIDE="${PROVIDE} virtual/mda" |
452 |
|
453 |
DEPEND="cdb? ( || ( >=dev-db/cdb-0.75-r1 >=dev-db/tinycdb-0.74 ) ) |
454 |
>=sys-libs/db-3.2 |
455 |
>=dev-libs/libpcre-3.4 |
456 |
pam? ( virtual/pam ) |
457 |
ldap? ( >=net-nds/openldap-1.2 ) |
458 |
mysql? ( virtual/mysql ) |
459 |
postgres? ( >=dev-db/postgresql-7.1 ) |
460 |
ssl? ( >=dev-libs/openssl-0.9.6g ) |
461 |
sasl? ( >=dev-libs/cyrus-sasl-2 )" |
462 |
|
463 |
# regular ebuild. |
464 |
RDEPEND="${DEPEND} |
465 |
>=net-mail/mailbase-0.00 |
466 |
!mailwrapper? ( !virtual/mta ) |
467 |
mailwrapper? ( >=net-mail/mailwrapper-0.2 ) |
468 |
selinux? ( sec-policy/selinux-postfix )" |
469 |
|
470 |
# mailer-config support. |
471 |
#RDEPEND="${DEPEND} |
472 |
# >=net-mail/mailbase-0.00 |
473 |
# selinux? ( sec-policy/selinux-postfix )" |
474 |
|
475 |
#if use devel; then |
476 |
# MY_SRC=${DEV_SRC} |
477 |
#fi |
478 |
|
479 |
S=${WORKDIR}/${MY_SRC} |
480 |
|
481 |
group_user_check() { |
482 |
einfo "checking for postfix group... create if missing." |
483 |
enewgroup postfix 207 |
484 |
einfo "checking for postdrop group... create if missing." |
485 |
enewgroup postdrop 208 |
486 |
einfo "checking for postfix user... create if missing." |
487 |
enewuser postfix 207 -1 /var/spool/postfix postfix,mail |
488 |
} |
489 |
|
490 |
pkg_setup() { |
491 |
# do not upgrade live from postfix <2.3. |
492 |
if [[ -f /var/lib/init.d/started/postfix ]] ; then |
493 |
if has_version '<mail-mta/postfix-2.3.0' ; then |
494 |
if [ "${FORCE_UPGRADE}" ]; then |
495 |
echo |
496 |
ewarn "You are upgrading from a incompatible version and" |
497 |
ewarn "you have FORCE_UPGRADE set, will build this package with postfix running." |
498 |
ewarn "You MUST stop postfix BEFORE install it to your system." |
499 |
echo |
500 |
else |
501 |
echo |
502 |
eerror "You are upgrading from a incompatible version." |
503 |
eerror "You MUST stop postfix BEFORE install it to your system." |
504 |
eerror "If you want a minimal downtime, emerge postfix with:" |
505 |
eerror "\`FORCE_UPGRADE=1 emerge --buildpkgonly postfix\`; then" |
506 |
eerror "\`/etc/init.d/postfix stop && emerge --usepkgonly postfix\`" |
507 |
eerror "run etc-update or dispatch-conf and merge the configuration files." |
508 |
eerror "Next /etc/init.d/postfix start" |
509 |
die "upgrade from an incompatible version!" |
510 |
echo |
511 |
fi |
512 |
|
513 |
else |
514 |
echo |
515 |
ewarn "It is safe to upgrade your current version while it's running." |
516 |
ewarn "If you don't want to take any chance; please hit Ctrl+C now;" |
517 |
ewarn "stop Postfix then emerge again." |
518 |
ewarn "You have been warned!" |
519 |
ewarn "Waiting 5 seconds before continuing." |
520 |
echo |
521 |
epause 5 |
522 |
fi |
523 |
fi |
524 |
|
525 |
echo |
526 |
ewarn "Read \"ftp://ftp.porcupine.org/mirrors/postfix-release/official/${MY_SRC}.RELEASE_NOTES\"" |
527 |
ewarn "for incompatible changes before continue." |
528 |
ewarn "Bugs should be filed at \"http://bugs.gentoo.org\"" |
529 |
ewarn "assign to \"net-mail@g.o\"." |
530 |
echo |
531 |
#epause 5 |
532 |
|
533 |
# put out warnings to work around bug #45764 |
534 |
if has_version '<=mail-mta/postfix-2.0.18'; then |
535 |
echo |
536 |
ewarn "You are upgrading from postfix-2.0.18 or earlier, one of the empty queue" |
537 |
ewarn "directory get deleted during unmerge the older version (#45764). Please run" |
538 |
ewarn "\`etc/postfix/post-install upgrade-source\` to recreate them." |
539 |
echo |
540 |
#epause 5 |
541 |
fi |
542 |
|
543 |
#TLS non-prod warn |
544 |
if use ssl; then |
545 |
echo |
546 |
ewarn "you have \"ssl\" in your USE flags, TLS will be enabled." |
547 |
ewarn "This service entry is incompatible with previous TLS patch." |
548 |
ewarn "Visit http://www.postfix.org/TLS_README.html for more info." |
549 |
echo |
550 |
#epause 5 |
551 |
fi |
552 |
|
553 |
# IPV6 non-prod warn |
554 |
if use ipv6; then |
555 |
echo |
556 |
ewarn "you have \"ipv6\" in your USE flags, IPV6 will be enabled." |
557 |
ewarn "Visit http://www.postfix.org/IPV6_README.html for more info." |
558 |
echo |
559 |
fi |
560 |
|
561 |
if use sasl ; then |
562 |
echo |
563 |
elog "postfix 2.3 supports two SASL implementations." |
564 |
elog "Cyrus SASL and Dovecot protocol version 1 (server only)" |
565 |
elog "detail at http://www.postfix.org/SASL_README.html" |
566 |
echo |
567 |
fi |
568 |
|
569 |
# add postfix, postdrop user/group. Bug #77565. |
570 |
group_user_check || die "failed to check/add needed user/group" |
571 |
} |
572 |
|
573 |
src_unpack() { |
574 |
unpack ${A} && cd "${S}" |
575 |
|
576 |
epatch "${FILESDIR}/${PN}-master.cf.patch" |
577 |
|
578 |
if use vda ; then |
579 |
epatch "${WORKDIR}/${VDA_P}.patch" |
580 |
fi |
581 |
|
582 |
# Postfix does not get the FQDN if no hostname is configured. |
583 |
epatch "${FILESDIR}/${PN}-2.0.9-get-FQDN.patch" |
584 |
|
585 |
sed -i -e "/^#define ALIAS_DB_MAP/s|hash:/etc/aliases|hash:/etc/mail/aliases|" \ |
586 |
src/util/sys_defs.h || die "sed failed" |
587 |
|
588 |
} |
589 |
|
590 |
src_compile() { |
591 |
# added -Wl,-z,now wrt 62674. |
592 |
# remove -ldl as it is not necessary, resolve bug #106446. |
593 |
# -Wl,-z,now replaced by $(bindnow-flags) |
594 |
# make sure LDFLAGS get passed down to the executables. |
595 |
local mycc="-DHAS_PCRE" mylibs="$(bindnow-flags) ${LDFLAGS} -lpcre -lcrypt -lpthread" |
596 |
|
597 |
use pam && mylibs="${mylibs} -lpam" |
598 |
|
599 |
if use ldap ; then |
600 |
mycc="${mycc} -DHAS_LDAP" |
601 |
mylibs="${mylibs} -lldap -llber" |
602 |
fi |
603 |
|
604 |
if use mysql ; then |
605 |
mycc="${mycc} -DHAS_MYSQL -I/usr/include/mysql" |
606 |
mylibs="${mylibs} -lmysqlclient -lm -lz" |
607 |
fi |
608 |
|
609 |
if use postgres ; then |
610 |
if best_version '=dev-db/postgresql-7.3*' ; then |
611 |
mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql" |
612 |
else |
613 |
mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql/pgsql" |
614 |
fi |
615 |
mylibs="${mylibs} -lpq" |
616 |
fi |
617 |
|
618 |
if use ssl ; then |
619 |
mycc="${mycc} -DUSE_TLS" |
620 |
mylibs="${mylibs} -lssl -lcrypto" |
621 |
fi |
622 |
|
623 |
if use sasl ; then |
624 |
if use dovecot-sasl ; then |
625 |
# set dovecot as default. |
626 |
mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\"" |
627 |
fi |
628 |
mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" |
629 |
mylibs="${mylibs} -lsasl2" |
630 |
elif use dovecot-sasl ; then |
631 |
mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"" |
632 |
fi |
633 |
|
634 |
if ! use nis; then |
635 |
sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" src/util/sys_defs.h || \ |
636 |
die "sed failed" |
637 |
fi |
638 |
|
639 |
if use cdb; then |
640 |
mycc="${mycc} -DHAS_CDB" |
641 |
CDB_LIBS="" |
642 |
|
643 |
# tinycdb is preferred. |
644 |
if has_version dev-db/tinycdb; then |
645 |
einfo "build with dev-db/tinycdb" |
646 |
# ugly hack because gentoo doesn't install cdb.h |
647 |
cp /usr/include/tinycdb.h ${S}/src/util/cdb.h || die \ |
648 |
"failed to cp /usr/include/tinycdb.h to ${S}/util/cdb.h" |
649 |
CDB_LIBS="-ltinycdb" |
650 |
else |
651 |
CDB_PATH="/usr/lib" |
652 |
for i in cdb.a alloc.a buffer.a unix.a byte.a |
653 |
do CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}" |
654 |
done |
655 |
fi |
656 |
|
657 |
mylibs="${mylibs} ${CDB_LIBS}" |
658 |
fi |
659 |
|
660 |
mycc="${mycc} -DDEF_DAEMON_DIR=\\\"/usr/lib/postfix\\\"" |
661 |
mycc="${mycc} -DDEF_MANPAGE_DIR=\\\"/usr/share/man\\\"" |
662 |
mycc="${mycc} -DDEF_README_DIR=\\\"/usr/share/doc/${PF}/readme\\\"" |
663 |
mycc="${mycc} -DDEF_HTML_DIR=\\\"/usr/share/doc/${PF}/html\\\"" |
664 |
|
665 |
ebegin "Starting make makefiles..." |
666 |
|
667 |
local my_cc=$(tc-getCC) |
668 |
einfo "CC=${my_cc:=gcc}" |
669 |
|
670 |
# workaround for bug #76512 |
671 |
[ "$(gcc-version)" == "3.4" ] && use hardened && replace-flags -O? -Os |
672 |
|
673 |
make DEBUG="" CC="${my_cc:=gcc}" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \ |
674 |
makefiles || die "configure problem" |
675 |
|
676 |
emake || die "compile problem" |
677 |
} |
678 |
|
679 |
src_install () { |
680 |
/bin/sh postfix-install \ |
681 |
-non-interactive \ |
682 |
install_root="${D}" \ |
683 |
config_directory="/usr/share/doc/${PF}/defaults" \ |
684 |
readme_directory="/usr/share/doc/${PF}/readme" \ |
685 |
|| die "postfix-install failed" |
686 |
|
687 |
# Fix spool removal on upgrade. |
688 |
rm -rf "${D}/var" |
689 |
keepdir /var/spool/postfix |
690 |
|
691 |
# Install an rmail for UUCP, closing bug #19127. |
692 |
dobin auxiliary/rmail/rmail |
693 |
|
694 |
# mailwrapper stuff |
695 |
if use mailwrapper ; then |
696 |
mv "${D}/usr/sbin/sendmail" "${D}/usr/sbin/sendmail.postfix" |
697 |
mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.postfix" |
698 |
# mailer-config support |
699 |
#rm "${D}/usr/bin/mailq" "${D}/usr/bin/newaliases" |
700 |
|
701 |
mv "${D}/usr/share/man/man1/sendmail.1" \ |
702 |
"${D}/usr/share/man/man1/sendmail-postfix.1" |
703 |
mv "${D}/usr/share/man/man1/newaliases.1" \ |
704 |
"${D}/usr/share/man/man1/newaliases-postfix.1" |
705 |
mv "${D}/usr/share/man/man1/mailq.1" \ |
706 |
"${D}/usr/share/man/man1/mailq-postfix.1" |
707 |
mv "${D}/usr/share/man/man5/aliases.5" \ |
708 |
"${D}/usr/share/man/man5/aliases-postfix.5" |
709 |
|
710 |
# regular ebuild. |
711 |
insinto /etc/mail |
712 |
doins "${FILESDIR}/mailer.conf" |
713 |
# mailer-config support |
714 |
#mailer_install_conf |
715 |
else |
716 |
# Provide another link for legacy FSH. |
717 |
dosym /usr/sbin/sendmail /usr/lib/sendmail |
718 |
fi |
719 |
|
720 |
# Install qshape tool. |
721 |
dobin auxiliary/qshape/qshape.pl |
722 |
|
723 |
# performance tuning tools. |
724 |
dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink} |
725 |
doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1 |
726 |
|
727 |
# Set proper permissions on required files/directories. |
728 |
fowners root:postdrop /usr/sbin/post{drop,queue} |
729 |
fperms 02711 /usr/sbin/post{drop,queue} |
730 |
|
731 |
keepdir /etc/postfix |
732 |
mv ${D}/usr/share/doc/${PF}/defaults/{*.cf,post*-*} ${D}/etc/postfix |
733 |
if use mbox ; then |
734 |
mypostconf="mail_spool_directory=/var/spool/mail" |
735 |
else |
736 |
mypostconf="home_mailbox=.maildir/" |
737 |
fi |
738 |
"${D}/usr/sbin/postconf" -c "${D}/etc/postfix" -e \ |
739 |
${mypostconf} || die "postconf failed" |
740 |
|
741 |
insinto /etc/postfix |
742 |
newins "${FILESDIR}/smtp.pass" saslpass |
743 |
fperms 600 /etc/postfix/saslpass |
744 |
|
745 |
newinitd "${FILESDIR}/postfix.rc6.${RC_VER}" postfix || \ |
746 |
die "newinitd failed" |
747 |
|
748 |
mv "${S}/examples" "${D}/usr/share/doc/${PF}/" |
749 |
dodoc *README COMPATIBILITY HISTORY INSTALL PORTING RELEASE_NOTES* |
750 |
dohtml html/* |
751 |
|
752 |
pamd_mimic_system smtp auth account |
753 |
|
754 |
if use sasl ; then |
755 |
insinto /etc/sasl2 |
756 |
newins "${FILESDIR}/smtp.sasl" smtpd.conf |
757 |
fi |
758 |
} |
759 |
|
760 |
pkg_postinst() { |
761 |
# add postfix, postdrop user/group. Bug #77565. |
762 |
group_user_check || die "failed to check/add needed user/group" |
763 |
|
764 |
# Do not install server.{key,pem) SSL certificates if they already exist |
765 |
if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \ |
766 |
&& ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then |
767 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}" |
768 |
install_cert /etc/ssl/postfix/server |
769 |
chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem} |
770 |
fi |
771 |
|
772 |
ebegin "Fixing queue directories and permissions" |
773 |
"${ROOT}/etc/postfix/post-install" upgrade-permissions |
774 |
echo |
775 |
ewarn "If you upgraded from postfix-1.x, you must revisit" |
776 |
ewarn "your configuration files. See" |
777 |
ewarn " /usr/share/doc/${PF}/RELEASE_NOTES" |
778 |
ewarn "for a list of changes." |
779 |
|
780 |
if [ ! -e /etc/mail/aliases.db ] ; then |
781 |
echo |
782 |
ewarn "You must edit /etc/mail/aliases to suit your needs" |
783 |
ewarn "and then run /usr/bin/newaliases. Postfix will not" |
784 |
ewarn "work correctly without it." |
785 |
fi |
786 |
|
787 |
# regular ebuild |
788 |
if ! use mailwrapper && [[ -e /etc/mailer.conf ]] |
789 |
then |
790 |
einfo |
791 |
einfo "Since you emerged $PN without mailwrapper in USE," |
792 |
einfo "you probably want to 'emerge -C mailwrapper' now." |
793 |
einfo |
794 |
fi |
795 |
# mailer-config support |
796 |
#mailer_pkg_postinst |
797 |
} |
798 |
|
799 |
|
800 |
|
801 |
1.1 mail-mta/postfix/postfix-2.4.6-r2.ebuild |
802 |
|
803 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.4.6-r2.ebuild?rev=1.1&view=markup |
804 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.4.6-r2.ebuild?rev=1.1&content-type=text/plain |
805 |
|
806 |
Index: postfix-2.4.6-r2.ebuild |
807 |
=================================================================== |
808 |
# Copyright 1999-2008 Gentoo Foundation |
809 |
# Distributed under the terms of the GNU General Public License v2 |
810 |
# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-2.4.6-r2.ebuild,v 1.1 2008/02/03 11:43:08 ulm Exp $ |
811 |
|
812 |
# NOTE: this ebuild is a regular ebuild without mailer-config support! |
813 |
# Comment lines below "regular ebuild" and uncomment lines below "mailer-config support" |
814 |
# to turn this ebuild to a mailer-config enabled ebuild. |
815 |
|
816 |
# regular ebuild |
817 |
inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic pam |
818 |
# mailer-config support |
819 |
#inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic mailer pam |
820 |
|
821 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd" |
822 |
|
823 |
# regular ebuild |
824 |
IUSE="cdb dovecot-sasl hardened ipv6 ldap mailwrapper mbox mysql nis pam postgres sasl selinux ssl vda" |
825 |
# mailer-config support |
826 |
#IUSE="cdb dovecot-sasl hardened ipv6 ldap mbox mysql nis pam postgres sasl selinux ssl vda" |
827 |
|
828 |
MY_PV="${PV/_rc/-RC}" |
829 |
MY_SRC="${PN}-${MY_PV}" |
830 |
MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official" |
831 |
VDA_P="${P}-vda-ng-r2" |
832 |
RC_VER="2.2.9" |
833 |
|
834 |
DESCRIPTION="A fast and secure drop-in replacement for sendmail." |
835 |
HOMEPAGE="http://www.postfix.org/" |
836 |
SRC_URI="${MY_URI}/${MY_SRC}.tar.gz |
837 |
vda? ( http://gentoo.longitekk.com/${VDA_P}.patch.gz ) " |
838 |
|
839 |
LICENSE="IPL-1" |
840 |
SLOT="0" |
841 |
|
842 |
# regular ebuild |
843 |
PROVIDE="virtual/mta virtual/mda" |
844 |
# mailer-config support |
845 |
#PROVIDE="${PROVIDE} virtual/mda" |
846 |
|
847 |
DEPEND=">=sys-libs/db-3.2 |
848 |
>=dev-libs/libpcre-3.4 |
849 |
cdb? ( || ( >=dev-db/cdb-0.75-r1 >=dev-db/tinycdb-0.76 ) ) |
850 |
ldap? ( >=net-nds/openldap-1.2 ) |
851 |
mysql? ( virtual/mysql ) |
852 |
pam? ( virtual/pam ) |
853 |
postgres? ( >=dev-db/postgresql-7.1 ) |
854 |
sasl? ( >=dev-libs/cyrus-sasl-2 ) |
855 |
ssl? ( >=dev-libs/openssl-0.9.6g )" |
856 |
|
857 |
# regular ebuild |
858 |
RDEPEND="${DEPEND} |
859 |
>=net-mail/mailbase-0.00 |
860 |
!mailwrapper? ( !virtual/mta ) |
861 |
mailwrapper? ( >=net-mail/mailwrapper-0.2 ) |
862 |
selinux? ( sec-policy/selinux-postfix )" |
863 |
|
864 |
# mailer-config support |
865 |
#RDEPEND="${DEPEND} |
866 |
# >=net-mail/mailbase-0.00 |
867 |
# selinux? ( sec-policy/selinux-postfix )" |
868 |
|
869 |
S="${WORKDIR}/${MY_SRC}" |
870 |
|
871 |
group_user_check() { |
872 |
einfo "Checking for postfix group ..." |
873 |
enewgroup postfix 207 |
874 |
einfo "Checking for postdrop group ..." |
875 |
enewgroup postdrop 208 |
876 |
einfo "Checking for postfix user ..." |
877 |
enewuser postfix 207 -1 /var/spool/postfix postfix,mail |
878 |
} |
879 |
|
880 |
pkg_setup() { |
881 |
# Do not upgrade live from Postfix <2.4 |
882 |
if [[ -f /var/lib/init.d/started/postfix ]] ; then |
883 |
if has_version '<mail-mta/postfix-2.4.0' ; then |
884 |
if [[ "${FORCE_UPGRADE}" ]] ; then |
885 |
echo |
886 |
ewarn "You are upgrading from an incompatible version and you have" |
887 |
ewarn "FORCE_UPGRADE set, will build this package while Postfix is running." |
888 |
ewarn "You MUST stop Postfix BEFORE installing this version to your system." |
889 |
echo |
890 |
else |
891 |
echo |
892 |
eerror "You are upgrading from an incompatible version." |
893 |
eerror "You MUST stop Postfix BEFORE installing this version to your system." |
894 |
eerror "If you want minimal downtime, emerge postfix with:" |
895 |
eerror " FORCE_UPGRADE=1 emerge --buildpkgonly postfix" |
896 |
eerror " /etc/init.d/postfix stop" |
897 |
eerror " emerge --usepkgonly postfix" |
898 |
eerror "Then run etc-update or dispatch-conf and merge the configuration files." |
899 |
eerror "Then restart Postfix with: /etc/init.d/postfix start" |
900 |
die "Upgrade from an incompatible version!" |
901 |
echo |
902 |
fi |
903 |
else |
904 |
echo |
905 |
ewarn "It's safe to upgrade your current version while it's running." |
906 |
ewarn "If you don't want to take any chance, please hit Ctrl+C now," |
907 |
ewarn "stop Postfix, then emerge again." |
908 |
ewarn "You have been warned!" |
909 |
ewarn "Waiting 5 seconds before continuing ..." |
910 |
echo |
911 |
epause 5 |
912 |
fi |
913 |
fi |
914 |
|
915 |
echo |
916 |
ewarn "Read \"ftp://ftp.porcupine.org/mirrors/postfix-release/official/${MY_SRC}.RELEASE_NOTES\"" |
917 |
ewarn "for incompatible changes before continueing." |
918 |
ewarn "Bugs should be filed at \"http://bugs.gentoo.org/\" and" |
919 |
ewarn "assigned to \"net-mail@g.o\"." |
920 |
echo |
921 |
|
922 |
# Warnings to work around bug #45764 |
923 |
if has_version '<=mail-mta/postfix-2.0.18' ; then |
924 |
echo |
925 |
ewarn "You are upgrading from postfix-2.0.18 or earlier, some of the empty queue" |
926 |
ewarn "directories get deleted while unmerging the older version (see bug #45764)." |
927 |
ewarn "Please run '/etc/postfix/post-install upgrade-source' to recreate them." |
928 |
echo |
929 |
fi |
930 |
|
931 |
# TLS non-prod warning |
932 |
if use ssl ; then |
933 |
echo |
934 |
ewarn "You have \"ssl\" in your USE flags, TLS will be enabled." |
935 |
ewarn "This service is incompatible with the previous TLS patch." |
936 |
ewarn "Visit http://www.postfix.org/TLS_README.html for more info." |
937 |
echo |
938 |
fi |
939 |
|
940 |
# IPV6 non-prod warn |
941 |
if use ipv6 ; then |
942 |
echo |
943 |
ewarn "You have \"ipv6\" in your USE flags, IPV6 will be enabled." |
944 |
ewarn "Visit http://www.postfix.org/IPV6_README.html for more info." |
945 |
echo |
946 |
fi |
947 |
|
948 |
# SASL non-prod warning |
949 |
if use sasl ; then |
950 |
echo |
951 |
elog "Postfix 2.3 and newer supports two SASL implementations." |
952 |
elog "Cyrus SASL and Dovecot protocol version 1 (server only)" |
953 |
elog "Visit http://www.postfix.org/SASL_README.html for more info." |
954 |
echo |
955 |
fi |
956 |
|
957 |
# Add postfix, postdrop user/group (bug #77565) |
958 |
group_user_check || die "Failed to check/add needed user/group" |
959 |
} |
960 |
|
961 |
src_unpack() { |
962 |
unpack ${A} |
963 |
cd "${S}" |
964 |
|
965 |
if use vda ; then |
966 |
epatch "${WORKDIR}/${VDA_P}.patch" |
967 |
fi |
968 |
|
969 |
sed -i -e "/^#define ALIAS_DB_MAP/s|hash:/etc/aliases|hash:/etc/mail/aliases|" \ |
970 |
src/util/sys_defs.h || die "sed failed" |
971 |
|
972 |
# change default paths to better comply with portage standard paths |
973 |
sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed" |
974 |
} |
975 |
|
976 |
src_compile() { |
977 |
# Added -Wl,-z,now wrt bug #62674 |
978 |
# Remove -ldl as it is not necessary, solves bug #106446 |
979 |
# -Wl,-z,now replaced by $(bindnow-flags) |
980 |
# make sure LDFLAGS get passed down to the executables. |
981 |
local mycc="-DHAS_PCRE" mylibs="$(bindnow-flags) ${LDFLAGS} -lpcre -lcrypt -lpthread" |
982 |
|
983 |
use pam && mylibs="${mylibs} -lpam" |
984 |
|
985 |
if use ldap ; then |
986 |
mycc="${mycc} -DHAS_LDAP" |
987 |
mylibs="${mylibs} -lldap -llber" |
988 |
fi |
989 |
|
990 |
if use mysql ; then |
991 |
mycc="${mycc} -DHAS_MYSQL -I/usr/include/mysql" |
992 |
mylibs="${mylibs} -lmysqlclient -lm -lz" |
993 |
fi |
994 |
|
995 |
if use postgres ; then |
996 |
if best_version '=dev-db/postgresql-7.3*' ; then |
997 |
mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql" |
998 |
else |
999 |
mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql/pgsql" |
1000 |
fi |
1001 |
mylibs="${mylibs} -lpq" |
1002 |
fi |
1003 |
|
1004 |
if use ssl ; then |
1005 |
mycc="${mycc} -DUSE_TLS" |
1006 |
mylibs="${mylibs} -lssl -lcrypto" |
1007 |
fi |
1008 |
|
1009 |
if use sasl ; then |
1010 |
if use dovecot-sasl ; then |
1011 |
# Set dovecot as default. |
1012 |
mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\"" |
1013 |
fi |
1014 |
mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" |
1015 |
mylibs="${mylibs} -lsasl2" |
1016 |
elif use dovecot-sasl ; then |
1017 |
mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"" |
1018 |
fi |
1019 |
|
1020 |
if ! use nis ; then |
1021 |
sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \ |
1022 |
src/util/sys_defs.h || die "sed failed" |
1023 |
fi |
1024 |
|
1025 |
if use cdb ; then |
1026 |
mycc="${mycc} -DHAS_CDB" |
1027 |
CDB_LIBS="" |
1028 |
|
1029 |
# Tinycdb is preferred. |
1030 |
if has_version dev-db/tinycdb ; then |
1031 |
einfo "Building with dev-db/tinycdb" |
1032 |
CDB_LIBS="-lcdb" |
1033 |
else |
1034 |
einfo "Building with dev-db/cdb" |
1035 |
CDB_PATH="/usr/$(get_libdir)" |
1036 |
for i in cdb.a alloc.a buffer.a unix.a byte.a ; do |
1037 |
CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}" |
1038 |
done |
1039 |
fi |
1040 |
|
1041 |
mylibs="${mylibs} ${CDB_LIBS}" |
1042 |
fi |
1043 |
|
1044 |
mycc="${mycc} -DDEF_DAEMON_DIR=\\\"/usr/$(get_libdir)/postfix\\\"" |
1045 |
mycc="${mycc} -DDEF_MANPAGE_DIR=\\\"/usr/share/man\\\"" |
1046 |
mycc="${mycc} -DDEF_README_DIR=\\\"/usr/share/doc/${PF}/readme\\\"" |
1047 |
mycc="${mycc} -DDEF_HTML_DIR=\\\"/usr/share/doc/${PF}/html\\\"" |
1048 |
|
1049 |
# Robin H. Johnson <robbat2@g.o> 17/Nov/2006 |
1050 |
# Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check. |
1051 |
mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" |
1052 |
filter-lfs-flags |
1053 |
|
1054 |
local my_cc=$(tc-getCC) |
1055 |
einfo "CC=${my_cc:=gcc}" |
1056 |
|
1057 |
# Workaround for bug #76512 |
1058 |
[[ "$(gcc-version)" == "3.4" ]] && use hardened && replace-flags -O? -Os |
1059 |
|
1060 |
make DEBUG="" CC="${my_cc:=gcc}" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \ |
1061 |
makefiles || die "configure problem" |
1062 |
|
1063 |
emake || die "compile problem" |
1064 |
} |
1065 |
|
1066 |
src_install () { |
1067 |
/bin/sh postfix-install \ |
1068 |
-non-interactive \ |
1069 |
install_root="${D}" \ |
1070 |
config_directory="/usr/share/doc/${PF}/defaults" \ |
1071 |
readme_directory="/usr/share/doc/${PF}/readme" \ |
1072 |
|| die "postfix-install failed" |
1073 |
|
1074 |
# Fix spool removal on upgrade |
1075 |
rm -Rf "${D}/var" |
1076 |
keepdir /var/spool/postfix |
1077 |
|
1078 |
# Install rmail for UUCP, closes bug #19127 |
1079 |
dobin auxiliary/rmail/rmail |
1080 |
|
1081 |
# mailwrapper stuff |
1082 |
if use mailwrapper ; then |
1083 |
mv "${D}/usr/sbin/sendmail" "${D}/usr/sbin/sendmail.postfix" |
1084 |
mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.postfix" |
1085 |
# mailer-config support |
1086 |
#rm "${D}/usr/bin/mailq" "${D}/usr/bin/newaliases" |
1087 |
|
1088 |
mv "${D}/usr/share/man/man1/sendmail.1" \ |
1089 |
"${D}/usr/share/man/man1/sendmail-postfix.1" |
1090 |
mv "${D}/usr/share/man/man1/newaliases.1" \ |
1091 |
"${D}/usr/share/man/man1/newaliases-postfix.1" |
1092 |
mv "${D}/usr/share/man/man1/mailq.1" \ |
1093 |
"${D}/usr/share/man/man1/mailq-postfix.1" |
1094 |
mv "${D}/usr/share/man/man5/aliases.5" \ |
1095 |
"${D}/usr/share/man/man5/aliases-postfix.5" |
1096 |
|
1097 |
# regular ebuild |
1098 |
insinto /etc/mail |
1099 |
doins "${FILESDIR}/mailer.conf" |
1100 |
# mailer-config support |
1101 |
#mailer_install_conf |
1102 |
else |
1103 |
# Provide another link for legacy FSH |
1104 |
dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail |
1105 |
fi |
1106 |
|
1107 |
# Install qshape tool |
1108 |
dobin auxiliary/qshape/qshape.pl |
1109 |
|
1110 |
# Performance tuning tools and their manuals |
1111 |
dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink} |
1112 |
doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1 |
1113 |
|
1114 |
# Set proper permissions on required files/directories |
1115 |
fowners root:postdrop /usr/sbin/post{drop,queue} |
1116 |
fperms 02711 /usr/sbin/post{drop,queue} |
1117 |
|
1118 |
keepdir /etc/postfix |
1119 |
mv "${D}"/usr/share/doc/${PF}/defaults/{*.cf,post*-*} "${D}"/etc/postfix |
1120 |
if use mbox ; then |
1121 |
mypostconf="mail_spool_directory=/var/spool/mail" |
1122 |
else |
1123 |
mypostconf="home_mailbox=.maildir/" |
1124 |
fi |
1125 |
"${D}/usr/sbin/postconf" -c "${D}/etc/postfix" \ |
1126 |
-e ${mypostconf} || die "postconf failed" |
1127 |
|
1128 |
insinto /etc/postfix |
1129 |
newins "${FILESDIR}/smtp.pass" saslpass |
1130 |
fperms 600 /etc/postfix/saslpass |
1131 |
|
1132 |
newinitd "${FILESDIR}/postfix.rc6.${RC_VER}" postfix || die "newinitd failed" |
1133 |
|
1134 |
mv "${S}/examples" "${D}/usr/share/doc/${PF}/" |
1135 |
dodoc *README COMPATIBILITY HISTORY INSTALL PORTING RELEASE_NOTES* |
1136 |
dohtml html/* |
1137 |
|
1138 |
pamd_mimic_system smtp auth account |
1139 |
|
1140 |
if use sasl ; then |
1141 |
insinto /etc/sasl2 |
1142 |
newins "${FILESDIR}/smtp.sasl" smtpd.conf |
1143 |
fi |
1144 |
} |
1145 |
|
1146 |
pkg_postinst() { |
1147 |
# Add postfix, postdrop user/group (bug #77565) |
1148 |
group_user_check || die "Failed to check/add needed user/group" |
1149 |
|
1150 |
# Do not install server.{key,pem) SSL certificates if they already exist |
1151 |
if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \ |
1152 |
&& ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then |
1153 |
SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}" |
1154 |
install_cert /etc/ssl/postfix/server |
1155 |
chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem} |
1156 |
fi |
1157 |
|
1158 |
ebegin "Fixing queue directories and permissions" |
1159 |
"${ROOT}/etc/postfix/post-install" upgrade-permissions |
1160 |
echo |
1161 |
ewarn "If you upgraded from Postfix-1.x, you must revisit" |
1162 |
ewarn "your configuration files. See" |
1163 |
ewarn " /usr/share/doc/${PF}/RELEASE_NOTES" |
1164 |
ewarn "for a list of changes." |
1165 |
|
1166 |
if [[ ! -e /etc/mail/aliases.db ]] ; then |
1167 |
echo |
1168 |
ewarn "You must edit /etc/mail/aliases to suit your needs" |
1169 |
ewarn "and then run /usr/bin/newaliases. Postfix will not" |
1170 |
ewarn "work correctly without it." |
1171 |
fi |
1172 |
|
1173 |
# regular ebuild |
1174 |
if ! use mailwrapper && [[ -e /etc/mailer.conf ]] ; then |
1175 |
einfo |
1176 |
einfo "Since you emerged Postfix without mailwrapper in USE," |
1177 |
einfo "you may want to 'emerge -C mailwrapper' now." |
1178 |
einfo |
1179 |
fi |
1180 |
# mailer-config support |
1181 |
#mailer_pkg_postinst |
1182 |
} |
1183 |
|
1184 |
|
1185 |
|
1186 |
-- |
1187 |
gentoo-commits@l.g.o mailing list |