mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-31 22:32:14 +01:00
187 lines
5.9 KiB
Plaintext
187 lines
5.9 KiB
Plaintext
# Contributor: Valery Kartel <valery.kartel@gmail.com>
|
|
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
|
|
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
|
pkgname=postfix
|
|
pkgver=3.1.4
|
|
pkgrel=0
|
|
pkgdesc="Secure and fast drop-in replacement for Sendmail (MTA)"
|
|
url="http://www.postfix.org/"
|
|
arch="all"
|
|
license="IPL-1"
|
|
depends=
|
|
makedepends="db-dev pcre-dev libressl-dev postgresql-dev mariadb-dev openldap-dev
|
|
cyrus-sasl-dev perl file sqlite-dev linux-headers coreutils"
|
|
install="$pkgname.pre-install"
|
|
subpackages="$pkgname-doc $pkgname-ldap $pkgname-mysql $pkgname-pcre
|
|
$pkgname-pgsql $pkgname-sqlite $pkgname-stone"
|
|
options="suid"
|
|
pkgusers="postfix"
|
|
pkggroups="postfix postdrop"
|
|
source="ftp://ftp.porcupine.org/mirrors/$pkgname-release/official/$pkgname-$pkgver.tar.gz
|
|
$pkgname.initd
|
|
no-glibc.patch
|
|
postfix-install.patch
|
|
libressl.patch
|
|
"
|
|
|
|
_shared_libs() {
|
|
file --mime-type "$@" | \
|
|
awk -F: '$2 ~ /sharedlib/ {print $1}'
|
|
}
|
|
|
|
_builddir="$srcdir"/$pkgname-$pkgver
|
|
prepare() {
|
|
cd $_builddir
|
|
for i in $source; do
|
|
case $i in
|
|
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
|
|
esac
|
|
done
|
|
|
|
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
|
|
}
|
|
|
|
build() {
|
|
cd $_builddir
|
|
# needed for dynamic maps.
|
|
local ccargs="-DHAS_SHL_LOAD -DDEF_DAEMON_DIR=\\\"/usr/lib/postfix\\\""
|
|
local auxlibs="$LDFLAGS"
|
|
|
|
# pcre
|
|
ccargs="$ccargs -DHAS_PCRE $(pkg-config --cflags libpcre)"
|
|
|
|
# ssl
|
|
ccargs="$ccargs -DUSE_TLS"
|
|
auxlibs="$auxlibs -lssl -lcrypto"
|
|
|
|
# dovecot-sasl
|
|
ccargs="$ccargs -DUSE_SASL_AUTH -DDEF_SASL_SERVER=\\\"dovecot\\\""
|
|
|
|
# cyrus sasl
|
|
ccargs="$ccargs -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
|
|
auxlibs="$auxlibs -lsasl2"
|
|
|
|
# postgresql
|
|
ccargs="$ccargs -DHAS_PGSQL $(pkg-config --cflags libpq)"
|
|
|
|
# mysql
|
|
ccargs="$ccargs -DHAS_MYSQL $(mysql_config --include)"
|
|
|
|
# ldap
|
|
ccargs="$ccargs -DHAS_LDAP -DUSE_LDAP_SASL"
|
|
|
|
# sqlite
|
|
ccargs="$ccargs -DHAS_SQLITE $(pkg-config --cflags sqlite3)"
|
|
|
|
#
|
|
# AUXLIBS_CDB="$cdb_libs" \
|
|
# AUXLIBS_LMDB="$lmdb_libs" \
|
|
|
|
# compile
|
|
make DEBUG="" \
|
|
OPT="$CFLAGS" \
|
|
CCARGS="$ccargs" \
|
|
AUXLIBS="$auxlibs" \
|
|
AUXLIBS_LDAP="-lldap -llber" \
|
|
AUXLIBS_MYSQL="$(mysql_config --libs)" \
|
|
AUXLIBS_PCRE="$(pkg-config --libs libpcre)" \
|
|
AUXLIBS_PGSQL="$(pkg-config --libs libpq)" \
|
|
AUXLIBS_SQLITE="$(pkg-config --libs sqlite3)" \
|
|
dynamicmaps=yes \
|
|
shared=yes \
|
|
makefiles || return 1
|
|
|
|
make OPT="$CFLAGS" || return 1
|
|
}
|
|
|
|
_mvline() {
|
|
local regex="$1"
|
|
local outfile="$3.d/$2"
|
|
local infile="$3"
|
|
sed -i -E -e "\|$regex|{
|
|
w $outfile
|
|
d
|
|
}" $infile
|
|
}
|
|
|
|
package() {
|
|
cd $_builddir
|
|
make non-interactive-package \
|
|
install_root="$pkgdir" \
|
|
readme_directory=/usr/share/doc/$pkgname/readme \
|
|
manpage_directory=/usr/share/man \
|
|
shlib_directory=/usr/lib/postfix \
|
|
|| 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"/usr/share/doc/postfix/defaults/ \
|
|
"$pkgdir"/usr/share/licenses/${pkgname}/
|
|
mv "$pkgdir"/etc/postfix/*.default "$pkgdir"/etc/postfix/*.proto \
|
|
"$pkgdir"/usr/share/doc/postfix/defaults/ || return 1
|
|
mv "$pkgdir"/etc/postfix/*LICENSE* \
|
|
"$pkgdir"/usr/share/licenses/${pkgname}/ || return 1
|
|
|
|
install -d -o postfix -g postfix "$pkgdir"/var/spool/postfix
|
|
install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
|
|
chown postfix "$pkgdir"/var/spool/postfix/* "$pkgdir"/var/lib/postfix \
|
|
|| return 1
|
|
chgrp postdrop "$pkgdir"/var/spool/postfix/maildrop \
|
|
"$pkgdir"/var/spool/postfix/public || return 1
|
|
|
|
cd "$pkgdir"/etc/postfix/ || return 1
|
|
for map in ldap mysql pcre pgsql sqlite; do
|
|
msg "split $map"
|
|
_mvline "^\s*$map" "$map" dynamicmaps.cf || return 1
|
|
done
|
|
rm makedefs.out
|
|
}
|
|
|
|
_mv_dict() {
|
|
local m=$1
|
|
shift
|
|
pkgdesc="$m map support for postfix"
|
|
depends=
|
|
mkdir -p "$subpkgdir"/usr/lib/postfix \
|
|
"$subpkgdir"/etc/postfix/dynamicmaps.cf.d
|
|
mv "$pkgdir"/usr/lib/postfix/postfix-${m}.so \
|
|
"$subpkgdir"/usr/lib/postfix/ || return 1
|
|
mv "$pkgdir"/etc/postfix/dynamicmaps.cf.d/${m} \
|
|
"$subpkgdir"/etc/postfix/dynamicmaps.cf.d/ || return 1
|
|
}
|
|
|
|
ldap() { _mv_dict ldap ; }
|
|
mysql() { _mv_dict mysql ;}
|
|
pcre() { _mv_dict pcre ; }
|
|
pgsql() { _mv_dict pgsql ; }
|
|
sqlite() { _mv_dict sqlite ; }
|
|
|
|
stone() {
|
|
cd $_builddir
|
|
pkgdesc="Postfix simulation and testing tools"
|
|
install -Dm755 src/fsstone/fsstone "$subpkgdir"/usr/bin/fsstone
|
|
find src/smtpstone -perm 0755 -exec cp {} "$subpkgdir"/usr/bin \;
|
|
}
|
|
|
|
md5sums="878a059d92ee3b093d7d3e97248c915d postfix-3.1.4.tar.gz
|
|
82c78ea8cb77a55f563d2086b73c36e2 postfix.initd
|
|
b7ed1614fafb5fed6253b1a62f76b709 no-glibc.patch
|
|
3c58426d21611dd4eb1f93e924b349a1 postfix-install.patch
|
|
0dd5ea7b09cdfdf8ee1379cff5664391 libressl.patch"
|
|
sha256sums="f33b470c47ae8b4ff199ab55dc42e86031ff0c535ccbc83069c8cff69b5bd027 postfix-3.1.4.tar.gz
|
|
2f744cfe9c3a0bac8e15c1e2347ff38283cb323617740f853e01d9eade7957ee postfix.initd
|
|
e8d7c4b3edab2388c9aba6c9ce70ff141ae7aacbd6480e233711241d90b14563 no-glibc.patch
|
|
7185d2b2e4d7cc090b958c1d372c16e15f274465e2123686a0d97db20e2b5943 postfix-install.patch
|
|
ed9864b3ee8ef756f0438b743012dc91cf702d0bfa04736761ca2799156ec1be libressl.patch"
|
|
sha512sums="4cf8aa8d0cf6d99defa32c2907705370d6f8d047d7e938c84a20a62c68ae07a2bec304f28c178d1072b9610f2969420f83fe2066821ad34c0f95e62bbb5b8c05 postfix-3.1.4.tar.gz
|
|
2752e69c4e1857bdcf29444ffb458bca818bc60b9c77c20823c5f5b87c36cb5e0f3217a625a7fe5788d5bfcef7570a1f2149e1233fcd23ccf7ee14190aff47a2 postfix.initd
|
|
cf9ef0d07e54011107da57e2855cbda10047c100047e2cc2fdede072ace1fc6c060a6b1cfc8c277417a28a23ecd3c6ffdc061da1673e8f61d2ed11899f1efb25 no-glibc.patch
|
|
25cd34f23ca909d4e33aaf3239d1e397260abc7796d9a4456dee4f005682fd3a58aab8106126e5218c95bdddae415a3ef7e2223cd3b0d7b1e2bd76158bb7eaf8 postfix-install.patch
|
|
753b4e9e5cbad0b6af01152903b73e0b95018ed3f3152a67f366c38497bca7b54b139acb444841e0c8ce2a5efdd0224172fe57c2d24a12a37a9bd8440aa793c2 libressl.patch"
|