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