Gentoo Archives: gentoo-commits

From: "Wolfram Schlich (wschlich)" <wschlich@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in net-mail/dovecot: ChangeLog dovecot-1.1.7-r1.ebuild
Date: Sat, 29 Nov 2008 19:28:56
Message-Id: E1L6VUr-0007ZF-8i@stork.gentoo.org
1 wschlich 08/11/29 19:28:53
2
3 Modified: ChangeLog
4 Added: dovecot-1.1.7-r1.ebuild
5 Log:
6 fix bugs #248840, #240652, #232268 and added a warning wrt bug #245316
7 (Portage version: 2.2_rc13/cvs/Linux 2.6.24-gentoo-r5-1 i686)
8
9 Revision Changes Path
10 1.191 net-mail/dovecot/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.191&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.191&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/ChangeLog?r1=1.190&r2=1.191
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v
19 retrieving revision 1.190
20 retrieving revision 1.191
21 diff -u -r1.190 -r1.191
22 --- ChangeLog 25 Nov 2008 17:38:57 -0000 1.190
23 +++ ChangeLog 29 Nov 2008 19:28:53 -0000 1.191
24 @@ -1,6 +1,12 @@
25 # ChangeLog for net-mail/dovecot
26 # Copyright 2000-2008 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.190 2008/11/25 17:38:57 wschlich Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.191 2008/11/29 19:28:53 wschlich Exp $
29 +
30 +*dovecot-1.1.7-r1 (29 Nov 2008)
31 +
32 + 29 Nov 2008; Wolfram Schlich <wschlich@g.o>
33 + +dovecot-1.1.7-r1.ebuild:
34 + fix bugs #248840, #240652, #232268 and added a warning wrt bug #245316
35
36 *dovecot-1.1.7 (25 Nov 2008)
37
38
39
40
41 1.1 net-mail/dovecot/dovecot-1.1.7-r1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/dovecot-1.1.7-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/dovecot-1.1.7-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: dovecot-1.1.7-r1.ebuild
47 ===================================================================
48 # Copyright 1999-2008 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/dovecot-1.1.7-r1.ebuild,v 1.1 2008/11/29 19:28:53 wschlich Exp $
51
52 inherit autotools eutils ssl-cert versionator
53
54 MY_P="${P/_/.}"
55 MY_PV12=$(get_version_component_range 1-2 ${PV})
56 S="${WORKDIR}/${MY_P}"
57 SIEVE="dovecot-sieve-1.1.5"
58 SIEVE_S="${WORKDIR}/${SIEVE}"
59 MANAGESIEVE_PATCH="managesieve-0.10.4"
60 MANAGESIEVE="managesieve-0.10.4"
61 MANAGESIEVE_S="${WORKDIR}/${PN}-${MY_PV12}-${MANAGESIEVE}"
62
63 SRC_URI="http://dovecot.org/releases/${MY_PV12}/${MY_P}.tar.gz
64 sieve? ( http://dovecot.org/releases/sieve/${SIEVE}.tar.gz )
65 managesieve? ( http://www.rename-it.nl/${PN}/${MY_PV12}/${MY_P}-${MANAGESIEVE_PATCH}.diff.gz
66 http://www.rename-it.nl/${PN}/${MY_PV12}/${PN}-${MY_PV12}-${MANAGESIEVE}.tar.gz )"
67
68 DESCRIPTION="An IMAP and POP3 server written with security primarily in mind"
69 HOMEPAGE="http://www.dovecot.org/"
70
71 SLOT="0"
72 LICENSE="LGPL-2.1"
73 KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86 ~x86-fbsd"
74
75 IUSE="berkdb debug doc ipv6 kerberos ldap managesieve mbox mysql pop3d pam postgres sieve sqlite3 ssl suid vpopmail"
76
77 # Developer documentation, controlled by the doc USE flag
78 DEVDOCS="auth-protocol index multiaccess securecoding"
79
80 DEPEND=">=sys-apps/sed-4
81 sys-libs/libcap
82 berkdb? ( >=sys-libs/db-4.2 )
83 kerberos? ( virtual/krb5 )
84 ldap? ( net-nds/openldap )
85 pam? ( virtual/pam )
86 ssl? ( dev-libs/openssl )
87 postgres? ( virtual/postgresql-base )
88 mysql? ( virtual/mysql )
89 sqlite3? ( =dev-db/sqlite-3* )
90 vpopmail? ( net-mail/vpopmail )"
91
92 RDEPEND="${DEPEND}
93 >=net-mail/mailbase-0.00-r8"
94
95 src_unpack() {
96 unpack ${A}
97 cd "${S}"
98 if use managesieve; then
99 epatch "${WORKDIR}"/${MY_P}-${MANAGESIEVE_PATCH}.diff
100 eautoreconf
101 fi
102 }
103
104 pkg_setup() {
105 if ! use sieve && use managesieve; then
106 eerror "managesieve USE flag selected but sieve USE flag unselected"
107 die "USE flag problem"
108 fi
109 # Add user and group for login process (same as for fedora/redhat)
110 enewgroup dovecot 97
111 enewuser dovecot 97 -1 /dev/null dovecot
112 }
113
114 src_compile() {
115 local myconf=
116 use ssl && myconf="${myconf} --with-ssl=openssl" \
117 || myconf="${myconf} --without-ssl"
118 econf \
119 --localstatedir=/var \
120 --sysconfdir=/etc/dovecot \
121 --enable-header-install \
122 --with-ioloop=best \
123 --with-poll=best \
124 $(use_with berkdb db) \
125 $(use_enable debug) \
126 $(use_enable ipv6) \
127 $(use_with kerberos gssapi) \
128 $(use_with ldap) \
129 $(use_with mysql) \
130 $(use_with pam) \
131 $(use_with pop3d) \
132 $(use_with postgres pgsql) \
133 $(use_with sqlite3 sqlite) \
134 $(use_with vpopmail) \
135 ${myconf} \
136 || die "configure failed"
137 emake || die "make failed"
138
139 if use sieve; then
140 einfo "Building sieve"
141 cd "${SIEVE_S}"
142 econf --with-dovecot="${S}" || die "configure failed (sieve)"
143 emake || die "make failed (sieve)"
144 fi
145
146 if use managesieve; then
147 einfo "Building managesieve"
148 cd "${MANAGESIEVE_S}"
149 econf --with-dovecot="${S}" --with-dovecot-sieve="${SIEVE_S}" \
150 || die "configure failed (managesieve)"
151 emake || die "make failed (managesieve)"
152 fi
153 }
154
155 src_install () {
156 make DESTDIR="${D}" install || die "make install failed"
157 use suid && fperms u+s /usr/libexec/dovecot/deliver
158
159 rm -f "${D}"/etc/dovecot/dovecot-{ldap,sql}-example.conf
160
161 newinitd "${FILESDIR}"/dovecot.init-r2 dovecot
162
163 # Documentation
164 rm -rf "${D}"/usr/share/doc/dovecot
165 dodoc AUTHORS NEWS README TODO dovecot-example.conf
166 use managesieve && newdoc ${MANAGESIEVE_S}/README README.managesieve
167 if use doc; then
168 dodoc doc/*.txt
169 else
170 local x= n=
171 for x in doc/*.txt; do
172 n=$(basename "${x}" .txt)
173 [[ " ${DEVDOCS} " != *" ${n} "* ]] && dodoc "${x}"
174 done
175 fi
176
177 # Create the dovecot.conf file from the dovecot-example.conf file that
178 # the dovecot folks nicely left for us....
179 local conf="${D}/etc/dovecot/dovecot.conf"
180 mv "${D}"/etc/dovecot/dovecot-example.conf "${D}"/etc/dovecot/dovecot.conf
181
182 # .maildir is the Gentoo default, but we need to support mbox to
183 local mail_location="maildir:~/.maildir"
184 if use mbox; then
185 mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
186 keepdir /var/dovecot
187 sed -i -e 's|#mail_privileged_group =|mail_privileged_group = mail|' "${conf}"
188 fi
189 sed -i -e \
190 "s|#mail_location =|mail_location = ${mail_location}|" "${conf}" \
191 || die "failed to update mail location settings in dovecot.conf"
192
193 # We're using pam files (imap and pop3) provided by mailbase
194 if use pam; then
195 sed -i -e '/passdb pam/, /^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
196 "${conf}" || die "failed to update PAM settings in dovecot.conf"
197 # mailbase does not provide a managesieve pam file
198 use managesieve && dosym imap /etc/pam.d/managesieve
199 fi
200
201 # Listen on ipv6 and ipv4
202 if use ipv6; then
203 sed -i -e 's/^#listen = \*/listen = \[::\]/g' "${conf}" \
204 || die "failed to update listen settings in dovecot.conf"
205 fi
206
207 # Update ssl cert locations
208 if use ssl; then
209 sed -i -e 's,^#ssl_cert_file =.*,ssl_cert_file = /etc/ssl/dovecot/server.pem,' \
210 -e 's,^#ssl_key_file =.*,ssl_key_file = /etc/ssl/dovecot/server.key,' \
211 "${conf}" || die "failed to update SSL settings in dovecot.conf"
212 fi
213
214 # Install SQL configuration
215 if use mysql || use postgres; then
216 cp doc/dovecot-sql-example.conf "${D}"/etc/dovecot/dovecot-sql.conf
217 fperms 600 /etc/dovecot/dovecot-sql.conf
218 sed -i -e '/db sql/,/args/ s|=|= /etc/dovecot-sql.conf|' "${conf}" \
219 || die "failed to update SQL settings in dovecot-sql.conf"
220 dodoc doc/dovecot-sql-example.conf
221 fi
222
223 # Install LDAP configuration
224 if use ldap; then
225 cp doc/dovecot-ldap-example.conf "${D}"/etc/dovecot/dovecot-ldap.conf
226 fperms 600 /etc/dovecot/dovecot-ldap.conf
227 sed -i -e '/db ldap/,/args/ s|=|= /etc/dovecot-ldap.conf|' "${conf}" \
228 || die "failed to update LDAP settings in dovecot-ldap.conf"
229 dodoc doc/dovecot-ldap-example.conf
230 fi
231
232 # Install sieve plugin
233 if use sieve; then
234 make -C "${SIEVE_S}" DESTDIR="${D}" install \
235 || die "make install failed (sieve)"
236 fi
237
238 # Install managesieve
239 if use managesieve; then
240 make -C "${MANAGESIEVE_S}" DESTDIR="${D}" install \
241 || die "make install failed (managesieve)"
242 fi
243
244 dodir /var/run/dovecot
245 fowners root:0 /var/run/dovecot
246 fperms 0755 /var/run/dovecot
247 keepdir /var/run/dovecot/login
248 fowners root:dovecot /var/run/dovecot/login
249 fperms 0750 /var/run/dovecot/login
250 }
251
252 get_config_var() {
253 local varname=${1}
254 if [[ -z ${varname} ]]; then
255 die "${FUNCNAME}: variable name missing"
256 fi
257 sed -n 's/^[[:space:]]\?'"${varname}"'[[:space:]]*="*\([^#"]\+\)"*/\1/p' \
258 "${ROOT}"/etc/dovecot/dovecot.conf
259 }
260
261 pkg_postinst() {
262 elog "The Dovecot configuration has vastly changed since 0.99."
263 elog "You are encouraged to start afresh with a new configuration file."
264 elog "see http://wiki.dovecot.org/ for configuration examples."
265
266 if [[ -e "${ROOT}"/etc/dovecot.conf ]]; then
267 echo
268 ewarn "The Dovecot configuration now resides in ${ROOT}/etc/dovecot"
269 fi
270
271 local base_dir="$(get_config_var base_dir)"
272 base_dir="${base_dir:-/var/run/dovecot}"
273 if use ssl; then
274 # Let's not make a new certificate if we already have one
275 if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
276 -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
277 einfo "Creating SSL certificate"
278 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
279 install_cert /etc/ssl/dovecot/server
280 chown dovecot:mail "${ROOT}"/etc/ssl/dovecot/server.{key,pem}
281 fi
282 if [[ ! -e "${ROOT}${base_dir}/login/ssl-parameters.dat" ]]; then
283 echo
284 elog "Dovecot requires DH SSL Parameters if you use SSL connections"
285 elog "These take some time to make, and dovecot will create them before"
286 elog "it allows any SSL connections."
287 elog "You can create them now before starting dovecot like so"
288 elog " emerge --config =${PF}"
289 fi
290 fi
291
292 if grep -q '^ssl_key_password' "${ROOT}"/etc/dovecot/dovecot.conf; then
293 echo
294 ewarn "*** ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ***"
295 ewarn
296 ewarn "You have set ssl_key_password in dovecot.conf!"
297 ewarn "You are URGED to read the advice in the current"
298 ewarn "dovecot-example.conf regarding sensible handling"
299 ewarn "of that password, as it might be readable by any"
300 ewarn "user on your system who can access that file!"
301 ewarn
302 ewarn "*** ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION ***"
303 echo
304 fi
305 }
306
307 pkg_config() {
308 local base_dir="$(get_config_var base_dir)"
309 base_dir="${base_dir:-/var/run/dovecot}"
310
311 if use ssl; then
312 einfo "Regenerating SSL parameters. This will take some time."
313 "${ROOT}"/usr/libexec/dovecot/ssl-build-param "${base_dir}/login/ssl-parameters.dat"
314 fi
315 }