Commit 21efade3 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/dovecot: set localstatedir

ref #359
ref #360

also create a default config that works out of the box.
parent 7483fd04
......@@ -2,14 +2,16 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=dovecot
pkgver=1.2.11
pkgrel=3
pkgrel=4
pkgdesc="IMAP and POP3 server"
url="http://www.dovecot.org/"
license="LGPL-2.1"
depends=
depends="openssl"
pkgusers="dovecot"
pkggroups="dovecot"
makedepends="libcap-dev zlib-dev openssl-dev bzip2-dev postgresql-dev
mysql-dev sqlite-dev"
install="dovecot.pre-install"
install="dovecot.pre-install dovecot.post-install"
subpackages="$pkgname-doc $pkgname-dev $pkgname-pgsql $pkgname-mysql
$pkgname-sqlite"
source="http://www.dovecot.org/releases/1.2/$pkgname-$pkgver.tar.gz
......@@ -20,6 +22,7 @@ build() {
cd "$srcdir/$pkgname-$pkgver"
./configure --prefix=/usr \
--localstatedir=/var \
--sysconfdir=/etc/dovecot \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
......@@ -36,8 +39,25 @@ build() {
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="$pkgdir" install
install -d "$pkgdir"/var/run/dovecot
install -d "$pkgdir"/var/run/dovecot \
"$pkgdir"/etc/ssl/dovecot
install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
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/\#\}/\}/
}' \
"$pkgdir"/etc/dovecot/dovecot.conf
}
_mv() {
......
#!/bin/sh
# based on doc/mkcert.sh
# Generates a self-signed certificate.
# Edit dovecot-openssl.cnf before running this.
OPENSSL=${OPENSSL-openssl}
SSLDIR=${SSLDIR-/etc/ssl/dovecot}
OPENSSLCONFIG=${OPENSSLCONFIG-/etc/dovecot/dovecot-openssl.cnf}
CERTDIR=$SSLDIR
KEYDIR=$SSLDIR
CERTFILE=$CERTDIR/server.pem
KEYFILE=$KEYDIR/server.key
if [ -e "$CERTFILE" ]; then
echo "Keeiping existing $CERTFILE"
exit 0
fi
if [ -e "$KEYFILE" ]; then
echo "Keeiping existing $KEYFILE"
exit 0
fi
$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 365 || exit 2
chmod 0600 $KEYFILE
echo
$OPENSSL x509 -subject -fingerprint -noout -in $CERTFILE || exit 2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment