APKBUILD 1.55 KB
Newer Older
Michael Mason's avatar
Michael Mason committed
1
# Contributor: Michael Mason <ms13sp@gmail.com>
2
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
Michael Mason's avatar
Michael Mason committed
3
pkgname=dovecot
4
pkgver=1.2.11
5
pkgrel=3
Michael Mason's avatar
Michael Mason committed
6 7
pkgdesc="IMAP and POP3 server"
url="http://www.dovecot.org/"
8
license="LGPL-2.1"
9
depends=
10 11
makedepends="libcap-dev zlib-dev openssl-dev bzip2-dev postgresql-dev
	mysql-dev sqlite-dev"
12
install="dovecot.pre-install"
13 14
subpackages="$pkgname-doc $pkgname-dev $pkgname-pgsql $pkgname-mysql
	$pkgname-sqlite"
15
source="http://www.dovecot.org/releases/1.2/$pkgname-$pkgver.tar.gz
Michael Mason's avatar
Michael Mason committed
16 17 18 19 20 21 22
	dovecot.initd
	"

build() {
	cd "$srcdir/$pkgname-$pkgver"

	./configure --prefix=/usr \
23
		--sysconfdir=/etc/dovecot \
Michael Mason's avatar
Michael Mason committed
24 25
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
26 27 28 29 30
		--with-sql=plugin \
		--with-sql-drivers \
		--with-mysql \
		--with-sqlite \
		--with-pgsql \
31 32
		--with-ssl=openssl || return 1

Michael Mason's avatar
Michael Mason committed
33
	make || return 1
34
}
Michael Mason's avatar
Michael Mason committed
35

36 37 38
package() {
	cd "$srcdir/$pkgname-$pkgver"
	make DESTDIR="$pkgdir" install
39
	install -d "$pkgdir"/var/run/dovecot
40
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
Michael Mason's avatar
Michael Mason committed
41 42
}

43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
_mv() {
	local i
	while [ $# -gt 0 ]; do
		local dir=${1%/*}
		mkdir -p "$subpkgdir"/$dir
		mv "$pkgdir/$1" "$subpkgdir/$dir/"
		shift
	done
}


pgsql() {
	pkgdesc="postgresql driver for dovecot"
	_mv $(cd "$pkgdir" && find usr -name '*pgsql.so')
}

mysql() {
	pkgdesc="mysql driver for dovecot"
	_mv $(cd "$pkgdir" && find usr -name '*mysql.so')
}

sqlite() {
	pkgdesc="sqlite driver for dovecot"
	_mv $(cd "$pkgdir" && find usr -name '*sqlite.so')
}

69
md5sums="bdac013fd57aa616ea4bdd9ac34557c6  dovecot-1.2.11.tar.gz
70
c58b474dca20e6e60fa4f1f5b9c726e1  dovecot.initd"