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.8.2-r1.ebuild ChangeLog
Date: Sat, 07 May 2011 15:33:39
Message-Id: 20110507153327.D762120054@flycatcher.gentoo.org
1 eras 11/05/07 15:33:27
2
3 Modified: ChangeLog
4 Added: postfix-2.8.2-r1.ebuild
5 Log:
6 Enable binding to ldap - bug #361865. Do not start databases when not linked
7 against them - bug #359913. Prefer tinycdb over cdb.
8
9 (Portage version: 2.1.9.47/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.251 mail-mta/postfix/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.251&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?rev=1.251&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/ChangeLog?r1=1.250&r2=1.251
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v
21 retrieving revision 1.250
22 retrieving revision 1.251
23 diff -u -r1.250 -r1.251
24 --- ChangeLog 22 Apr 2011 16:11:53 -0000 1.250
25 +++ ChangeLog 7 May 2011 15:33:27 -0000 1.251
26 @@ -1,6 +1,12 @@
27 # ChangeLog for mail-mta/postfix
28 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.250 2011/04/22 16:11:53 flameeyes Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/ChangeLog,v 1.251 2011/05/07 15:33:27 eras Exp $
31 +
32 +*postfix-2.8.2-r1 (07 May 2011)
33 +
34 + 07 May 2011; Eray Aslan <eras@g.o> +postfix-2.8.2-r1.ebuild:
35 + Enable binding to ldap - bug #361865. Do not start databases when not linked
36 + against them - bug #359913. Prefer tinycdb over cdb
37
38 22 Apr 2011; Diego E. Pettenò <flameeyes@g.o>
39 postfix-2.7.3-r1.ebuild, postfix-2.8.1-r1.ebuild, postfix-2.8.2.ebuild:
40
41
42
43 1.1 mail-mta/postfix/postfix-2.8.2-r1.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-2.8.2-r1.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-mta/postfix/postfix-2.8.2-r1.ebuild?rev=1.1&content-type=text/plain
47
48 Index: postfix-2.8.2-r1.ebuild
49 ===================================================================
50 # Copyright 1999-2011 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.8.2-r1.ebuild,v 1.1 2011/05/07 15:33:27 eras Exp $
53
54 EAPI=4
55
56 inherit eutils multilib ssl-cert toolchain-funcs flag-o-matic pam
57
58 MY_PV="${PV/_rc/-RC}"
59 MY_SRC="${PN}-${MY_PV}"
60 MY_URI="ftp://ftp.porcupine.org/mirrors/postfix-release/official"
61 VDA_PV="2.8.1"
62 VDA_P="${PN}-vda-v10-${VDA_PV}"
63 RC_VER="2.5"
64
65 DESCRIPTION="A fast and secure drop-in replacement for sendmail."
66 HOMEPAGE="http://www.postfix.org/"
67 SRC_URI="${MY_URI}/${MY_SRC}.tar.gz
68 vda? ( http://vda.sourceforge.net/VDA/${VDA_P}.patch ) "
69
70 LICENSE="IBM"
71 SLOT="0"
72 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
73 IUSE="cdb doc dovecot-sasl examples hardened ipv6 ldap mbox mysql nis pam postgres sasl selinux sqlite ssl vda"
74
75 DEPEND=">=sys-libs/db-3.2
76 >=dev-libs/libpcre-3.4
77 cdb? ( || ( >=dev-db/tinycdb-0.76 >=dev-db/cdb-0.75-r1 ) )
78 ldap? ( >=net-nds/openldap-1.2 )
79 mysql? ( virtual/mysql )
80 pam? ( virtual/pam )
81 postgres? ( dev-db/postgresql-base )
82 sasl? ( >=dev-libs/cyrus-sasl-2 )
83 sqlite? ( dev-db/sqlite:3 )
84 ssl? ( >=dev-libs/openssl-0.9.6g )"
85
86 RDEPEND="${DEPEND}
87 net-mail/mailbase
88 !net-mail/mailwrapper
89 selinux? ( sec-policy/selinux-postfix )
90 !mail-mta/courier
91 !mail-mta/esmtp
92 !mail-mta/exim
93 !mail-mta/mini-qmail
94 !mail-mta/msmtp
95 !mail-mta/nbsmtp
96 !mail-mta/netqmail
97 !mail-mta/nullmailer
98 !mail-mta/qmail-ldap
99 !mail-mta/sendmail
100 !<mail-mta/ssmtp-2.64-r2
101 !>=mail-mta/ssmtp-2.64-r2[mta]"
102
103 S="${WORKDIR}/${MY_SRC}"
104
105 group_user_check() {
106 einfo "Checking for postfix group ..."
107 enewgroup postfix 207
108 einfo "Checking for postdrop group ..."
109 enewgroup postdrop 208
110 einfo "Checking for postfix user ..."
111 enewuser postfix 207 -1 /var/spool/postfix postfix,mail
112 }
113
114 pkg_setup() {
115 # Add postfix, postdrop user/group (bug #77565)
116 group_user_check || die "Failed to check/add needed user/group"
117 }
118
119 src_prepare() {
120 if use vda ; then
121 epatch "${DISTDIR}"/${VDA_P}.patch
122 fi
123
124 sed -i -e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/mail/aliases|" \
125 src/util/sys_defs.h || die "sed failed"
126
127 # change default paths to better comply with portage standard paths
128 sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || die "sed failed"
129 }
130
131 src_configure() {
132 # Make sure LDFLAGS get passed down to the executables.
133 local mycc="-DHAS_PCRE" mylibs="${LDFLAGS} -lpcre -lcrypt -lpthread"
134
135 use pam && mylibs="${mylibs} -lpam"
136
137 if use ldap ; then
138 mycc="${mycc} -DHAS_LDAP"
139 mylibs="${mylibs} -lldap -llber"
140 fi
141
142 if use mysql ; then
143 mycc="${mycc} -DHAS_MYSQL $(mysql_config --include)"
144 mylibs="${mylibs} $(mysql_config --libs)"
145 fi
146
147 if use postgres ; then
148 mycc="${mycc} -DHAS_PGSQL -I$(pg_config --includedir)"
149 mylibs="${mylibs} -lpq -L$(pg_config --libdir)"
150 fi
151
152 if use sqlite ; then
153 mycc="${mycc} -DHAS_SQLITE"
154 mylibs="${mylibs} -lsqlite3"
155 fi
156
157 if use ssl ; then
158 mycc="${mycc} -DUSE_TLS"
159 mylibs="${mylibs} -lssl -lcrypto"
160 fi
161
162 if use sasl ; then
163 if use dovecot-sasl ; then
164 # Set dovecot as default.
165 mycc="${mycc} -DDEF_SASL_SERVER=\\\"dovecot\\\""
166 fi
167 if use ldap ; then
168 mycc="${mycc} -DUSE_LDAP_SASL"
169 fi
170 mycc="${mycc} -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
171 mylibs="${mylibs} -lsasl2"
172 elif use dovecot-sasl ; then
173 mycc="${mycc} -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
174 fi
175
176 if ! use nis ; then
177 sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
178 src/util/sys_defs.h || die "sed failed"
179 fi
180
181 if use cdb ; then
182 mycc="${mycc} -DHAS_CDB -I/usr/include/cdb"
183 CDB_LIBS=""
184
185 # Tinycdb is preferred.
186 if has_version dev-db/tinycdb ; then
187 einfo "Building with dev-db/tinycdb"
188 CDB_LIBS="-lcdb"
189 else
190 einfo "Building with dev-db/cdb"
191 CDB_PATH="/usr/$(get_libdir)"
192 for i in cdb.a alloc.a buffer.a unix.a byte.a ; do
193 CDB_LIBS="${CDB_LIBS} ${CDB_PATH}/${i}"
194 done
195 fi
196
197 mylibs="${mylibs} ${CDB_LIBS}"
198 fi
199
200 mycc="${mycc} -DDEF_DAEMON_DIR=\\\"/usr/$(get_libdir)/postfix\\\""
201
202 # Robin H. Johnson <robbat2@g.o> 17/Nov/2006
203 # Fix because infra boxes hit 2Gb .db files that fail a 32-bit fstat signed check.
204 mycc="${mycc} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"
205 filter-lfs-flags
206
207 # Workaround for bug #76512
208 if use hardened ; then
209 [[ "$(gcc-version)" == "3.4" ]] && replace-flags -O? -Os
210 fi
211
212 emake DEBUG="" CC="$(tc-getCC)" OPT="${CFLAGS}" CCARGS="${mycc}" AUXLIBS="${mylibs}" makefiles
213 }
214
215 src_install () {
216 local myconf
217 use doc && myconf="readme_directory=\"/usr/share/doc/${PF}/readme\" \
218 html_directory=\"/usr/share/doc/${PF}/html\""
219
220 /bin/sh postfix-install \
221 -non-interactive \
222 install_root="${D}" \
223 config_directory="/usr/share/doc/${PF}/defaults" \
224 manpage_directory="/usr/share/man" \
225 ${myconf} \
226 || die "postfix-install failed"
227
228 # Fix spool removal on upgrade
229 rm -Rf "${D}"/var
230 keepdir /var/spool/postfix
231
232 # Install rmail for UUCP, closes bug #19127
233 dobin auxiliary/rmail/rmail
234
235 # Provide another link for legacy FSH
236 dosym /usr/sbin/sendmail /usr/$(get_libdir)/sendmail
237
238 # Install qshape tool
239 dobin auxiliary/qshape/qshape.pl
240 doman man/man1/qshape.1
241
242 # Performance tuning tools and their manuals
243 dosbin bin/smtp-{source,sink} bin/qmqp-{source,sink}
244 doman man/man1/smtp-{source,sink}.1 man/man1/qmqp-{source,sink}.1
245
246 # Set proper permissions on required files/directories
247 dodir /var/lib/postfix
248 keepdir /var/lib/postfix
249 fowners postfix:postfix /var/lib/postfix
250 fowners postfix:postfix /var/lib/postfix/.keep_${CATEGORY}_${PN}-${SLOT}
251 fperms 0750 /var/lib/postfix
252 fowners root:postdrop /usr/sbin/post{drop,queue}
253 fperms 02711 /usr/sbin/post{drop,queue}
254
255 keepdir /etc/postfix
256 mv "${D}"/usr/share/doc/${PF}/defaults/*.cf "${D}"/etc/postfix
257 if use mbox ; then
258 mypostconf="mail_spool_directory=/var/spool/mail"
259 else
260 mypostconf="home_mailbox=.maildir/"
261 fi
262 "${D}"/usr/sbin/postconf -c "${D}"/etc/postfix \
263 -e ${mypostconf} || die "postconf failed"
264
265 insinto /etc/postfix
266 newins "${FILESDIR}"/smtp.pass saslpass
267 fperms 600 /etc/postfix/saslpass
268
269 newinitd "${FILESDIR}"/postfix.rc6.${RC_VER} postfix
270 # bug #359913
271 use mysql || sed -i -e "s/mysql //" "${D}/etc/init.d/postfix"
272 use postgres || sed -i -e "s/postgresql //" "${D}/etc/init.d/postfix"
273
274 use examples && mv "${S}"/examples "${D}"/usr/share/doc/${PF}/
275
276 dodoc *README COMPATIBILITY HISTORY INSTALL PORTING RELEASE_NOTES*
277
278 pamd_mimic_system smtp auth account
279
280 if use sasl ; then
281 insinto /etc/sasl2
282 newins "${FILESDIR}"/smtp.sasl smtpd.conf
283 fi
284
285 # Remove unnecessary files
286 rm -f "${D}"/usr/$(get_libdir)/postfix/*.cf
287 }
288
289 pkg_postinst() {
290 # Do not install server.{key,pem) SSL certificates if they already exist
291 if use ssl && [[ ! -f "${ROOT}"/etc/ssl/postfix/server.key \
292 && ! -f "${ROOT}"/etc/ssl/postfix/server.pem ]] ; then
293 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Postfix SMTP Server}"
294 install_cert /etc/ssl/postfix/server
295 chown postfix:mail "${ROOT}"/etc/ssl/postfix/server.{key,pem}
296 fi
297
298 ebegin "Fixing queue directories and permissions"
299 "${ROOT}"/usr/$(get_libdir)/postfix/post-install upgrade-permissions \
300 daemon_directory="${ROOT}/usr/$(get_libdir)/postfix"
301
302 if [[ ! -e /etc/mail/aliases.db ]] ; then
303 ewarn
304 ewarn "You must edit /etc/mail/aliases to suit your needs"
305 ewarn "and then run /usr/bin/newaliases. Postfix will not"
306 ewarn "work correctly without it."
307 ewarn
308 fi
309
310 elog
311 elog "See the RELEASE_NOTES file in /usr/share/doc/${PF}"
312 elog "for incompatibilities and other major changes between releases."
313 elog
314 }