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