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_rc1-r1.ebuild
Date: Mon, 03 Mar 2008 19:10:08
Message-Id: E1JWG33-0006ow-1O@stork.gentoo.org
1 wschlich 08/03/03 19:10:05
2
3 Modified: ChangeLog
4 Added: dovecot-1.1_rc1-r1.ebuild
5 Log:
6 version bump of the MANAGESIEVE plugin
7 (Portage version: 2.1.4)
8
9 Revision Changes Path
10 1.145 net-mail/dovecot/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.145&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/ChangeLog?rev=1.145&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/ChangeLog?r1=1.144&r2=1.145
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v
19 retrieving revision 1.144
20 retrieving revision 1.145
21 diff -u -r1.144 -r1.145
22 --- ChangeLog 23 Feb 2008 11:43:24 -0000 1.144
23 +++ ChangeLog 3 Mar 2008 19:10:04 -0000 1.145
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.144 2008/02/23 11:43:24 wschlich Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/net-mail/dovecot/ChangeLog,v 1.145 2008/03/03 19:10:04 wschlich Exp $
29 +
30 +*dovecot-1.1_rc1-r1 (03 Mar 2008)
31 +
32 + 03 Mar 2008; Wolfram Schlich <wschlich@g.o>
33 + +dovecot-1.1_rc1-r1.ebuild:
34 + version bump of the MANAGESIEVE plugin
35
36 *dovecot-1.1_rc1 (22 Feb 2008)
37
38
39
40
41 1.1 net-mail/dovecot/dovecot-1.1_rc1-r1.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/dovecot-1.1_rc1-r1.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-mail/dovecot/dovecot-1.1_rc1-r1.ebuild?rev=1.1&content-type=text/plain
45
46 Index: dovecot-1.1_rc1-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_rc1-r1.ebuild,v 1.1 2008/03/03 19:10:04 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.4"
58 SIEVE_S="${WORKDIR}/${SIEVE}"
59 MANAGESIEVE_PATCH="managesieve-0.10.0"
60 MANAGESIEVE="managesieve-0.10.1"
61 MANAGESIEVE_S="${WORKDIR}/${PN}-${MY_PV12}-${MANAGESIEVE}"
62
63 SRC_URI="http://dovecot.org/releases/${MY_PV12}/rc/${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="debug doc ipv6 kerberos ldap managesieve mbox mysql pop3d pam postgres sieve 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 kerberos? ( virtual/krb5 )
82 ldap? ( net-nds/openldap )
83 pam? ( virtual/pam )
84 ssl? ( dev-libs/openssl )
85 postgres? ( dev-db/postgresql )
86 mysql? ( virtual/mysql )
87 vpopmail? ( net-mail/vpopmail )"
88
89 RDEPEND="${DEPEND}
90 >=net-mail/mailbase-0.00-r8"
91
92 src_unpack() {
93 unpack ${A}
94 cd "${S}"
95 if use managesieve; then
96 epatch "${WORKDIR}"/${MY_P}-${MANAGESIEVE_PATCH}.diff
97 eautoreconf
98 fi
99 }
100
101 pkg_setup() {
102 if ! use sieve && use managesieve; then
103 eerror "managesieve USE flag selected but sieve USE flag unselected"
104 die "USE flag problem"
105 fi
106 # Add user and group for login process (same as for fedora/redhat)
107 enewgroup dovecot 97
108 enewuser dovecot 97 -1 /dev/null dovecot
109 }
110
111 src_compile() {
112 local myconf=
113 use ssl && myconf="${myconf} --with-ssl=openssl" \
114 || myconf="${myconf} --without-ssl"
115 econf \
116 --localstatedir=/var \
117 --sysconfdir=/etc/dovecot \
118 --enable-header-install \
119 --with-ioloop=best \
120 --with-poll=best \
121 $(use_enable debug) \
122 $(use_enable ipv6) \
123 $(use_with kerberos gssapi) \
124 $(use_with ldap) \
125 $(use_with mysql) \
126 $(use_with pam) \
127 $(use_with pop3d) \
128 $(use_with postgres pgsql) \
129 $(use_with vpopmail) \
130 ${myconf} \
131 || die "configure failed"
132 emake || die "make failed"
133
134 if use sieve; then
135 einfo "Building sieve"
136 cd "${SIEVE_S}"
137 econf --with-dovecot="${S}" || die "configure failed (sieve)"
138 emake || die "make failed (sieve)"
139 fi
140
141 if use managesieve; then
142 einfo "Building managesieve"
143 cd "${MANAGESIEVE_S}"
144 econf --with-dovecot="${S}" --with-dovecot-sieve="${SIEVE_S}" \
145 || die "configure failed (managesieve)"
146 emake || die "make failed (managesieve)"
147 fi
148 }
149
150 src_install () {
151 make DESTDIR="${D}" install || die "make install failed"
152 use suid && fperms u+s /usr/libexec/dovecot/deliver
153
154 rm -f "${D}"/etc/dovecot/dovecot-{ldap,sql}-example.conf
155
156 newinitd "${FILESDIR}"/dovecot.init dovecot
157
158 # Documentation
159 rm -rf "${D}"/usr/share/doc/dovecot
160 dodoc AUTHORS NEWS README TODO dovecot-example.conf
161 use managesieve && newdoc ${MANAGESIEVE_S}/README README.managesieve
162 if use doc; then
163 dodoc doc/*.txt
164 else
165 local x= n=
166 for x in doc/*.txt; do
167 n=$(basename "${x}" .txt)
168 [[ " ${DEVDOCS} " != *" ${n} "* ]] && dodoc "${x}"
169 done
170 fi
171
172 # Create the dovecot.conf file from the dovecot-example.conf file that
173 # the dovecot folks nicely left for us....
174 local conf="${D}/etc/dovecot/dovecot.conf"
175 mv "${D}"/etc/dovecot/dovecot-example.conf "${D}"/etc/dovecot/dovecot.conf
176
177 # .maildir is the Gentoo default, but we need to support mbox to
178 local mail_location="maildir:~/.maildir"
179 if use mbox; then
180 mail_location="mbox:/var/spool/mail/%u:INDEX=/var/dovecot/%u"
181 keepdir /var/dovecot
182 sed -i -e 's|#mail_extra_groups =|mail_extra_groups = mail|' "${conf}"
183 fi
184 sed -i -e \
185 "s|#mail_location =|mail_location = ${mail_location}|" "${conf}" \
186 || die "failed to update mail location settings in dovecot.conf"
187
188 # We're using pam files (imap and pop3) provided by mailbase
189 if use pam; then
190 sed -i -e '/passdb pam/, /^[ \t]*}/ s|#args = dovecot|args = "\*"|' \
191 "${conf}" || die "failed to update PAM settings in dovecot.conf"
192 fi
193
194 # Listen on ipv6 and ipv4
195 if use ipv6; then
196 sed -i -e 's/^#listen = \*/listen = \[::\]/g' "${conf}" \
197 || die "failed to update listen settings in dovecot.conf"
198 fi
199
200 # Update ssl cert locations
201 if use ssl; then
202 sed -i -e 's,^#ssl_cert_file =.*,ssl_cert_file = /etc/ssl/dovecot/server.pem,' \
203 -e 's,^#ssl_key_file =.*,ssl_key_file = /etc/ssl/dovecot/server.key,' \
204 "${conf}" || die "failed to update SSL settings in dovecot.conf"
205 fi
206
207 # Install SQL configuration
208 if use mysql || use postgres; then
209 cp doc/dovecot-sql-example.conf "${D}"/etc/dovecot/dovecot-sql.conf
210 fperms 600 /etc/dovecot/dovecot-sql.conf
211 sed -i -e '/db sql/,/args/ s|=|= /etc/dovecot-sql.conf|' "${conf}" \
212 || die "failed to update SQL settings in dovecot-sql.conf"
213 dodoc doc/dovecot-sql-example.conf
214 fi
215
216 # Install LDAP configuration
217 if use ldap; then
218 cp doc/dovecot-ldap-example.conf "${D}"/etc/dovecot/dovecot-ldap.conf
219 fperms 600 /etc/dovecot/dovecot-ldap.conf
220 sed -i -e '/db ldap/,/args/ s|=|= /etc/dovecot-ldap.conf|' "${conf}" \
221 || die "failed to update LDAP settings in dovecot-ldap.conf"
222 dodoc doc/dovecot-ldap-example.conf
223 fi
224
225 # Install sieve plugin
226 if use sieve; then
227 make -C "${SIEVE_S}" DESTDIR="${D}" install \
228 || die "make install failed (sieve)"
229 fi
230
231 # Install managesieve
232 if use managesieve; then
233 make -C "${MANAGESIEVE_S}" DESTDIR="${D}" install \
234 || die "make install failed (managesieve)"
235 fi
236
237 dodir /var/run/dovecot
238 fowners root:0 /var/run/dovecot
239 fperms 0755 /var/run/dovecot
240 keepdir /var/run/dovecot/login
241 fowners root:dovecot /var/run/dovecot/login
242 fperms 0750 /var/run/dovecot/login
243 }
244
245 get_config_var() {
246 local varname=${1}
247 if [[ -z ${varname} ]]; then
248 die "${FUNCNAME}: variable name missing"
249 fi
250 sed -n 's/^[[:space:]]\?'"${varname}"'[[:space:]]*="*\([^#"]\+\)"*/\1/p' \
251 "${ROOT}"/etc/dovecot/dovecot.conf
252 }
253
254 pkg_postinst() {
255 elog "The Dovecot configuration has vastly changed since 0.99."
256 elog "You are encouraged to start afresh with a new configuration file."
257 elog "see http://wiki.dovecot.org/ for configuration examples."
258
259 if [[ -e "${ROOT}"/etc/dovecot.conf ]]; then
260 echo
261 ewarn "The Dovecot configuration now resides in ${ROOT}/etc/dovecot"
262 fi
263
264 local base_dir="$(get_config_var base_dir)"
265 base_dir="${base_dir:-/var/run/dovecot}"
266 if use ssl; then
267 # Let's not make a new certificate if we already have one
268 if ! [[ -e "${ROOT}"/etc/ssl/dovecot/server.pem && \
269 -e "${ROOT}"/etc/ssl/dovecot/server.key ]]; then
270 einfo "Creating SSL certificate"
271 SSL_ORGANIZATION="${SSL_ORGANIZATION:-Dovecot IMAP Server}"
272 install_cert /etc/ssl/dovecot/server
273 chown dovecot:mail "${ROOT}"/etc/ssl/dovecot/server.{key,pem}
274 fi
275 if [[ ! -e "${ROOT}${base_dir}/login/ssl-parameters.dat" ]]; then
276 echo
277 elog "Dovecot requires DH SSL Parameters if you use SSL connections"
278 elog "These take some time to make, and dovecot will create them before"
279 elog "it allows any SSL connections."
280 elog "You can create them now before starting dovecot like so"
281 elog " emerge --config =${PF}"
282 fi
283 fi
284 }
285
286 pkg_config() {
287 local base_dir="$(get_config_var base_dir)"
288 base_dir="${base_dir:-/var/run/dovecot}"
289
290 if use ssl; then
291 einfo "Regenerating SSL parameters. This will take some time."
292 "${ROOT}"/usr/libexec/dovecot/ssl-build-param "${base_dir}/login/ssl-parameters.dat"
293 fi
294 }
295
296
297
298 --
299 gentoo-commits@l.g.o mailing list