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