version bump to courier-0.63.0, first version supporting DROP-feature
Bernd Wurst

Bernd Wurst commited on 2009-12-07 08:55:51
Zeige 2 geänderte Dateien mit 314 Einfügungen und 0 Löschungen.

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