summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a6c09769b81e9305f8aa83268889cc4b060469f4 (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
# Maintainer: Massimiliano Torromeo <massimiliano.torromeo@gmail.com>

pkgname=piler
pkgver=1.1.1
pkgrel=1
pkgdesc="Open source email archiving solution with all the necessary features for your enterprise"
arch=('i686' 'x86_64')
url="http://www.mailpiler.org/"
license=('GPL')
depends=('tre' 'libzip' 'libmariadbclient')
makedepends=('mariadb' 'poppler' 'catdoc' 'unrtf' 'tnef')
optdepends=('sphinx: for indexing emails'
            'poppler: for reading attachments'
            'catdoc: for reading attachments'
            'unrtf: for reading attachments'
            'tnef: for reading attachments')
options=('!emptydirs')
source=(https://bitbucket.org/jsuto/piler/downloads/$pkgname-$pkgver.tar.gz
        piler.service
        piler-user.conf
        piler-tmpfile.conf)
sha256sums=('41555e208fec4a979e7429687b980e69b88065dd020791dd6682dc16336947b7'
            'a552d39f949888d14106b64946e20d565e290d4dea93a2562f2a0644ae2a92d6'
            '78e33088c1d0be9b5a04d85cdd4f593dd6c91e48b7241065e2dc7ee15d8c0a64'
            '40fd91c33118d6104c721db5efa4ab5cc577aa8e3311648fb1c10a6d49678d3e')
backup=('etc/piler.conf')

build() {
	cd "$srcdir"/$pkgname-$pkgver
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--sbindir=/usr/bin \
		--localstatedir=/var/lib \
		--libexecdir=/usr/share \
		--enable-starttls \
		--with-database=mysql \
		--with-piler-user=root \
		# --enable-clamd \
		# --enable-memcached \

	make
}

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

	cd "$pkgdir"
	chmod -R a-s usr/bin
	chmod 644 etc/*.conf*

	install -dm755 usr/share/doc/$pkgname
	mv etc/*.dist usr/share/doc/$pkgname

	rm -rf etc/init.d

	sed -r 's#pidfile=.*#pidfile=/run/piler/piler.pid#' etc/piler.conf

	install -Dm644 "$srcdir"/piler.service usr/lib/systemd/system/piler.service
	install -Dm644 "$srcdir"/piler-user.conf usr/lib/sysusers.d/piler.conf
	install -Dm644 "$srcdir"/piler-tmpfile.conf usr/lib/tmpfiles.d/piler.conf
}