core/postfix/PKGBUILD

99 lines
3.2 KiB
Bash
Raw Normal View History

2016-03-28 23:31:03 +08:00
pkgname=postfix
2018-01-05 07:19:28 +08:00
pkgver=3.2.4
pkgrel=1
2016-03-28 23:31:03 +08:00
pkgdesc='Fast, easy to administer, secure mail server'
2011-09-14 00:24:27 +08:00
url='http://www.postfix.org/'
2013-02-18 01:49:29 +08:00
arch=('x86_64')
license=('custom')
depends=('openssl' 'pcre' 'icu' 'libsasl' 'libldap' 'db'
'libmariadbclient' 'postgresql-libs' 'sqlite3' 'tinycdb')
source=("ftp://ftp.porcupine.org/mirrors/postfix-release/official/${pkgname}-${pkgver}.tar.gz"{,.gpg2}
'aliases.patch'
2018-01-05 07:19:28 +08:00
'postfix.service'
'sysusers.d')
sha1sums=('86de2f38ca0894f42b9473bec6ac061ed6369c9a'
'6eff4e3c46c5dacb0ab01a84b83b5baac18ee3af'
2016-03-28 23:31:03 +08:00
'5fc3de6c7df1e5851a0a379e825148868808318b'
2018-01-05 07:19:28 +08:00
'dd12885d367bebaf0fc9d2e9823a7f82086b6ee9'
'5b364374b134cade1d9465d68f59a61f883d484f')
2016-03-28 23:31:03 +08:00
backup=('etc/postfix/'{access,aliases,canonical,generic,header_checks,main.cf,master.cf,relocated,transport,virtual})
validpgpkeys=('622C7C012254C186677469C50C0B590E80CA15A7') # Wietse Venema
2016-03-28 23:31:03 +08:00
conflicts=('smtp-server' 'smtp-forwarder' 'postfix-tools')
provides=('smtp-server' 'smtp-forwarder' 'postfix-tools')
replaces=('postfix-tools')
2011-09-14 00:24:27 +08:00
2016-03-28 23:31:03 +08:00
build() {
cd $pkgname-$pkgver
2016-03-28 23:31:03 +08:00
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
2018-01-05 07:19:28 +08:00
-DHAS_CDB
2016-03-28 23:31:03 +08:00
-DDEF_COMMAND_DIR=\"/usr/bin\"
2018-01-05 07:19:28 +08:00
-DDEF_DAEMON_DIR=\"/usr/lib/postfix/bin\"
2016-03-28 23:31:03 +08:00
-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
-lcdb
'
2016-03-28 23:31:03 +08:00
make makefiles \
DEBUG='' \
pie=yes \
shared=yes \
CCARGS="${CCARGS//$'\n'/}" \
AUXLIBS="${AUXLIBS//$'\n'/}" \
OPT="${CFLAGS} ${LDFLAGS}"
2016-03-28 23:31:03 +08:00
make
2015-01-06 05:15:44 +08:00
}
2016-03-28 23:31:03 +08:00
package() {
2018-01-05 07:19:28 +08:00
cd $pkgname-$pkgver
2016-03-28 23:31:03 +08:00
2018-01-05 07:19:28 +08:00
sed 's:bin/postconf -dhx:bin/postconf -c conf -dhx:g' -i postfix-install
LD_LIBRARY_PATH=lib:$LD_LIBRARY_PATH \
sh postfix-install -non-interactive install_root="$pkgdir"
2016-03-28 23:31:03 +08:00
2018-01-05 07:19:28 +08:00
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 ../postfix.service "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
install -Dm644 ../sysusers.d "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
2015-01-06 05:15:44 +08:00
2018-01-05 07:19:28 +08:00
for name in posttls-finger {smtp,qmqp}-{sink,source}; do
2016-03-28 23:31:03 +08:00
install -Dm644 "man/man1/${name}.1" "$pkgdir/usr/share/man/man1/${name}.1"
install -Dm755 "bin/${name}" "$pkgdir/usr/bin/${name}"
2018-01-05 07:19:28 +08:00
done
# now set permissions right to appease the pacman gods
sed -r \
-e '/override=1/d' \
-e '/absolute path name/d' \
-e 's/\$POSTCONF -/$POSTCONF -c .\/etc\/postfix -/g' \
-e '/(if \[|chmod|chown|find|mkdir|test)/s/\$path/.\/$path/g' \
libexec/post-install > ../arch-post-install
cd "${pkgdir}"
LD_LIBRARY_PATH=usr/lib/postfix:$LD_LIBRARY_PATH \
sh "${srcdir}/arch-post-install" \
command_directory=usr/bin \
config_directory=etc/postfix \
meta_directory=etc/postfix \
setgid_group=75 \
mail_owner=73 \
set-permissions
2015-01-06 05:15:44 +08:00
2018-01-05 07:19:28 +08:00
patch --no-backup-if-mismatch -p0 -i "${srcdir}"/aliases.patch
sed 's/^\(\$manpage[^:]*\):/\1.gz:/' -i "etc/postfix/postfix-files"
}