Mail archive
alpine-aports

Re: [alpine-aports] [PATCH] main/dovecot: Integrate pigeonhole plugin 0.4.13 as a subpackage

From: Timo Teras <timo.teras_at_iki.fi>
Date: Mon, 4 Apr 2016 09:25:38 +0300

On Mon, 4 Apr 2016 02:56:25 +0200
Olivier Mauras <olivier_at_mauras.ch> wrote:

> Sieve support in dovecot requires the pigeonhole plugin.
> The plugin requires to be rebuilded each time dovecot minor version
> changes, so having it as a subpackage will make it easier.
> ---
> main/dovecot/APKBUILD | 50
> ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48
> insertions(+), 2 deletions(-)
>
> diff --git a/main/dovecot/APKBUILD b/main/dovecot/APKBUILD
> index 2ba4986..c6c0392 100644
> --- a/main/dovecot/APKBUILD
> +++ b/main/dovecot/APKBUILD
> _at_@ -4,7 +4,8 @@
> # Maintainer: Natanael Copa <ncopa_at_alpinelinux.org>
> pkgname=dovecot
> pkgver=2.2.22
> -pkgrel=0
> +pigeonholever=0.4.13
> +pkgrel=1
> pkgdesc="IMAP and POP3 server"
> url="http://www.dovecot.org/"
> arch="all"
> _at_@ -17,9 +18,10 @@ makedepends="libcap-dev zlib-dev openssl-dev
> bzip2-dev postgresql-dev install="dovecot.pre-install
> dovecot.post-install" subpackages="$pkgname-doc $pkgname-dev
> $pkgname-sql $pkgname-pgsql $pkgname-mysql $pkgname-sqlite
> - $pkgname-gssapi $pkgname-ldap
> + $pkgname-gssapi $pkgname-ldap $pkgname-pigeonhole
> "
> source="http://www.dovecot.org/releases/${pkgver%.*}/$pkgname-$pkgver.tar.gz
> +
> http://pigeonhole.dovecot.org/releases/2.2/$pkgname-2.2-pigeonhole-$pigeonholever.tar.gz
> hide-dl-errors.patch dovecot.logrotate
> dovecot.initd
> _at_@ -27,6 +29,7 @@
> source="http://www.dovecot.org/releases/${pkgver%.*}/$pkgname-$pkgver.tar.gz
> options="libtool"
> _builddir="$srcdir"/$pkgname-$pkgver
> +_builddirpigeonhole="$srcdir"/$pkgname-2.2-pigeonhole-$pigeonholever
>
> prepare() {
> cd "$_builddir"
> _at_@ -105,6 +108,46 @@ dev() {
> "$subpkgdir"/usr/lib/dovecot/
> }
>
> +pigeonhole() {
> + pkgdesc="Sieve plugin for dovecot"
> + depends="$pkgname"
> +
> + cd "$_builddirpigeonhole"
> + ./configure \
> + --build=$CBUILD \
> + --host=$CHOST \
> + --prefix=/usr \
> + --localstatedir=/var \
> + --sysconfdir=/etc \
> + --mandir=/usr/share/man \
> + --infodir=/usr/share/info \
> + --with-dovecot="$_builddir" \
> + --disable-static \
> + || return 1
> + make || return 1

The build stage should go to build().

> + make install DESTDIR="$pkgdir" || return 1

And this to package().

One reason for these is that some functions are run under fakeroot and
some not. And that then the automatic split for -doc works (see below).
And it also helps developers if they are running these stages
individually.

Otherwise it looks good to me. I'd also like to hear if dovecot
maintainer has any comments on doing this?

> +
> + # Moving stuff before running _mv
> + mv "$pkgdir"/usr/share/doc/dovecot/example-config/conf.d/* \
> + "$pkgdir"/etc/dovecot/conf.d \
> + || return 1
> +
> + # We keep includes, man and doc in main package
> + _mv $(cd "$pkgdir" && find usr -name '*sieve*' -prune \
> + -a -not -regex ".*/include/.*" \
> + -a -not -regex ".*/man/.*" \
> + -a -not -regex ".*/doc/.*" \
> + ) || return 1
> + _mv $(cd "$pkgdir" && find usr -name '*pigeonhole*' \
> + -a -not -regex ".*/include/.*" \
> + -a -not -regex ".*/man/.*" \
> + ) || return 1
> + _mv $(cd "$pkgdir" && find etc/dovecot -name '*sieve*') ||
> return 1 +
> + # Compress man pages
> + find "$pkgdir"/usr/share/man/ -name "*.1" -o -name "*.7" |
> xargs gzip -9 +}
> +

The man pages should go to -doc. Then they are also compressed
manually. Another reason to use build() and package() correctly.

> pgsql() {
> pkgdesc="postgresql driver for dovecot"
> depends="$pkgname-sql"
> _at_@ -144,14 +187,17 @@ sql() {
> }




---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Mon Apr 04 2016 - 09:25:38 GMT