Gentoo Archives: gentoo-commits

From: "Tobias Scherbaum (dertobi123)" <dertobi123@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-mta/postfix: ChangeLog postfix-2.4.9.ebuild postfix-2.5.5.ebuild postfix-2.5.4.ebuild postfix-2.3.8-r1.ebuild postfix-2.2.11-r1.ebuild postfix-2.4.8.ebuild
Date: Tue, 02 Sep 2008 14:02:17
Message-Id: E1KaWST-0000UV-3X@stork.gentoo.org
1 dertobi123 08/09/02 14:02:13
2
3 Modified: ChangeLog
4 Added: postfix-2.4.9.ebuild postfix-2.5.5.ebuild
5 Removed: postfix-2.5.4.ebuild postfix-2.3.8-r1.ebuild
6 postfix-2.2.11-r1.ebuild postfix-2.4.8.ebuild
7 Log:
8 Version bump, security bug #236453
9 (Portage version: 2.2_rc8/cvs/Linux 2.6.25-gentoo-r7 x86_64)
10
11 Revision Changes Path
12 1.171 mail-mta/postfix/ChangeLog
13
14 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.171&view=markup
15 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.171&content-type=text/plain
16 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/ChangeLog?r1=1.170&r2=1.171
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v
21 retrieving revision 1.170
22 retrieving revision 1.171
23 diff -u -r1.170 -r1.171
24 --- ChangeLog 30 Aug 2008 11:52:42 -0000 1.170
25 +++ ChangeLog 2 Sep 2008 14:02:12 -0000 1.171
26 @@ -1,6 +1,15 @@
27 # ChangeLog for mail-mta/postfix
28 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.170 2008/08/30 11:52:42 dertobi123 Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.171 2008/09/02 14:02:12 dertobi123 Exp $
31 +
32 +*postfix-2.5.5 (02 Sep 2008)
33 +*postfix-2.4.9 (02 Sep 2008)
34 +
35 + 02 Sep 2008; Tobias Scherbaum <dertobi123@g.o>
36 + -postfix-2.2.11-r1.ebuild, -postfix-2.3.8-r1.ebuild,
37 + -postfix-2.4.8.ebuild, +postfix-2.4.9.ebuild, -postfix-2.5.4.ebuild,
38 + +postfix-2.5.5.ebuild:
39 + Version bump, security bug #236453
40
41 30 Aug 2008; Tobias Scherbaum <dertobi123@g.o>
42 postfix-2.5.4.ebuild:
43
44
45
46 1.1 mail-mta/postfix/postfix-2.4.9.ebuild
47
48 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.4.9.ebuild?rev=1.1&view=markup
49 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.4.9.ebuild?rev=1.1&content-type=text/plain
50
51 Index: postfix-2.4.9.ebuild
52 ===================================================================
53 # Copyright 1999-2008 Gentoo Foundation
54 # Distributed under the terms of the GNU General Public License v2
55 # $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-2.4.9.ebuild,v 1.1 2008/09/02 14:02:12 dertobi123 Exp $
56
57 # NOTE: this ebuild is a regular ebuild without mailer-config support!
58 # Comment lines below "regular ebuild" and uncomment lines below "mailer-config support"
59 # to turn this ebuild to a mailer-config enabled ebuild.
60
61 # regular ebuild
62 inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic pam
63 # mailer-config support
64 #inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic mailer pam
65
66 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
67
68 # regular ebuild
69 IUSE="cdb dovecot-sasl hardened ipv6 ldap mailwrapper mbox mysql nis pam postgres sasl selinux ssl vda"
70 # mailer-config support
71 #IUSE="cdb dovecot-sasl hardened ipv6 ldap mbox mysql nis pam postgres sasl selinux ssl vda"
72
73 MY_PV="${PV/_rc/-RC}"
74 MY_SRC="${PN}-${MY_PV}"
75 MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
76 VDA_P="${PN}-2.4.6-vda-ng-r2"
77 RC_VER="2.5"
78
79 DESCRIPTION="A fast and secure drop-in replacement for sendmail."
80 HOMEPAGE="http://www.postfix.org/"
81 SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
82 vda? ( http://gentoo.longitekk.com/${VDA_P}.patch.gz ) "
83
84 LICENSE="IPL-1"
85 SLOT="0"
86
87 # regular ebuild
88 PROVIDE="virtual/mta virtual/mda"
89 # mailer-config support
90 #PROVIDE="${PROVIDE} virtual/mda"
91
92 DEPEND=">=sys-libs/db-3.2
93 >=dev-libs/libpcre-3.4
94 cdb? ( || ( >=dev-db/cdb-0.75-r1 >=dev-db/tinycdb-0.76 ) )
95 ldap? ( >=net-nds/openldap-1.2 )
96 mysql? ( virtual/mysql )
97 pam? ( virtual/pam )
98 postgres? ( virtual/postgresql-base )
99 sasl? ( >=dev-libs/cyrus-sasl-2 )
100 ssl? ( >=dev-libs/openssl-0.9.6g )"
101
102 # regular ebuild
103 RDEPEND="${DEPEND}
104 >=net-mail/mailbase-0.00
105 !mailwrapper? ( !virtual/mta )
106 mailwrapper? ( >=net-mail/mailwrapper-0.2 )
107 selinux? ( sec-policy/selinux-postfix )"
108
109 # mailer-config support
110 #RDEPEND="${DEPEND}
111 # >=net-mail/mailbase-0.00
112 # selinux? ( sec-policy/selinux-postfix )"
113
114 S="${WORKDIR}/${MY_SRC}"
115
116 group_user_check() {
117 einfo "Checking for postfix group ..."
118 enewgroup postfix 207
119 einfo "Checking for postdrop group ..."
120 enewgroup postdrop 208
121 einfo "Checking for postfix user ..."
122 enewuser postfix 207 -1 /var/spool/postfix postfix,mail
123 }
124
125 pkg_setup() {
126 # Do not upgrade live from Postfix <2.4
127 if [[ -f /var/lib/init.d/started/postfix ]] ; then
128 if has_version '<mail-mta/postfix-2.4.0' ; then
129 if [[ "${FORCE_UPGRADE}" ]] ; then
130 echo
131 ewarn "You are upgrading from an incompatible version and you have"
132 ewarn "FORCE_UPGRADE set, will build this package while Postfix is running."
133 ewarn "You MUST stop Postfix BEFORE installing this version to your system."
134 echo
135 else
136 echo
137 eerror "You are upgrading from an incompatible version."
138 eerror "You MUST stop Postfix BEFORE installing this version to your system."
139 eerror "If you want minimal downtime, emerge postfix with:"
140 eerror " FORCE_UPGRADE=1 emerge --buildpkgonly postfix"
141 eerror " /etc/init.d/postfix stop"
142 eerror " emerge --usepkgonly postfix"
143 eerror "Then run etc-update or dispatch-conf and merge the configuration files."
144 eerror "Then restart Postfix with: /etc/init.d/postfix start"
145 die "Upgrade from an incompatible version!"
146 echo
147 fi
148 else
149 echo
150 ewarn "It's safe to upgrade your current version while it's running."
151 ewarn "If you don't want to take any chance, please hit Ctrl+C now,"
152 ewarn "stop Postfix, then emerge again."
153 ewarn "You have been warned!"
154 ewarn "Waiting 5 seconds before continuing ..."
155 echo
156 epause 5
157 fi
158 fi
159
160 echo
161 ewarn "Read \"ftp://ftp.porcupine.org/mirrors/postfix-release/official/${MY_SRC}.RELEASE_NOTES\""
162 ewarn "for incompatible changes before continueing."
163 ewarn "Bugs should be filed at \"http://bugs.gentoo.org/\" and"
164 ewarn "assigned to \"net-mail@g.o\"."
165 echo
166
167 # Warnings to work around bug #45764
168 if has_version '<=mail-mta/postfix-2.0.18' ; then
169 echo
170 ewarn "You are upgrading from postfix-2.0.18 or earlier, some of the empty queue"
171 ewarn "directories get deleted while unmerging the older version (see bug #45764)."
172 ewarn "Please run '/etc/postfix/post-install upgrade-source' to recreate them."
173 echo
174 fi
175
176 # TLS non-prod warning
177 if use ssl ; then
178 echo
179 ewarn "You have \"ssl\" in your USE flags, TLS will be enabled."
180 ewarn "This service is incompatible with the previous TLS patch."
181 ewarn "Visit http://www.postfix.org/TLS_README.html for more info."
182 echo
183 fi
184
185 # IPV6 non-prod warn
186 if use ipv6 ; then
187 echo
188 ewarn "You have \"ipv6\" in your USE flags, IPV6 will be enabled."
189 ewarn "Visit http://www.postfix.org/IPV6_README.html for more info."
190 echo
191 fi
192
193 # SASL non-prod warning
194 if use sasl ; then
195 echo
196 elog "Postfix 2.3 and newer supports two SASL implementations."
197 elog "Cyrus SASL and Dovecot protocol version 1 (server only)"
198 elog "Visit http://www.postfix.org/SASL_README.html for more info."
199 echo
200 fi
201
202 # Add postfix, postdrop user/group (bug #77565)
203 group_user_check || die "Failed to check/add needed user/group"
204 }
205
206 src_unpack() {
207 unpack ${A}
208 cd "${S}"
209
210 if use vda ; then
211 epatch "${WORKDIR}/${VDA_P}.patch"
212 fi
213
214 sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
215 src/util/sys_defs.h || die "sed failed"
216
217 # change default paths to better comply with portage standard paths
218 sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
219 }
220
221 src_compile() {
222 # 1) Added -Wl,-z,now wrt bug #62674
223 # 2) Remove -ldl as it is not necessary, solves bug #106446
224 # 3) -Wl,-z,now replaced by $(bindnow-flags)
225 # 4) Then bindnow-flags has been simply dropped according to
226 # http://www.mail-archive.com/gentoo-dev@l.g.o/msg23679.html
227 # 5) Make sure LDFLAGS get passed down to the executables.
228 local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread"
229
230 use pam && mylibs="${mylibs} -lpam"
231
232 if use ldap ; then
233 mycc="${mycc} -DHAS_LDAP"
234 mylibs="${mylibs} -lldap -llber"
235 fi
236
237 if use mysql ; then
238 mycc="${mycc} -DHAS_MYSQL -I/usr/include/mysql"
239 mylibs="${mylibs} -lmysqlclient -lm -lz"
240 fi
241
242 if use postgres ; then
243 if best_version '=virtual/postgresql-base-7.3*' ; then
244 mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql"
245 else
246 mycc="${mycc} -DHAS_PGSQL -I/usr/include/postgresql/pgsql"
247 fi
248 mylibs="${mylibs} -lpq"
249 fi
250
251 if use ssl ; then
252 mycc="${mycc} -DUSE_TLS"
253 mylibs="${mylibs} -lssl -lcrypto"
254 fi
255
256 if use sasl ; then
257 if use dovecot-sasl ; then
258 # Set dovecot as default.
259 mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
260 fi
261 mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
262 mylibs="${mylibs} -lsasl2"
263 elif use dovecot-sasl ; then
264 mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
265 fi
266
267 if ! use nis ; then
268 sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
269 src/util/sys_defs.h || die "sed failed"
270 fi
271
272 if use cdb ; then
273 mycc="${mycc} -DHAS_CDB"
274 CDB_LIBS=""
275
276 # Tinycdb is preferred.
277 if has_version dev-db/tinycdb ; then
278 einfo "Building with dev-db/tinycdb"
279 CDB_LIBS="-lcdb"
280 else
281 einfo "Building with dev-db/cdb"
282 CDB_PATH="/usr/$(get_libdir)"
283 for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
284 CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}"
285 done
286 fi
287
288 mylibs="${mylibs} ${CDB_LIBS}"
289 fi
290
291 mycc="${mycc} -DDEF_DAEMON_DIR=\\\"/usr/$(get_libdir)/postfix\\\""
292 mycc="${mycc} -DDEF_MANPAGE_DIR=\\\"/usr/share/man\\\""
293 mycc="${mycc} -DDEF_README_DIR=\\\"/usr/share/doc/${PF}/readme\\\""
294 mycc="${mycc} -DDEF_HTML_DIR=\\\"/usr/share/doc/${PF}/html\\\""
295
296 # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
297 # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
298 mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
299 filter-lfs-flags
300
301 local my_cc=$(tc-getCC)
302 einfo "CC=${my_cc:=gcc}"
303
304 # Workaround for bug #76512
305 [[ "$(gcc-version)" == "3.4" ]] && use hardened && replace-flags -O? -Os
306
307 make DEBUG="" CC="${my_cc:=gcc}" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
308 makefiles || die "configure problem"
309
310 emake || die "compile problem"
311 }
312
313 src_install () {
314 /bin/sh postfix-install \
315 -non-interactive \
316 install_root="${D}" \
317 config_directory="/usr/share/doc/${PF}/defaults" \
318 readme_directory="/usr/share/doc/${PF}/readme" \
319 || die "postfix-install failed"
320
321 # Fix spool removal on upgrade
322 rm -Rf "${D}/var"
323 keepdir /var/spool/postfix
324
325 # Install rmail for UUCP, closes bug #19127
326 dobin auxiliary/rmail/rmail
327
328 # mailwrapper stuff
329 if use mailwrapper ; then
330 mv "${D}/usr/sbin/sendmail" "${D}/usr/sbin/sendmail.postfix"
331 mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.postfix"
332 # mailer-config support
333 #rm "${D}/usr/bin/mailq" "${D}/usr/bin/newaliases"
334
335 mv "${D}/usr/share/man/man1/sendmail.1" \
336 "${D}/usr/share/man/man1/sendmail-postfix.1"
337 mv "${D}/usr/share/man/man1/newaliases.1" \
338 "${D}/usr/share/man/man1/newaliases-postfix.1"
339 mv "${D}/usr/share/man/man1/mailq.1" \
340 "${D}/usr/share/man/man1/mailq-postfix.1"
341 mv "${D}/usr/share/man/man5/aliases.5" \
342 "${D}/usr/share/man/man5/aliases-postfix.5"
343
344 # regular ebuild
345 insinto /etc/mail
346 doins "${FILESDIR}/mailer.conf"
347 # mailer-config support
348 #mailer_install_conf
349 else
350 # Provide another link for legacy FSH
351 dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
352 fi
353
354 # Install qshape tool
355 dobin auxiliary/qshape/qshape.pl
356
357 # Performance tuning tools and their manuals
358 dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
359 doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
360
361 # Set proper permissions on required files/directories
362 fowners root:postdrop /usr/sbin/post{drop,queue}
363 fperms 02711 /usr/sbin/post{drop,queue}
364
365 keepdir /etc/postfix
366 mv "${D}"/usr/share/doc/${PF}/defaults/{*.cf,post*-*} "${D}"/etc/postfix
367 if use mbox ; then
368 mypostconf="mail_spool_directory=/var/spool/mail"
369 else
370 mypostconf="home_mailbox=.maildir/"
371 fi
372 "${D}/usr/sbin/postconf" -c "${D}/etc/postfix" \
373 -e ${mypostconf} || die "postconf failed"
374
375 insinto /etc/postfix
376 newins "${FILESDIR}/smtp.pass" saslpass
377 fperms 600 /etc/postfix/saslpass
378
379 newinitd "${FILESDIR}/postfix.rc6.${RC_VER}" postfix || die "newinitd failed"
380
381 mv "${S}/examples" "${D}/usr/share/doc/${PF}/"
382 dodoc *README COMPATIBILITY HISTORY INSTALL PORTING RELEASE_NOTES*
383 dohtml html/*
384
385 pamd_mimic_system smtp auth account
386
387 if use sasl ; then
388 insinto /etc/sasl2
389 newins "${FILESDIR}/smtp.sasl" smtpd.conf
390 fi
391 }
392
393 pkg_postinst() {
394 # Add postfix, postdrop user/group (bug #77565)
395 group_user_check || die "Failed to check/add needed user/group"
396
397 # Do not install server.{key,pem) SSL certificates if they already exist
398 if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
399 && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
400 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
401 install_cert /etc/ssl/postfix/server
402 chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
403 fi
404
405 ebegin "Fixing queue directories and permissions"
406 "${ROOT}/etc/postfix/post-install" upgrade-permissions
407 echo
408 ewarn "If you upgraded from Postfix-1.x, you must revisit"
409 ewarn "your configuration files. See"
410 ewarn " /usr/share/doc/${PF}/RELEASE_NOTES"
411 ewarn "for a list of changes."
412
413 if [[ ! -e /etc/mail/aliases.db ]] ; then
414 echo
415 ewarn "You must edit /etc/mail/aliases to suit your needs"
416 ewarn "and then run /usr/bin/newaliases. Postfix will not"
417 ewarn "work correctly without it."
418 fi
419
420 # regular ebuild
421 if ! use mailwrapper && [[ -e /etc/mailer.conf ]] ; then
422 einfo
423 einfo "Since you emerged Postfix without mailwrapper in USE,"
424 einfo "you may want to 'emerge -C mailwrapper' now."
425 einfo
426 fi
427 # mailer-config support
428 #mailer_pkg_postinst
429 }
430
431
432
433 1.1 mail-mta/postfix/postfix-2.5.5.ebuild
434
435 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.5.5.ebuild?rev=1.1&view=markup
436 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/postfix/postfix-2.5.5.ebuild?rev=1.1&content-type=text/plain
437
438 Index: postfix-2.5.5.ebuild
439 ===================================================================
440 # Copyright 1999-2008 Gentoo Foundation
441 # Distributed under the terms of the GNU General Public License v2
442 # $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-2.5.5.ebuild,v 1.1 2008/09/02 14:02:12 dertobi123 Exp $
443
444 # NOTE: this ebuild is a regular ebuild without mailer-config support!
445 # Comment lines below "regular ebuild" and uncomment lines below "mailer-config support"
446 # to turn this ebuild to a mailer-config enabled ebuild.
447
448 # regular ebuild
449 inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic pam
450 # mailer-config support
451 #inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic mailer pam
452
453 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
454
455 # regular ebuild
456 IUSE="cdb dovecot-sasl hardened ipv6 ldap mailwrapper mbox mysql nis pam postgres sasl selinux ssl vda"
457 # mailer-config support
458 #IUSE="cdb dovecot-sasl hardened ipv6 ldap mbox mysql nis pam postgres sasl selinux ssl vda"
459
460 MY_PV="${PV/_rc/-RC}"
461 MY_SRC="${PN}-${MY_PV}"
462 MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
463 VDA_PV="2.5.3"
464 VDA_P="${PN}-${VDA_PV}-vda-ng"
465 RC_VER="2.5"
466
467 DESCRIPTION="A fast and secure drop-in replacement for sendmail."
468 HOMEPAGE="http://www.postfix.org/"
469 SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
470 vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch.gz ) "
471
472 LICENSE="IPL-1"
473 SLOT="0"
474
475 # regular ebuild
476 PROVIDE="virtual/mta virtual/mda"
477 # mailer-config support
478 #PROVIDE="${PROVIDE} virtual/mda"
479
480 DEPEND=">=sys-libs/db-3.2
481 >=dev-libs/libpcre-3.4
482 cdb? ( || ( >=dev-db/cdb-0.75-r1 >=dev-db/tinycdb-0.76 ) )
483 ldap? ( >=net-nds/openldap-1.2 )
484 mysql? ( virtual/mysql )
485 pam? ( virtual/pam )
486 postgres? ( virtual/postgresql-base )
487 sasl? ( >=dev-libs/cyrus-sasl-2 )
488 ssl? ( >=dev-libs/openssl-0.9.6g )"
489
490 # regular ebuild
491 RDEPEND="${DEPEND}
492 >=net-mail/mailbase-0.00
493 !mailwrapper? (
494 !virtual/mta
495 !net-mail/mailwrapper
496 )
497 mailwrapper? ( >=net-mail/mailwrapper-0.2 )
498 selinux? ( sec-policy/selinux-postfix )"
499
500 # mailer-config support
501 #RDEPEND="${DEPEND}
502 # >=net-mail/mailbase-0.00
503 # selinux? ( sec-policy/selinux-postfix )"
504
505 S="${WORKDIR}/${MY_SRC}"
506
507 group_user_check() {
508 einfo "Checking for postfix group ..."
509 enewgroup postfix 207
510 einfo "Checking for postdrop group ..."
511 enewgroup postdrop 208
512 einfo "Checking for postfix user ..."
513 enewuser postfix 207 -1 /var/spool/postfix postfix,mail
514 }
515
516 pkg_setup() {
517 # Do not upgrade live from Postfix <2.5
518 if [[ -f /var/lib/init.d/started/postfix ]] ; then
519 if has_version '<mail-mta/postfix-2.5.0' ; then
520 if [[ "${FORCE_UPGRADE}" ]] ; then
521 echo
522 ewarn "You are upgrading from an incompatible version and you have"
523 ewarn "FORCE_UPGRADE set, will build this package while Postfix is running."
524 ewarn "You MUST stop Postfix BEFORE installing this version to your system."
525 echo
526 else
527 echo
528 eerror "You are upgrading from an incompatible version."
529 eerror "You MUST stop Postfix BEFORE installing this version to your system."
530 eerror "If you want minimal downtime, emerge postfix with:"
531 eerror " FORCE_UPGRADE=1 emerge --buildpkgonly postfix"
532 eerror " /etc/init.d/postfix stop"
533 eerror " emerge --usepkgonly postfix"
534 eerror "Then run etc-update or dispatch-conf and merge the configuration files."
535 eerror "Then restart Postfix with: /etc/init.d/postfix start"
536 die "Upgrade from an incompatible version!"
537 echo
538 fi
539 else
540 echo
541 ewarn "It's safe to upgrade your current version while it's running."
542 ewarn "If you don't want to take any chance, please hit Ctrl+C now,"
543 ewarn "stop Postfix, then emerge again."
544 ewarn "You have been warned!"
545 ewarn "Waiting 5 seconds before continuing ..."
546 echo
547 epause 5
548 fi
549 fi
550
551 echo
552 ewarn "Read \"ftp://ftp.porcupine.org/mirrors/postfix-release/official/${MY_SRC}.RELEASE_NOTES\""
553 ewarn "for incompatible changes before continueing."
554 ewarn "Bugs should be filed at \"http://bugs.gentoo.org/\" and"
555 ewarn "assigned to \"net-mail@g.o\"."
556 echo
557
558 # Warnings to work around bug #45764
559 if has_version '<=mail-mta/postfix-2.0.18' ; then
560 echo
561 ewarn "You are upgrading from postfix-2.0.18 or earlier, some of the empty queue"
562 ewarn "directories get deleted while unmerging the older version (see bug #45764)."
563 ewarn "Please run '/etc/postfix/post-install upgrade-source' to recreate them."
564 echo
565 fi
566
567 # TLS non-prod warning
568 if use ssl ; then
569 echo
570 ewarn "You have \"ssl\" in your USE flags, TLS will be enabled."
571 ewarn "This service is incompatible with the previous TLS patch."
572 ewarn "Visit http://www.postfix.org/TLS_README.html for more info."
573 echo
574 fi
575
576 # IPV6 non-prod warn
577 if use ipv6 ; then
578 echo
579 ewarn "You have \"ipv6\" in your USE flags, IPV6 will be enabled."
580 ewarn "Visit http://www.postfix.org/IPV6_README.html for more info."
581 echo
582 fi
583
584 # SASL non-prod warning
585 if use sasl ; then
586 echo
587 elog "Postfix 2.3 and newer supports two SASL implementations."
588 elog "Cyrus SASL and Dovecot protocol version 1 (server only)"
589 elog "Visit http://www.postfix.org/SASL_README.html for more info."
590 echo
591 fi
592
593 # Add postfix, postdrop user/group (bug #77565)
594 group_user_check || die "Failed to check/add needed user/group"
595 }
596
597 src_unpack() {
598 unpack ${A}
599
600 cd "${S}"
601 if use vda ; then
602 epatch "${WORKDIR}/${VDA_P}.patch"
603 fi
604
605 sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
606 src/util/sys_defs.h || die "sed failed"
607
608 # change default paths to better comply with portage standard paths
609 sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
610 }
611
612 src_compile() {
613 # 1) Added -Wl,-z,now wrt bug #62674
614 # 2) Remove -ldl as it is not necessary, solves bug #106446
615 # 3) -Wl,-z,now replaced by $(bindnow-flags)
616 # 4) Then bindnow-flags has been simply dropped according to
617 # http://www.mail-archive.com/gentoo-dev@l.g.o/msg23679.html
618 # 5) Make sure LDFLAGS get passed down to the executables.
619 local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread"
620
621 use pam && mylibs="${mylibs} -lpam"
622
623 if use ldap ; then
624 mycc="${mycc} -DHAS_LDAP"
625 mylibs="${mylibs} -lldap -llber"
626 fi
627
628 if use mysql ; then
629 mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
630 mylibs="${mylibs} -lmysqlclient -lm -lz"
631 fi
632
633 if use postgres ; then
634 mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
635 mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
636 fi
637
638 if use ssl ; then
639 mycc="${mycc} -DUSE_TLS"
640 mylibs="${mylibs} -lssl -lcrypto"
641 fi
642
643 if use sasl ; then
644 if use dovecot-sasl ; then
645 # Set dovecot as default.
646 mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
647 fi
648 mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
649 mylibs="${mylibs} -lsasl2"
650 elif use dovecot-sasl ; then
651 mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
652 fi
653
654 if ! use nis ; then
655 sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
656 src/util/sys_defs.h || die "sed failed"
657 fi
658
659 if use cdb ; then
660 mycc="${mycc} -DHAS_CDB"
661 CDB_LIBS=""
662
663 # Tinycdb is preferred.
664 if has_version dev-db/tinycdb ; then
665 einfo "Building with dev-db/tinycdb"
666 CDB_LIBS="-lcdb"
667 else
668 einfo "Building with dev-db/cdb"
669 CDB_PATH="/usr/$(get_libdir)"
670 for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
671 CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}"
672 done
673 fi
674
675 mylibs="${mylibs} ${CDB_LIBS}"
676 fi
677
678 mycc="${mycc} -DDEF_DAEMON_DIR=\\\"/usr/$(get_libdir)/postfix\\\""
679 mycc="${mycc} -DDEF_MANPAGE_DIR=\\\"/usr/share/man\\\""
680 mycc="${mycc} -DDEF_README_DIR=\\\"/usr/share/doc/${PF}/readme\\\""
681 mycc="${mycc} -DDEF_HTML_DIR=\\\"/usr/share/doc/${PF}/html\\\""
682
683 # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
684 # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
685 mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
686 filter-lfs-flags
687
688 local my_cc=$(tc-getCC)
689 einfo "CC=${my_cc:=gcc}"
690
691 # Workaround for bug #76512
692 [[ "$(gcc-version)" == "3.4" ]] && use hardened && replace-flags -O? -Os
693
694 make DEBUG="" CC="${my_cc:=gcc}" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" \
695 makefiles || die "configure problem"
696
697 emake || die "compile problem"
698 }
699
700 src_install () {
701 /bin/sh postfix-install \
702 -non-interactive \
703 install_root="${D}" \
704 config_directory="/usr/share/doc/${PF}/defaults" \
705 readme_directory="/usr/share/doc/${PF}/readme" \
706 || die "postfix-install failed"
707
708 # Fix spool removal on upgrade
709 rm -Rf "${D}/var"
710 keepdir /var/spool/postfix
711
712 # Install rmail for UUCP, closes bug #19127
713 dobin auxiliary/rmail/rmail
714
715 # mailwrapper stuff
716 if use mailwrapper ; then
717 mv "${D}/usr/sbin/sendmail" "${D}/usr/sbin/sendmail.postfix"
718 mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.postfix"
719 # mailer-config support
720 #rm "${D}/usr/bin/mailq" "${D}/usr/bin/newaliases"
721
722 mv "${D}/usr/share/man/man1/sendmail.1" \
723 "${D}/usr/share/man/man1/sendmail-postfix.1"
724 mv "${D}/usr/share/man/man1/newaliases.1" \
725 "${D}/usr/share/man/man1/newaliases-postfix.1"
726 mv "${D}/usr/share/man/man1/mailq.1" \
727 "${D}/usr/share/man/man1/mailq-postfix.1"
728 mv "${D}/usr/share/man/man5/aliases.5" \
729 "${D}/usr/share/man/man5/aliases-postfix.5"
730
731 # regular ebuild
732 insinto /etc/mail
733 doins "${FILESDIR}/mailer.conf"
734 # mailer-config support
735 #mailer_install_conf
736 else
737 # Provide another link for legacy FSH
738 dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
739 fi
740
741 # Install qshape tool
742 dobin auxiliary/qshape/qshape.pl
743 doman man/man1/qshape.1
744
745 # Performance tuning tools and their manuals
746 dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
747 doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
748
749 # Set proper permissions on required files/directories
750 dodir /var/lib/postfix
751 keepdir /var/lib/postfix
752 fowners postfix:postfix /var/lib/postfix
753 fowners postfix:postfix /var/lib/postfix/.keep_${CATEGORY}_${PN}-${SLOT}
754 fperms 0750 /var/lib/postfix
755 fowners root:postdrop /usr/sbin/post{drop,queue}
756 fperms 02711 /usr/sbin/post{drop,queue}
757
758 keepdir /etc/postfix
759 mv "${D}"/usr/share/doc/${PF}/defaults/{*.cf,post*-*} "${D}"/etc/postfix
760 if use mbox ; then
761 mypostconf="mail_spool_directory=/var/spool/mail"
762 else
763 mypostconf="home_mailbox=.maildir/"
764 fi
765 "${D}/usr/sbin/postconf" -c "${D}/etc/postfix" \
766 -e ${mypostconf} || die "postconf failed"
767
768 insinto /etc/postfix
769 newins "${FILESDIR}/smtp.pass" saslpass
770 fperms 600 /etc/postfix/saslpass
771
772 newinitd "${FILESDIR}/postfix.rc6.${RC_VER}" postfix || die "newinitd failed"
773
774 mv "${S}/examples" "${D}/usr/share/doc/${PF}/"
775 dodoc *README COMPATIBILITY HISTORY INSTALL PORTING RELEASE_NOTES*
776 dohtml html/*
777
778 pamd_mimic_system smtp auth account
779
780 if use sasl ; then
781 insinto /etc/sasl2
782 newins "${FILESDIR}/smtp.sasl" smtpd.conf
783 fi
784 }
785
786 pkg_postinst() {
787 # Add postfix, postdrop user/group (bug #77565)
788 group_user_check || die "Failed to check/add needed user/group"
789
790 # Do not install server.{key,pem) SSL certificates if they already exist
791 if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
792 && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
793 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
794 install_cert /etc/ssl/postfix/server
795 chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
796 fi
797
798 ebegin "Fixing queue directories and permissions"
799 "${ROOT}/etc/postfix/post-install" upgrade-permissions
800 echo
801 ewarn "If you upgraded from Postfix-1.x, you must revisit"
802 ewarn "your configuration files. See"
803 ewarn " /usr/share/doc/${PF}/RELEASE_NOTES"
804 ewarn "for a list of changes."
805
806 if [[ ! -e /etc/mail/aliases.db ]] ; then
807 echo
808 ewarn "You must edit /etc/mail/aliases to suit your needs"
809 ewarn "and then run /usr/bin/newaliases. Postfix will not"
810 ewarn "work correctly without it."
811 fi
812
813 # regular ebuild
814 if ! use mailwrapper && [[ -e /etc/mailer.conf ]] ; then
815 einfo
816 einfo "Since you emerged Postfix without mailwrapper in USE,"
817 einfo "you may want to 'emerge -C mailwrapper' now."
818 einfo
819 fi
820 # mailer-config support
821 #mailer_pkg_postinst
822 }