summaryrefslogtreecommitdiff
path: root/extra/dovecot/PKGBUILD
blob: 8551ab565541ededd57f0cdb31d152ad20068f28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# $Id: PKGBUILD 188926 2013-06-25 16:51:14Z andyrtr $
# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Contributor: Paul Mattal <paul@mattal.com>
# Contributor: Federico Quagliata (quaqo) <quaqo@despammed.com>
# Contributor: GARETTE Emmanuel <gnunux at laposte dot net>


# --->>> remember to rebuild/bump pigeonhole in one step <<<---

pkgname=dovecot
pkgver=2.2.4
pkgrel=1
pkgdesc="An IMAP and POP3 server written with security primarily in mind"
arch=('i686' 'x86_64')
url="http://dovecot.org/"
license=("LGPL")
depends=('krb5' 'openssl' 'sqlite>=3.7.5' 'libmariadbclient'
        'postgresql-libs>=9.0.3' 'bzip2' 'expat' 'curl')
makedepends=('pam>=1.1.1' 'libcap>=2.19' 'libldap>=2.4.22' 'clucene')
optdepends=('libldap: ldap plugin'
           'clucene: alternative FTS indexer')
provides=('imap-server' 'pop3-server')
options=('!libtool')
install=$pkgname.install
source=(http://dovecot.org/releases/2.2/${pkgname}-${pkgver}.tar.gz{,.sig}
        dovecot.tmpfilesd)
md5sums=('984cfc921a83c580c52c86e128e9dac2'
         'SKIP'
         '342a28251d40f983c98c0d1f1bf3d07d')

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

  # fix build with recent clucene (FC)
  sed -i '/DEFAULT_INCLUDES *=/s|$| '"$(pkg-config --cflags libclucene-core)|" src/plugins/fts-lucene/Makefile.in
  
  # fix path in helper script
  sed -i 's:OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}:OPENSSLCONFIG=${OPENSSLCONFIG- /etc/ssl/dovecot-openssl.cnf}:' doc/mkcert.sh

  # configure with openssl, mysql, and postgresql support
  ./configure --prefix=/usr --sysconfdir=/etc \
    --sbindir=/usr/bin \
    --localstatedir=/var \
  	--libexecdir=/usr/lib \
  	--with-moduledir=/usr/lib/dovecot/modules \
  	--with-systemdsystemunitdir=/usr/lib/systemd/system \
	--disable-static \
	--with-nss \
	--with-pam \
	--with-mysql \
	--with-pgsql \
	--with-sqlite \
	--with-ssl=openssl \
	--with-ssldir=/etc/ssl \
	--with-gssapi \
	--with-ldap=plugin \
	--with-zlib --with-bzlib \
	--with-libcap \
	--with-solr \
	--with-lucene \
	--with-docs
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"
  make -k check
}

package() {
  cd ${srcdir}/$pkgname-$pkgver
  make DESTDIR=${pkgdir} install

  # install example conf files and ssl.conf
  install -d -m755 ${pkgdir}/etc/dovecot/conf.d
  install -m 644 ${pkgdir}/usr/share/doc/dovecot/example-config/dovecot.conf ${pkgdir}/etc/dovecot/dovecot.conf.sample
  install -d -m755 ${pkgdir}/etc/ssl
  install -m 644  ${srcdir}/$pkgname-$pkgver/doc/dovecot-openssl.cnf ${pkgdir}/etc/ssl/dovecot-openssl.cnf.sample

  # install mkcert helper script
  install -m 755  ${srcdir}/$pkgname-$pkgver/doc/mkcert.sh ${pkgdir}/usr/lib/dovecot/mkcert.sh

  rm ${pkgdir}/etc/dovecot/README
  
  # systemd tmpfile
  install -d -m755 ${pkgdir}/usr/lib/tmpfiles.d
  install -m 644  ${srcdir}/dovecot.tmpfilesd ${pkgdir}/usr/lib/tmpfiles.d/dovecot.conf
}