summaryrefslogtreecommitdiff
path: root/extra/postfix/PKGBUILD
blob: 2a21d88ceb7056007cd156f550c8e7dcc47eb9b1 (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
# $Id: PKGBUILD 148446 2012-02-01 03:47:09Z bisson $
# Contributor: Jeff Brodnax <tullyarcher@bellsouth.net>
# Contributor: Paul Mattal <paul@archlinux.org>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=postfix
pkgver=2.9.0
pkgrel=1
pkgdesc='Fast, easy to administer, secure mail server'
url='http://www.postfix.org/'
license=('custom')
arch=('i686' 'x86_64')
depends=('pcre' 'libsasl' 'libmysqlclient' 'postgresql-libs' 'sqlite3' 'libldap' 'db')
backup=('etc/postfix/'{access,aliases,canonical,generic,header_checks,main.cf,master.cf,relocated,transport,virtual})
source=("ftp://ftp.porcupine.org/mirrors/postfix-release/official/${pkgname}-${pkgver}.tar.gz" \
        'aliases.patch' \
        'rc.d')
sha1sums=('a04a72a8b9436279a30b7d1b62197be63124a132'
          '5fc3de6c7df1e5851a0a379e825148868808318b'
          '40c6be2eb55e6437a402f43775cdb3d22ea87a66')

provides=('smtp-server' 'smtp-forwarder')
replaces=('postfix-mysql' 'postfix-pgsql')
conflicts=('postfix-mysql' 'postfix-pgsql' 'smtp-server' 'smtp-forwarder')

install=install

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

	make makefiles DEBUG='' CCARGS=' \
		-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl \
		-DHAS_LDAP \
		-DUSE_TLS \
		-DHAS_MYSQL -I/usr/include/mysql \
		-DHAS_PGSQL -I/usr/include/postgresql \
		-DHAS_SQLITE \
	' AUXLIBS=' \
		-lsasl2 \
		-lldap -llber \
		-lssl -lcrypto \
		-lmysqlclient -lz -lm \
		-lpq \
		-lsqlite3 -lpthread \
	' OPT="${CFLAGS} ${LDFLAGS}"

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"

	sh postfix-install -non-interactive \
		install_root="${pkgdir}" \
		daemon_directory="/usr/lib/${pkgname}" \
		sample_directory="/etc/${pkgname}/sample" \
		manpage_directory="/usr/share/man"

	install -D -m755 ../rc.d "${pkgdir}/etc/rc.d/${pkgname}"
	install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
	sed 's/\(^\$manpage[^:]*\):/\1.gz:/' -i "${pkgdir}/usr/lib/${pkgname}/postfix-files"
	cd "${pkgdir}"; patch -p0 -i "${srcdir}"/aliases.patch
}