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