aboutsummaryrefslogtreecommitdiff
path: root/srcpkgs/postfix/template
blob: d8277424ec6a9a45c58c9a8801a18761bb35f44e (plain) (blame)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
# Template file for 'postfix'
pkgname=postfix
version=3.8.5
revision=2
hostmakedepends="perl m4"
makedepends="icu-devel libldap-devel libmariadbclient-devel pcre2-devel
 postgresql-libs-devel sqlite-devel"
short_desc="High-performance mail transport agent"
maintainer="Benjamín Albiñana <benalb@gmail.com>"
license="IPL-1.0, EPL-2.0"
homepage="https://www.postfix.org/"
distfiles="http://ftp.porcupine.org/mirrors/postfix-release/official/${pkgname}-${version}.tar.gz"
checksum=f3e827a2b2e410359ad25d31341970434ab07e36139f9a2ef93981b0ec564c85

system_accounts="postfix"
postfix_homedir="/var/spool/postfix"
system_groups="postdrop"
provides="smtp-server-0_1"
replaces="smtp-server>=0"
conf_files="
	/etc/postfix/access
	/etc/postfix/aliases
	/etc/postfix/canonical
	/etc/postfix/generic
	/etc/postfix/header_checks
	/etc/postfix/main.cf
	/etc/postfix/master.cf
	/etc/postfix/relocated
	/etc/postfix/transport
	/etc/postfix/virtual"
make_dirs="
	/etc/postfix/postfix-files.d	0755	root	root
	/var/lib/postfix		0700	postfix	root
	/var/spool/postfix/active	0700	postfix	root
	/var/spool/postfix/bounce	0700	postfix	root
	/var/spool/postfix/corrupt	0700	postfix	root
	/var/spool/postfix/defer	0700	postfix	root
	/var/spool/postfix/deferred	0700	postfix	root
	/var/spool/postfix/flush	0700	postfix	root
	/var/spool/postfix/hold		0700	postfix	root
	/var/spool/postfix/incoming	0700	postfix	root
	/var/spool/postfix/private	0700	postfix	root
	/var/spool/postfix/maildrop	0730	postfix	postdrop
	/var/spool/postfix/public	0710	postfix	postdrop
	/var/spool/postfix/pid		0755	root	root
	/var/spool/postfix/saved	0700	postfix	root
	/var/spool/postfix/trace	0700	postfix	root"

if [ "$CROSS_BUILD" ]; then
	# XXX postfix-install needs native binaries.
	hostmakedepends+=" $pkgname"
fi

do_build() {
	vsed -e "s,\(/usr/include/db.h\),${XBPS_CROSS_BASE}/\1,g" \
		-e 's,^\(\s\+\)CCARGS="$CCARGS -DNO_EAI",\1CCARGS="$CCARGS $icu_cppflags"\n\1SYSLIBS="$SYSLIBS $icu_ldflags",' \
		-i makedefs

	make makefiles CCARGS=" \
		-DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${XBPS_CROSS_BASE}/usr/include/sasl \
		-DNO_NIS \
		-DHAS_LDAP \
		-DUSE_TLS \
		-DHAS_EAI -I${XBPS_CROSS_BASE}/usr/include \
		-DHAS_MYSQL -I${XBPS_CROSS_BASE}/usr/include/mysql \
		-DHAS_PGSQL -I${XBPS_CROSS_BASE}/usr/include/postgresql \
		-DHAS_SQLITE \
		-DDEF_COMMAND_DIR=\\\"/usr/bin\\\" \
		-DDEF_SENDMAIL_PATH=\\\"/usr/bin/sendmail\\\" \
		-DDEF_README_DIR=\\\"/usr/share/doc/postfix\\\" \
		-DDEF_MANPAGE_DIR=\\\"/usr/share/man\\\" \
	" AUXLIBS=' \
		-lsasl2 \
		-lldap -llber \
		-lssl -lcrypto \
		-lmysqlclient -lz -lm \
		-lpq \
		-lsqlite3 -lpthread \
		-licuuc \
	' OPT="${CFLAGS} ${LDFLAGS}"

	make ${makejobs}
}

pre_install() {
	if [ "$CROSS_BUILD" ]; then
		vsed -e 's,bin/postconf,/usr/bin/postconf,g' -i postfix-install
	fi
}

do_install() {
	sh postfix-install -non-interactive install_root=${DESTDIR}

	vlicense LICENSE
	vlicense TLS_LICENSE

	cd $DESTDIR
	patch -p0 -i ${FILESDIR}/aliases.patch

	vsv postfix
}