Gentoo Archives: gentoo-commits

From: "Hanno Boeck (hanno)" <hanno@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in mail-mta/courier: ChangeLog courier-0.61.2.ebuild
Date: Mon, 04 May 2009 13:33:51
Message-Id: E1M0yIl-0003w8-Kp@stork.gentoo.org
1 hanno 09/05/04 13:33:47
2
3 Modified: ChangeLog
4 Added: courier-0.61.2.ebuild
5 Log:
6 courier bump
7 (Portage version: 2.2_rc33/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.116 mail-mta/courier/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/courier/ChangeLog?rev=1.116&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/courier/ChangeLog?rev=1.116&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/courier/ChangeLog?r1=1.115&r2=1.116
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/mail-mta/courier/ChangeLog,v
19 retrieving revision 1.115
20 retrieving revision 1.116
21 diff -u -r1.115 -r1.116
22 --- ChangeLog 22 Feb 2009 19:27:14 -0000 1.115
23 +++ ChangeLog 4 May 2009 13:33:47 -0000 1.116
24 @@ -1,6 +1,11 @@
25 # ChangeLog for mail-mta/courier
26 -# Copyright 2002-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/ChangeLog,v 1.115 2009/02/22 19:27:14 hanno Exp $
28 +# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
29 +# $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/ChangeLog,v 1.116 2009/05/04 13:33:47 hanno Exp $
30 +
31 +*courier-0.61.2 (04 May 2009)
32 +
33 + 04 May 2009; Hanno Boeck <hanno@g.o> +courier-0.61.2.ebuild:
34 + Version bump.
35
36 *courier-0.61.1 (22 Feb 2009)
37
38
39
40
41 1.1 mail-mta/courier/courier-0.61.2.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/courier/courier-0.61.2.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/mail-mta/courier/courier-0.61.2.ebuild?rev=1.1&content-type=text/plain
45
46 Index: courier-0.61.2.ebuild
47 ===================================================================
48 # Copyright 1999-2009 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/mail-mta/courier/courier-0.61.2.ebuild,v 1.1 2009/05/04 13:33:47 hanno Exp $
51
52 inherit eutils flag-o-matic
53
54 DESCRIPTION="An MTA designed specifically for maildirs"
55 SRC_URI="mirror://sourceforge/courier/${P}.tar.bz2"
56 HOMEPAGE="http://www.courier-mta.org/"
57 S="${WORKDIR}/${P}"
58
59 SLOT="0"
60 LICENSE="GPL-2"
61 # not in keywords due to missing dependencies: ~arm ~s390 ~ppc64 ~mips
62 KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~sparc ~x86"
63 IUSE="postgres ldap mysql pam nls ipv6 spell fax crypt norewrite mailwrapper \
64 fam web webmail"
65
66 PROVIDE="virtual/mta
67 virtual/mda
68 virtual/imapd"
69
70 DEPEND="
71 >=net-libs/courier-authlib-0.61.0
72 >=dev-libs/openssl-0.9.6
73 >=sys-libs/gdbm-1.8.0
74 dev-libs/libpcre
75 app-misc/mime-types
76 fax? ( >=media-libs/netpbm-9.12 virtual/ghostscript >=net-dialup/mgetty-1.1.28 )
77 pam? ( virtual/pam )
78 mysql? ( virtual/mysql )
79 ldap? ( >=net-nds/openldap-1.2.11 )
80 postgres? ( virtual/postgresql-base )
81 spell? ( virtual/aspell-dict )
82 fam? ( virtual/fam )
83 !mailwrapper? ( !virtual/mta )
84 !virtual/imapd
85 !mail-filter/maildrop"
86
87 RDEPEND="${DEPEND}
88 dev-lang/perl
89 sys-process/procps"
90
91 PDEPEND="mailwrapper? ( >=net-mail/mailwrapper-0.2 )
92 pam? ( net-mail/mailbase )
93 crypt? ( >=app-crypt/gnupg-1.0.4 )"
94
95 filter-flags '-fomit-frame-pointer'
96
97 src_unpack() {
98 use fam || (
99 ewarn "File Alteration Monitor (FAM) is disabled"
100 ewarn "courier-imap will fall back to 60 second polls."
101 ewarn 'add "fam" to your USE flags to build as usual'
102 ebeep 4
103 epause 4 )
104 unpack ${A}
105 cd "${S}"
106 use norewrite && epatch "${FILESDIR}/norewrite.patch"
107
108 }
109
110 src_compile() {
111 local myconf
112 myconf="`use_with ipv6` \
113 `use_with ldap ldapaliasd` `use_enable ldap maildropldap`"
114
115 use ldap && myconf="${myconf} --with-ldapconfig=/etc/courier/maildropldap.conf"
116 use spell || myconf="${myconf} --without-ispell"
117
118 myconf="${myconf} --enable-mimetypes=/etc/mime.types"
119
120 myconf="${myconf} $(use_with fam)"
121
122 einfo "Configuring courier: $(echo ${myconf} | xargs echo)"
123
124 econf \
125 --prefix=/usr \
126 --disable-root-check \
127 --mandir=/usr/share/man \
128 --sysconfdir=/etc/courier \
129 --libexecdir=/usr/$(get_libdir)/courier \
130 --datadir=/usr/share/courier \
131 --sharedstatedir=/var/lib/courier/com \
132 --localstatedir=/var/lib/courier \
133 --with-piddir=/var/run/courier \
134 --with-authdaemonvar=/var/lib/courier/authdaemon \
135 --with-mailuser=mail \
136 --with-mailgroup=mail \
137 --with-paranoid-smtpext \
138 --with-db=gdbm \
139 --disable-autorenamesent \
140 --cache-file="${S}/configuring.cache" \
141 --host="${CHOST}" ${myconf} debug=true || die "./configure"
142 sed -e'/^install-perms-local:/a\ sed -e\"s|^|'"${D}"'|g\" -i permissions.dat' -i Makefile
143 emake || die "Compile problem"
144 }
145
146 etc_courier() {
147 # Import existing /etc/courier/file if it exists.
148 # Add option only if it was not already set or even commented out
149 file="${1}" ; word="`echo \"${2}\" | sed -e\"s|=.*$||\" -e\"s|^.*opt ||\"`"
150 [ ! -e "${D}/etc/courier/${file}" ] && [ -e "/etc/courier/${file}" ] && \
151 cp "/etc/courier/${file}" "${D}/etc/courier/${file}"
152 grep -q "${word}" "${D}/etc/courier/${file}" || \
153 echo "${2}" >> "${D}/etc/courier/${file}"
154 }
155
156 etc_courier_chg() {
157 file="${1}" ; key="${2}" ; value="${3}" ; section="${4}"
158 [ -z "${section}" ] && section="${2}"
159 grep -q "${key}" "${file}" && elog "Changing ${file}: ${key} to ${value}"
160 sed -i -e"/\#\#NAME: ${section}/,+30 s|${key}=.*|${key}=\"${value}\"|g" ${file}
161 }
162
163 src_install() {
164 local f
165 diropts -o mail -g mail
166 keepdir /var/run/courier
167 keepdir /var/lib/courier/tmp
168 keepdir /var/lib/courier/msgs
169 make install DESTDIR="${D}" || die "install"
170 make install-configure || die "install-configure"
171
172 # Get rid of files we dont want
173 if ! use webmail ; then
174 cd "${D}"
175 cat "${FILESDIR}/webmail_files" | xargs rm -rf
176 fi
177
178 if ! use web ; then
179 cd "${D}"
180 cat "${FILESDIR}/webadmin_files" | xargs rm -rf
181 fi
182
183 for dir2keep in $(cd "${D}" && find ./var/lib/courier -type d) ; do
184 keepdir "$dir2keep" || die "failed running keepdir: $dir2keep"
185 done
186
187 newinitd "${FILESDIR}/courier-init-r2" "courier"
188 use fam || sed -i -e's|^.*use famd$||g' "${D}/etc/init.d/courier"
189
190 cd "${D}/etc/courier"
191 if use webmail ; then
192 insinto /etc/courier
193 newins "${FILESDIR}/apache-sqwebmail.inc" apache-sqwebmail.inc
194 fi
195
196 for f in *.dist ; do cp "${f}" "${f%%.dist}" ; done
197 if use ldap ; then
198 [ -e ldapaliasrc ] && ( chown root:0 ldapaliasrc ; chmod 400 ldapaliasrc )
199 else
200 rm -f ldapaliasrc
201 fi
202
203 ( [ -e /etc/courier/sizelimit ] && cat /etc/courier/sizelimit || echo 0 ) \
204 > "${D}/etc/courier/sizelimit"
205 etc_courier maildroprc ""
206 etc_courier esmtproutes ""
207 etc_courier backuprelay ""
208 etc_courier locallowercase ""
209 etc_courier bofh "opt BOFHBADMIME=accept"
210 etc_courier bofh "opt BOFHSPFTRUSTME=1"
211 etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none,error,softfail,fail"
212 etc_courier bofh "opt BOFHSPFHELO=pass,neutral,unknown,none"
213 etc_courier bofh "opt BOFHSPFFROM=all"
214 etc_courier bofh "opt BOFHSPFMAILFROM=all"
215 etc_courier bofh "#opt BOFHSPFHARDERROR=fail"
216 etc_courier esmtpd "BOFHBADMIME=accept"
217 etc_courier esmtpd-ssl "BOFHBADMIME=accept"
218 etc_courier esmtpd-msa "BOFHBADMIME=accept"
219
220 use fam && etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256 IDLE"
221 use fam || etc_courier_chg imapd IMAP_CAPABILITY "IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA AUTH=CRAM-MD5 AUTH=CRAM-SHA1 AUTH=CRAM-SHA256"
222
223 # Fix for a sandbox violation on subsequential merges
224 # - ticho@g.o, 2005-07-10
225 rm "${D}"/usr/sbin/{pop3d,imapd}{,-ssl}
226 dosym /usr/share/courier/pop3d /usr/sbin/courier-pop3d
227 dosym /usr/share/courier/pop3d-ssl /usr/sbin/courier-pop3d-ssl
228 dosym /usr/share/courier/imapd /usr/sbin/courier-imapd
229 dosym /usr/share/courier/imapd-ssl /usr/sbin/courier-imapd-ssl
230
231 cd "${S}"
232 cp imap/README README.imap
233 use nls && cp unicode/README README.unicode
234 dodoc AUTHORS BENCHMARKS COPYING* ChangeLog* INSTALL NEWS README* TODO courier/doc/*.txt
235 dodoc tcpd/README.couriertls
236 mv "${D}/usr/share/courier/htmldoc" "${D}/usr/share/doc/${P}/html"
237
238 if use webmail ; then
239 insinto /usr/$(get_libdir)/courier/courier
240 insopts -m 755 -o mail -g mail
241 doins "${S}/courier/webmaild"
242 fi
243
244 if use web ; then
245 insinto /etc/courier/webadmin
246 insopts -m 400 -o mail -g mail
247 doins "${FILESDIR}/password.dist"
248 fi
249
250 # avoid name collisions in /usr/sbin, make webadmin match
251 cd "${D}/usr/sbin"
252 for f in imapd imapd-ssl pop3d pop3d-ssl ; do mv "${f}" "courier-${f}" ; done
253 if use web ; then
254 sed -i -e 's:\$sbindir\/imapd:\$sbindir\/courier-imapd:g' \
255 -e 's:\$sbindir\/imapd-ssl:\$sbindir\/courier-imapd-ssl:g' \
256 "${D}/usr/share/courier/courierwebadmin/admin-40imap.pl" \
257 || ewarn "failed to fix webadmin"
258 sed -i -e 's:\$sbindir\/pop3d:\$sbindir\/courier-pop3d:g' \
259 -e 's:\$sbindir\/pop3d-ssl:\$sbindir\/courier-pop3d-ssl:g' \
260 "${D}/usr/share/courier/courierwebadmin/admin-45pop3.pl" \
261 || ewarn "failed to fix webadmin"
262 fi
263
264 # users should be able to send mail. Could be restricted with suictl.
265 chmod u+s "${D}/usr/bin/sendmail"
266
267 if use mailwrapper ; then
268 mv "${D}/usr/bin/sendmail" "${D}/usr/bin/sendmail.courier"
269 mv "${D}/usr/bin/rmail" "${D}/usr/bin/rmail.courier"
270 mv "${D}/usr/bin/mailq" "${D}/usr/bin/mailq.courier"
271
272 mv "${D}/usr/share/man/man1/sendmail.1" \
273 "${D}/usr/share/man/man1/sendmail-courier.1"
274 mv "${D}/usr/share/man/man1/mailq.1" \
275 "${D}/usr/share/man/man1/mailq-courier.1"
276 mv "${D}/usr/share/man/man1/rmail.1" \
277 "${D}/usr/share/man/man1/rmail-courier.1"
278
279 insopts -m 444 -o mail -g mail
280 insinto /etc/mail
281 doins "${FILESDIR}/mailer.conf"
282 else
283 dosym /usr/bin/sendmail /usr/sbin/sendmail
284 fi
285 }
286
287 src_test() {
288 addpredict /
289 vecho ">>> Test phase [check]: ${CATEGORY}/${PF}"
290 if hasq userpriv "${FEATURES}" ; then
291 if ! emake -j1 check; then
292 hasq test "${FEATURES}" && die "Make check failed. See above for details."
293 hasq test "${FEATURES}" || eerror "Make check failed. See above for details."
294 fi
295 else
296 hasq test "${FEATURES}" && eerror "Make check needs FEATURES="userpriv" to work."
297 fi
298 SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
299 }
300
301 pkg_postinst() {
302 use fam && elog "fam daemon is needed for courier-imapd" \
303 || ewarn "courier was built without fam support"
304 }
305
306 pkg_config() {
307 mailhost="$(hostname)"
308 export mailhost
309
310 domainname="$(domainname)"
311 if [ "x$domainname" = "x(none)" ] ; then
312 domainname="$(echo ${mailhost} | sed -e "s/[^\.]*\.\(.*\)/\1/")"
313 fi
314 export domainname
315
316 if [ "${ROOT}" = "/" ] ; then
317 file="${ROOT}/etc/courier/locals"
318 if [ ! -f "${file}" ] ; then
319 echo "localhost" > "${file}";
320 echo "${domainname}" >> "${file}";
321 fi
322 file="${ROOT}/etc/courier/esmtpacceptmailfor.dir/${domainname}"
323 if [ ! -f "${file}" ] ; then
324 echo "${domainname}" > "${file}"
325 /usr/sbin/makeacceptmailfor
326 fi
327
328 file="${ROOT}/etc/courier/smtpaccess/${domainname}"
329 if [ ! -f "${file}" ]
330 then
331 netstat -nr | grep "^[1-9]" | while read network gateway netmask rest
332 do
333 i=1
334 net=""
335 TIFS="${IFS}"
336 IFS="."
337 for o in "${netmask}"
338 do
339 if [ "${o}" == "255" ]
340 then
341 [ "_${net}" == "_" ] || net="${net}."
342 t="$(echo "${network}" | cut -d " " -f ${i})"
343 net="${net}${t}"
344 fi
345 i="$((${i} + 1))"
346 done
347 IFS="${TIFS}"
348 echo "doing configuration - relay control for the network ${net} !"
349 echo "${net} allow,RELAYCLIENT" >> ${file}
350 done
351 /usr/sbin/makesmtpaccess
352 fi
353 fi
354
355 echo "creating cert for esmtpd-ssl:"
356 /usr/sbin/mkesmtpdcert
357 echo "creating cert for imapd-ssl:"
358 /usr/sbin/mkpop3dcert
359 echo "creating cert for pop3d-ssl:"
360 /usr/sbin/mkimapdcert
361 }