aboutsummaryrefslogtreecommitdiffstats
path: root/main/dovecot/APKBUILD.orig
diff options
context:
space:
mode:
Diffstat (limited to 'main/dovecot/APKBUILD.orig')
-rw-r--r--main/dovecot/APKBUILD.orig157
1 files changed, 157 insertions, 0 deletions
diff --git a/main/dovecot/APKBUILD.orig b/main/dovecot/APKBUILD.orig
new file mode 100644
index 0000000000..03f33c48d1
--- /dev/null
+++ b/main/dovecot/APKBUILD.orig
@@ -0,0 +1,157 @@
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Contributor: Ɓukasz Jendrysik <scadu@yandex.com>
+# Contributor: Michael Mason <ms13sp@gmail.com>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=dovecot
+pkgver=2.2.22
+pkgrel=1
+pkgdesc="IMAP and POP3 server"
+url="http://www.dovecot.org/"
+arch="all"
+license="LGPL2+"
+depends="openssl"
+pkgusers="dovecot dovenull"
+pkggroups="dovecot dovenull"
+makedepends="libcap-dev zlib-dev openssl-dev bzip2-dev postgresql-dev
+ mariadb-dev sqlite-dev heimdal-dev openldap-dev linux-headers"
+install="dovecot.pre-install dovecot.post-install"
+subpackages="$pkgname-doc $pkgname-dev
+ $pkgname-sql $pkgname-pgsql $pkgname-mysql $pkgname-sqlite
+ $pkgname-gssapi $pkgname-ldap
+ "
+source="http://www.dovecot.org/releases/${pkgver%.*}/$pkgname-$pkgver.tar.gz
+ hide-dl-errors.patch
+ dovecot.logrotate
+ dovecot.initd
+ "
+options="libtool"
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+prepare() {
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --localstatedir=/var \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --with-gssapi=plugin \
+ --with-ldap=plugin \
+ --with-sql=plugin \
+ --with-mysql \
+ --with-sqlite \
+ --with-pgsql \
+ --with-ssl=openssl \
+ --with-ssldir=/etc/ssl/dovecot \
+ --with-rundir=/run/dovecot \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+
+ install -d "$pkgdir"/etc/ssl/dovecot
+ install -Dm755 "$srcdir"/dovecot.initd "$pkgdir"/etc/init.d/dovecot
+ install -Dm644 "$srcdir"/dovecot.logrotate "$pkgdir"/etc/logrotate.d/dovecot
+
+ # default config
+ rm "$pkgdir"/etc/dovecot/*
+ rm "$pkgdir"/usr/share/doc/dovecot/mkcert.sh
+ mv "$pkgdir"/usr/share/doc/dovecot/dovecot-openssl.cnf "$pkgdir"/etc/dovecot/
+ mv "$pkgdir"/usr/share/doc/dovecot/example-config/dovecot* \
+ "$pkgdir"/usr/share/doc/dovecot/example-config/conf.d \
+ "$pkgdir"/etc/dovecot/ || return 1
+ rm -fr "$pkgdir"/usr/share/doc/dovecot/example-config
+
+ # fix ssl dirs in default config
+ sed -i -e 's,^ssl_cert =.*,ssl_cert = </etc/ssl/dovecot/server.pem,' \
+ -e 's,^ssl_key =.*,ssl_key = </etc/ssl/dovecot/server.key,' \
+ "$pkgdir"/etc/dovecot/conf.d/10-ssl.conf || return 1
+ # set default passdb to passwd and create appropriate 'users' file
+ install -m 640 -o dovecot -g mail /dev/null "$pkgdir"/etc/dovecot/users
+ sed -i -e 's,!include auth-system.conf.ext,!include auth-passwdfile.conf.ext,' \
+ -e 's,#!include auth-passwdfile.conf.ext,#!include auth-system.conf.ext,' \
+ "$pkgdir"/etc/dovecot/conf.d/10-auth.conf || return 1
+}
+
+_mv() {
+ local i
+ while [ $# -gt 0 ]; do
+ local dir=${1%/*}
+ mkdir -p "$subpkgdir"/$dir
+ mv "$pkgdir/$1" "$subpkgdir/$dir/"
+ [ "$(ls -A $pkgdir/$dir)" ] || rmdir "$pkgdir"/$dir
+ shift
+ done
+}
+
+dev() {
+ default_dev
+ mv "$pkgdir"/usr/lib/dovecot/dovecot-config \
+ "$subpkgdir"/usr/lib/dovecot/
+}
+
+pgsql() {
+ pkgdesc="postgresql driver for dovecot"
+ depends="$pkgname-sql"
+ _mv $(cd "$pkgdir" && find usr -name '*_pgsql*')
+}
+
+mysql() {
+ pkgdesc="mysql driver for dovecot"
+ depends="$pkgname-sql"
+ _mv $(cd "$pkgdir" && find usr -name '*_mysql*')
+}
+
+sqlite() {
+ pkgdesc="sqlite driver for dovecot"
+ depends="$pkgname-sql"
+ _mv $(cd "$pkgdir" && find usr -name '*_sqlite*')
+}
+
+gssapi() {
+ pkgdesc="GSSAPI auth plugin for dovecot"
+ depends="$pkgname"
+ _mv $(cd "$pkgdir" && find usr -name '*_gssapi*')
+}
+
+ldap() {
+ pkgdesc="LDAP auth plugin for dovecot"
+ depends="$pkgname"
+ _mv $(cd "$pkgdir" && find usr -name '*_ldap*')
+ _mv $(cd "$pkgdir" && find etc/dovecot -name '*-ldap.conf*')
+}
+
+sql() {
+ pkgdesc="SQL plugin for dovecot"
+ depends="$pkgname"
+ _mv $(cd "$pkgdir" && find usr -name '*-sql.*')
+ _mv $(cd "$pkgdir" && find etc/dovecot -name '*-sql.conf*')
+}
+
+md5sums="bc8057bd5bdfa0f8e80e2fef1082a241 dovecot-2.2.22.tar.gz
+49f7a03284cc657857fe2ae22b8c82a0 hide-dl-errors.patch
+1a88280b65efb6cb7f70bc5a88bf264c dovecot.logrotate
+ddd77573827e0662be21303fb795eef3 dovecot.initd"
+sha256sums="c7a9db3c4ae9d9b4da920d2c82669700a0d407934501b405f37f89cc0b706ec7 dovecot-2.2.22.tar.gz
+d6accdd6e271647c01ab8fa0a9491ee822486484961e2d5c252bf70e816d2bfa hide-dl-errors.patch
+2ac04bb7b5c503cd87ba044482e651dbe5c9d84a4268891fb2aa9ba26e62f833 dovecot.logrotate
+3f74548051297cedc7f8d203f1d1d9dc904fe89004b54b52921d2050520daa6f dovecot.initd"
+sha512sums="ea02ae491e90c0b9de7c7320901c8f7235193303fb194805564582d30e630002f21f7195e5c5b99ff3ea1fadf95ddd43c2f7bb4d24067e0e5f40a66e9eb90012 dovecot-2.2.22.tar.gz
+1e9a1f2990019236546c7be581a4d6d0b430110d27a00bc3298f5c154ef9a4aadefa193d02a017912f826d771058fd5c6ef6cb454e14f0d15749fa8f3a68c64a hide-dl-errors.patch
+58756fa06a063777ef7c4d1e67b63adbde5462264e14bd7a3187a318f498fff21ac2a8d53bb216f56fef4588206e14112da79542b6dfdf503988786f27bb6544 dovecot.logrotate
+d7f67991e11979da91162eb64a0b924655d0ac155d97bcc42a40c758003d60b7c096945544e6b321aa8ecb3416fe17b14b5898f1dba5e5a4b3e4c9c21295c8cb dovecot.initd"