APKBUILD 1.85 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1 2 3
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postfix
pkgver=2.5.6
4
pkgrel=1
Natanael Copa's avatar
Natanael Copa committed
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
pkgdesc="Secure and fast drop-in replacement for Sendmail (MTA)"
url="http://www.postfix.org/"
license="IPL-1"
depends="db pcre openssl"
makedepends="db-dev pcre-dev openssl-dev"
install=postfix.install
subpackages="$pkgname-doc"
source="ftp://ftp.porcupine.org/mirrors/$pkgname-release/official/$pkgname-$pkgver.tar.gz
	$pkgname.initd
	$install
	"

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

	sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
		-e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/postfix/aliases|" \
		src/util/sys_defs.h || return 1
	sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || return 1

	make DEBUG="" \
		OPT="$CFLAGS" \
		CCARGS="-DHAS_PCRE -DUSE_TLS -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"" \
		AUXLIBS="$LDFLAGS -lpcre -lcrypt -lpthread -lssl -lcrypto" \
		makefiles || return 1
	make OPT="$CFLAGS" || return 1

	sh postfix-install \
		-non-interactive \
		install_root="$pkgdir" \
		config_directory=/usr/share/doc/$pkgname/defaults \
		readme_directory=/usr/share/doc/$pkgname/readme \
		manpage_directory=/usr/share/man \
		|| return 1
	for i in postdrop postqueue; do
		chgrp postdrop "$pkgdir"/usr/sbin/$i
		chmod g+s "$pkgdir"/usr/sbin/$i
	done

	mkdir -p "$pkgdir"/etc/postfix
	mv "$pkgdir"/usr/share/doc/$pkgname/defaults/*.cf \
		"$pkgdir"/usr/share/doc/$pkgname/defaults/post*-* \
		"$pkgdir"/usr/share/doc/$pkgname/defaults/aliases \
		"$pkgdir"/etc/postfix/ || return 1

	install -d -o postfix -g postfix "$pkgdir"/var/spool/postfix
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE
}
md5sums="ec2cb63b53f5f36c3ca91da8f3bc9407  postfix-2.5.6.tar.gz
8416354d402f3be288fa98b60af86240  postfix.initd
a62143036f227a7e781b57a97457d180  postfix.install"