Gentoo Archives: gentoo-commits

From: "Eray Aslan (eras)" <eras@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-mta/postfix: postfix-2.10_pre20121123.ebuild ChangeLog postfix-2.10_pre20121031.ebuild
Date: Tue, 27 Nov 2012 19:59:48
Message-Id: 20121127195937.12C8720C63@flycatcher.gentoo.org
1 eras 12/11/27 19:59:36
2
3 Modified: ChangeLog
4 Added: postfix-2.10_pre20121123.ebuild
5 Removed: postfix-2.10_pre20121031.ebuild
6 Log:
7 Version bump
8
9 (Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key 0x77F1F175586A3B1F)
10
11 Revision Changes Path
12 1.400 mail-mta/postfix/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.400&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.400&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?r1=1.399&r2=1.400
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v
21 retrieving revision 1.399
22 retrieving revision 1.400
23 diff -u -r1.399 -r1.400
24 --- ChangeLog 6 Nov 2012 11:19:44 -0000 1.399
25 +++ ChangeLog 27 Nov 2012 19:59:36 -0000 1.400
26 @@ -1,6 +1,12 @@
27 # ChangeLog for mail-mta/postfix
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.399 2012/11/06 11:19:44 eras Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.400 2012/11/27 19:59:36 eras Exp $
31 +
32 +*postfix-2.10_pre20121123 (27 Nov 2012)
33 +
34 + 27 Nov 2012; Eray Aslan <eras@g.o> +postfix-2.10_pre20121123.ebuild,
35 + -postfix-2.10_pre20121031.ebuild:
36 + Version bump
37
38 06 Nov 2012; Eray Aslan <eras@g.o> postfix-2.10_pre20121031.ebuild,
39 postfix-2.8.12.ebuild, postfix-2.8.9.ebuild, postfix-2.9.4.ebuild:
40
41
42
43 1.1 mail-mta/postfix/postfix-2.10_pre20121123.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-2.10_pre20121123.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-2.10_pre20121123.ebuild?rev=1.1&content-type=text/plain
47
48 Index: postfix-2.10_pre20121123.ebuild
49 ===================================================================
50 # Copyright 1999-2012 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/postfix-2.10_pre20121123.ebuild,v 1.1 2012/11/27 19:59:36 eras Exp $
53
54 EAPI=4
55 inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic pam user versionator
56
57 MY_PV="${PV/_pre/-}"
58 MY_SRC="${PN}-${MY_PV}"
59 MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/experimental"
60 VDA_PV="2.9.1"
61 VDA_P="${PN}-vda-v11-${VDA_PV}"
62 RC_VER="2.7"
63
64 DESCRIPTION="A fast and secure drop-in replacement for sendmail."
65 HOMEPAGE="http://www.postfix.org/"
66 SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
67 vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch ) "
68
69 LICENSE="IBM"
70 SLOT="0"
71 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
72 IUSE="+berkdb cdb doc dovecot-sasl hardened ldap ldap-bind memcached mbox mysql nis pam postgres sasl selinux sqlite ssl vda"
73
74 DEPEND=">=dev-libs/libpcre-3.4
75 dev-lang/perl
76 berkdb? ( >=sys-libs/db-3.2 )
77 cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r1 ) )
78 ldap? ( net-nds/openldap )
79 ldap-bind? ( net-nds/openldap[sasl] )
80 mysql? ( virtual/mysql )
81 pam? ( virtual/pam )
82 postgres? ( dev-db/postgresql-base )
83 sasl? ( >=dev-libs/cyrus-sasl-2 )
84 sqlite? ( dev-db/sqlite:3 )
85 ssl? ( >=dev-libs/openssl-0.9.6g )"
86
87 RDEPEND="${DEPEND}
88 dovecot-sasl? ( net-mail/dovecot )
89 memcached? ( net-misc/memcached )
90 net-mail/mailbase
91 selinux? ( sec-policy/selinux-postfix )
92 !mail-mta/courier
93 !mail-mta/esmtp
94 !mail-mta/exim
95 !mail-mta/mini-qmail
96 !mail-mta/msmtp[mta]
97 !mail-mta/netqmail
98 !mail-mta/nullmailer
99 !mail-mta/qmail-ldap
100 !mail-mta/sendmail
101 !<mail-mta/ssmtp-2.64-r2
102 !>=mail-mta/ssmtp-2.64-r2[mta]
103 !net-mail/fastforward"
104
105 REQUIRED_USE="ldap-bind? ( ldap sasl )"
106
107 S="${WORKDIR}/${MY_SRC}"
108
109 pkg_setup() {
110 # Add postfix, postdrop user/group (bug #77565)
111 enewgroup postfix 207
112 enewgroup postdrop 208
113 enewuser postfix 207 -1 /var/spool/postfix postfix,mail
114 }
115
116 src_prepare() {
117 if use vda; then
118 epatch "${DISTDIR}"/${VDA_P}.patch
119 fi
120
121 if ! use berkdb; then
122 epatch "${FILESDIR}/${PN}_no-berkdb.patch"
123 fi
124
125 sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
126 src/util/sys_defs.h || die "sed failed"
127
128 # change default paths to better comply with portage standard paths
129 sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
130 }
131
132 src_configure() {
133 # Make sure LDFLAGS get passed down to the executables.
134 local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread"
135
136 use pam && mylibs="${mylibs} -lpam"
137
138 if use ldap; then
139 mycc="${mycc} -DHAS_LDAP"
140 mylibs="${mylibs} -lldap -llber"
141 fi
142
143 if use mysql; then
144 mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
145 mylibs="${mylibs} $(mysql_config --libs)"
146 fi
147
148 if use postgres; then
149 mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
150 mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
151 fi
152
153 if use sqlite; then
154 mycc="${mycc} -DHAS_SQLITE"
155 mylibs="${mylibs} -lsqlite3"
156 fi
157
158 if use ssl; then
159 mycc="${mycc} -DUSE_TLS"
160 mylibs="${mylibs} -lssl -lcrypto"
161 fi
162
163 # broken. and "in other words, not supported" by upstream.
164 # Use inet_protocols setting in main.cf
165 #if ! use ipv6; then
166 # mycc="${mycc} -DNO_IPV6"
167 #fi
168
169 if use sasl; then
170 if use dovecot-sasl; then
171 # Set dovecot as default.
172 mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
173 fi
174 if use ldap-bind; then
175 mycc="${mycc} -DUSE_LDAP_SASL"
176 fi
177 mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
178 mylibs="${mylibs} -lsasl2"
179 elif use dovecot-sasl; then
180 mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
181 fi
182
183 if ! use nis; then
184 sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
185 src/util/sys_defs.h || die "sed failed"
186 fi
187
188 if ! use berkdb; then
189 mycc="${mycc} -DNO_DB"
190 if use cdb; then
191 # change default hash format from Berkeley DB to cdb
192 sed -i -e "s/hash/cdb/" src/util/sys_defs.h || die
193 fi
194 fi
195
196 if use cdb; then
197 mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
198 CDB_LIBS=""
199 # Tinycdb is preferred.
200 if has_version dev-db/tinycdb ; then
201 einfo "Building with dev-db/tinycdb"
202 CDB_LIBS="-lcdb"
203 else
204 einfo "Building with dev-db/cdb"
205 CDB_PATH="/usr/$(get_libdir)"
206 for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
207 CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}"
208 done
209 fi
210 mylibs="${mylibs} ${CDB_LIBS}"
211 fi
212
213 # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
214 # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
215 mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
216 filter-lfs-flags
217
218 # Workaround for bug #76512
219 if use hardened; then
220 [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
221 fi
222
223 # Remove annoying C++ comment style warnings - bug #378099
224 append-flags -Wno-comment
225
226 sed -i -e "/^RANLIB/s/ranlib/$(tc-getRANLIB)/g" "${S}"/makedefs
227 sed -i -e "/^AR/s/ar/$(tc-getAR)/g" "${S}"/makedefs
228 emake DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" makefiles
229 }
230
231 src_install () {
232 local myconf
233 use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
234 html_directory=\"/usr/share/doc/${PF}/html\""
235
236 /bin/sh postfix-install \
237 -non-interactive \
238 install_root="${D}" \
239 config_directory="/etc/postfix" \
240 manpage_directory="/usr/share/man" \
241 command_directory="/usr/sbin" \
242 mailq_path="/usr/bin/mailq" \
243 newaliases_path="/usr/bin/newaliases" \
244 sendmail_path="/usr/sbin/sendmail" \
245 ${myconf} \
246 || die "postfix-install failed"
247
248 # Fix spool removal on upgrade
249 rm -Rf "${D}"/var
250 keepdir /var/spool/postfix
251
252 # Install rmail for UUCP, closes bug #19127
253 dobin auxiliary/rmail/rmail
254
255 # Provide another link for legacy FSH
256 dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
257
258 # Install qshape tool
259 dobin auxiliary/qshape/qshape.pl
260 doman man/man1/qshape.1
261
262 # Performance tuning tools and their manuals
263 dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
264 doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
265
266 # Set proper permissions on required files/directories
267 dodir /var/lib/postfix
268 keepdir /var/lib/postfix
269 fowners -R postfix:postfix /var/lib/postfix
270 fperms 0750 /var/lib/postfix
271 fowners root:postdrop /usr/sbin/post{drop,queue}
272 fperms 02711 /usr/sbin/post{drop,queue}
273
274 keepdir /etc/postfix
275 if use mbox; then
276 mypostconf="mail_spool_directory=/var/spool/mail"
277 else
278 mypostconf="home_mailbox=.maildir/"
279 fi
280 "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
281 -e ${mypostconf} || die "postconf failed"
282
283 insinto /etc/postfix
284 newins "${FILESDIR}"/smtp.pass saslpass
285 fperms 600 /etc/postfix/saslpass
286
287 newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
288 # do not start mysql/postgres unnecessarily - bug #359913
289 use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
290 use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
291
292 dodoc *README COMPATIBILITY HISTORY PORTING RELEASE_NOTES*
293 mv "${D}"/etc/postfix/{*.default,makedefs.out} "${D}"/usr/share/doc/${PF}/
294 use doc && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
295
296 pamd_mimic_system smtp auth account
297
298 if use sasl; then
299 insinto /etc/sasl2
300 newins "${FILESDIR}"/smtp.sasl smtpd.conf
301 fi
302
303 # header files
304 insinto /usr/include/postfix
305 doins include/*.h
306
307 # Remove unnecessary files
308 rm -f "${D}"/etc/postfix/{*LICENSE,access,aliases,canonical,generic}
309 rm -f "${D}"/etc/postfix/{header_checks,relocated,transport,virtual}
310 }
311
312 pkg_preinst() {
313 # Postfix 2.9.
314 # default for inet_protocols changed from ipv4 to all in postfix-2.9.
315 # check inet_protocols setting in main.cf and modify if necessary to prevent
316 # performance loss with useless DNS lookups and useless connection attempts.
317 [[ -d ${ROOT}/etc/postfix ]] && {
318 if [[ "$(${D}/usr/sbin/postconf -dh inet_protocols)" != "ipv4" ]]; then
319 if [[ ! -n "$(${D}/usr/sbin/postconf -c ${ROOT}/etc/postfix -n inet_protocols)" ]];
320 then
321 ewarn "\nCOMPATIBILITY: adding inet_protocols=ipv4 to main.cf."
322 ewarn "That will keep the same behaviour as previous postfix versions."
323 ewarn "Specify inet_protocols explicitly if you want to enable IPv6.\n"
324 else
325 # delete inet_protocols setting. there is already one in /etc/postfix
326 sed -i -e /inet_protocols/d "${D}"/etc/postfix/main.cf || die
327 fi
328 fi
329 }
330
331 # Postfix 2.10.
332 # Safety net for incompatible changes due to the introduction
333 # of the smtpd_relay_restrictions feature to separate the
334 # mail relay policy from the spam blocking policy.
335 [[ -d ${ROOT}/etc/postfix ]] && {
336 if [[ ! -n "$(${D}/usr/sbin/postconf -c ${ROOT}/etc/postfix -n smtpd_relay_restrictions)" ]];
337 then
338 local myconf="smtpd_relay_restrictions=permit_mynetworks,permit_sasl_authenticated,defer_unauth_destination"
339 ewarn "\nCOMPATIBILITY: adding smtpd_relay_restrictions to main.cf"
340 ewarn "to prevent inbound mail from unexpectedly bouncing."
341 ewarn "Specify an empty smtpd_relay_restrictions value to keep using"
342 ewarn "smtpd_recipient_restrictions as before.\n"
343 "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix -e ${myconf} || die
344 fi
345 }
346 }
347
348 pkg_postinst() {
349 # Do not install server.{key,pem) SSL certificates if they already exist
350 if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
351 && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
352 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
353 install_cert /etc/ssl/postfix/server
354 chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
355 fi
356
357 if [[ ! -e /etc/mail/aliases.db ]] ; then
358 ewarn
359 ewarn "You must edit /etc/mail/aliases to suit your needs"
360 ewarn "and then run /usr/bin/newaliases. Postfix will not"
361 ewarn "work correctly without it."
362 ewarn
363 fi
364
365 if [[ $(get_version_component_range 2 ${REPLACING_VERSIONS}) -lt 9 ]]; then
366 elog "If you are using old style postfix instances by symlinking"
367 elog "startup scripts in ${ROOT}etc/init.d, please consider"
368 elog "upgrading your config for postmulti support. For more info:"
369 elog "http://www.postfix.org/MULTI_INSTANCE_README.html"
370 if ! use berkdb; then
371 ewarn "\nPostfix is installed without BerkeleyDB support."
372 ewarn "Please turn on berkdb USE flag if you need hash or"
373 ewarn "btree table lookups.\n"
374 fi
375 ewarn "Postfix daemons now live under /usr/libexec/postfix"
376 ewarn "Please adjust your main.cf accordingly by running"
377 ewarn "etc-update/dispatch-conf or similar and accepting the new"
378 ewarn "daemon_directory setting."
379 fi
380 }