Gitlab has successfully been upgraded to 14.0.10 🎉. Enjoy!

APKBUILD 2.47 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 5
pkgver=1.2.13
pkgrel=0
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 10 11
depends="openssl"
pkgusers="dovecot"
pkggroups="dovecot"
12
depends="logrotate"
13 14
makedepends="libcap-dev zlib-dev openssl-dev bzip2-dev postgresql-dev
	mysql-dev sqlite-dev"
15
install="dovecot.pre-install dovecot.post-install"
16 17
subpackages="$pkgname-doc $pkgname-dev $pkgname-pgsql $pkgname-mysql
	$pkgname-sqlite"
18
source="http://www.dovecot.org/releases/1.2/$pkgname-$pkgver.tar.gz
19
	dovecot.logrotate
Michael Mason's avatar
Michael Mason committed
20 21 22 23 24 25 26
	dovecot.initd
	"

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

	./configure --prefix=/usr \
27
		--localstatedir=/var \
28
		--sysconfdir=/etc/dovecot \
Michael Mason's avatar
Michael Mason committed
29 30
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
31 32 33 34 35
		--with-sql=plugin \
		--with-sql-drivers \
		--with-mysql \
		--with-sqlite \
		--with-pgsql \
36 37
		--with-ssl=openssl || return 1

Michael Mason's avatar
Michael Mason committed
38
	make || return 1
39
}
Michael Mason's avatar
Michael Mason committed
40

41 42 43
package() {
	cd "$srcdir/$pkgname-$pkgver"
	make DESTDIR="$pkgdir" install
44 45
	install -d "$pkgdir"/var/run/dovecot \
		"$pkgdir"/etc/ssl/dovecot
46
	install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
47
	install -D "$srcdir"/dovecot.logrotate "$pkgdir"/etc/logrotate.d/dovecot
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
	install doc/dovecot-openssl.cnf "$pkgdir"/etc/dovecot/
	mv "$pkgdir"/etc/dovecot/dovecot-example.conf \
		"$pkgdir"/etc/dovecot/dovecot.conf || return 1
	
	# fix ssl dirs in defautl config and set defautl passdb to passwd
	sed -i -e 's,^#ssl_cert_file =.*,ssl_cert_file = /etc/ssl/dovecot/server.pem,' \
		-e 's,^#ssl_key_file =.*,ssl_key_file = /etc/ssl/dovecot/server.key,' \
		-e '/passdb pam {/,/^$/{
			s/passdb pam/\#passdb pam/
			s/}/\#}/
		    }' \
		-e '/\#passdb passwd {/,/^$/{
			s/\#passdb passwd/passdb passwd/
			s/\#\}/\}/
		    }' \
63
		-e 's,#log_path =.*,log_path = /var/log/dovecot.log,' \
64
		"$pkgdir"/etc/dovecot/dovecot.conf
Michael Mason's avatar
Michael Mason committed
65 66
}

67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
_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')
}

93
md5sums="aaee3b5fd59e01780305553248f686bc  dovecot-1.2.13.tar.gz
94
aec5cc797ab2acf72ce3b6bb1030345f  dovecot.logrotate
95
c58b474dca20e6e60fa4f1f5b9c726e1  dovecot.initd"