version bump
Bernd Wurst

Bernd Wurst commited on 2008-04-12 13:21:02
Zeige 2 geänderte Dateien mit 344 Einfügungen und 0 Löschungen.

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