Commit 228e06b4 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/postfix: upgrade to 3.0.1

parent 4fa7d32d
# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postfix
pkgver=2.11.3
pkgrel=1
pkgver=3.0.1
pkgrel=0
pkgdesc="Secure and fast drop-in replacement for Sendmail (MTA)"
url="http://www.postfix.org/"
arch="all"
......@@ -16,19 +16,9 @@ subpackages="$pkgname-doc $pkgname-ldap $pkgname-mysql $pkgname-pcre
options="suid"
source="ftp://ftp.porcupine.org/mirrors/$pkgname-release/official/$pkgname-$pkgver.tar.gz
$pkgname.initd
dynamic-maps.patch
no-glibc.patch
dynamicmaps.cf
postfix-ldap.post-install
postfix-mysql.post-install
postfix-pcre.post-install
postfix-pgsql.post-install
postfix-sqlite.post-install
"
# the dynamic maps patch is taken from mandriva
# http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/postfix/current/SOURCES
_shared_libs() {
file --mime-type "$@" | \
awk -F: '$2 ~ /sharedlib/ {print $1}'
......@@ -41,7 +31,6 @@ prepare() {
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
cp ../dynamicmaps.cf conf/
sed -i -e "s|#define HAS_NIS|//#define HAS_NIS|g" \
-e "/^#define ALIAS_DB_MAP/s|:/etc/aliases|:/etc/postfix/aliases|" \
......@@ -52,7 +41,7 @@ prepare() {
build () {
cd "$srcdir/$pkgname-$pkgver"
# needed for dynamic maps.
local ccargs="-DHAS_DLOPEN -DHAS_SHL_LOAD"
local ccargs="-DHAS_SHL_LOAD"
local auxlibs="$LDFLAGS -lpthread -lcrypt"
ccargs="$ccargs -DDEF_DAEMON_DIR=\\\"/usr/lib/postfix\\\""
......@@ -92,57 +81,56 @@ build () {
OPT="$CFLAGS" \
CCARGS="$ccargs" \
AUXLIBS="$auxlibs" \
dynamicmaps=yes \
shared=yes \
makefiles || return 1
make -j1 OPT="$CFLAGS" || 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 "$srcdir/$pkgname-$pkgver"
for i in $(_shared_libs lib/*.a); do
j=${i#lib/lib}
ln -s ${i#lib/} lib/libpostfix-${j%.a}.so.1
done
# install to pkgdir
LD_LIBRARY_PATH=$PWD/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} make \
non-interactive-package \
make non-interactive-package \
install_root="$pkgdir" \
config_directory=/usr/share/doc/$pkgname/defaults \
readme_directory=/usr/share/doc/$pkgname/readme \
manpage_directory=/usr/share/man \
|| return 1
install -d "$pkgdir"/usr/lib
for i in $(_shared_libs lib/*.a); do
j=${i#lib/lib}
install $i "$pkgdir"/usr/lib/libpostfix-${j%.a}.so.1 || return 1
done
# fix permissions
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/aliases \
"$pkgdir"/usr/share/doc/$pkgname/defaults/canonical \
"$pkgdir"/usr/share/doc/$pkgname/defaults/generic \
"$pkgdir"/usr/share/doc/$pkgname/defaults/header_checks \
"$pkgdir"/usr/share/doc/$pkgname/defaults/relocated \
"$pkgdir"/usr/share/doc/$pkgname/defaults/transport \
"$pkgdir"/usr/share/doc/$pkgname/defaults/virtual \
"$pkgdir"/etc/postfix/ || return 1
mkdir -p "$pkgdir"/usr/share/doc/postfix/defaults/ \
"$pkgdir"/usr/share/licenses/${pkgname}/
mv "$pkgdir"/etc/postfix/*.default \
"$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
install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/${pkgname}/LICENSE
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
}
_mv_dict() {
......@@ -150,10 +138,12 @@ _mv_dict() {
shift
pkgdesc="$m map support for postfix"
depends=
install="postfix-${m}.post-install"
mkdir -p "$subpkgdir"/usr/lib/postfix
mv "$pkgdir"/usr/lib/postfix/dict_${m}.so \
"$subpkgdir"/usr/lib/postfix/
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 ; }
......@@ -162,33 +152,12 @@ pcre() { _mv_dict pcre ; }
pgsql() { _mv_dict pgsql ; }
sqlite() { _mv_dict sqlite ; }
md5sums="c3f0f51d8865559b40e9350eb3816011 postfix-2.11.3.tar.gz
md5sums="3ec1416e7d4fba9566297c8fcf7a348c postfix-3.0.1.tar.gz
d773f01dcc965d219a8a37b88f89c5bf postfix.initd
c03239969df760e2a74c4e048ce514a1 dynamic-maps.patch
cd39f4c05a6462c121a3ab3612d6a5bd no-glibc.patch
442efd1a95b0c061dfb8ab75456e0f24 dynamicmaps.cf
2ebe51a882eb9d6d7866583eb6af3969 postfix-ldap.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-mysql.post-install
fd16ec00b60269c4ede4a0a0a514cefa postfix-pcre.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-pgsql.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-sqlite.post-install"
sha256sums="04e5146e6e56261baae9f63c590348a4b12ce22d3d46260e26e97233f40802c3 postfix-2.11.3.tar.gz
b7ed1614fafb5fed6253b1a62f76b709 no-glibc.patch"
sha256sums="cd2bd6447fe3368bb1a39f482f8dd1eec87c63067a0eb75f9aec8e4eadd21328 postfix-3.0.1.tar.gz
6b3fe71542ab783c7adddbfa161f7e2dcb2325913ad5d611ca56f730876ce4ab postfix.initd
cfa5000955f1941082567a9e50764f52851f33c468f534c0431f6932d73e8ffb dynamic-maps.patch
ad2d6b6889ea2e8b1eab05c87f153a1a2ce82e3a877e1235b595a990266dfc04 no-glibc.patch
2041ff6cd71fe16f3d75603ff40d90a08a8b97f0883e1de1d58563ab1521b5ea dynamicmaps.cf
fbd75ef31a5d78d5f82b67e08e5bf5ada380afa58a69ef4a07d756c47b3bb498 postfix-ldap.post-install
fbd75ef31a5d78d5f82b67e08e5bf5ada380afa58a69ef4a07d756c47b3bb498 postfix-mysql.post-install
8dbe9339aeac4932e5ee383bfe497512607cd819fe67c38cbf7273118c4b0f71 postfix-pcre.post-install
fbd75ef31a5d78d5f82b67e08e5bf5ada380afa58a69ef4a07d756c47b3bb498 postfix-pgsql.post-install
fbd75ef31a5d78d5f82b67e08e5bf5ada380afa58a69ef4a07d756c47b3bb498 postfix-sqlite.post-install"
sha512sums="b371f1099b1e6e653242a9b4f3812b38b6a9145a4f4c1c9fa5bef6a02e1a9a8f4ec2979c8946f6c873e303ac54f5dd1a84b934eeea8169e2ce187028c36c857e postfix-2.11.3.tar.gz
e8d7c4b3edab2388c9aba6c9ce70ff141ae7aacbd6480e233711241d90b14563 no-glibc.patch"
sha512sums="17916f6dc7113589b011dbf6a6bb54cb9f6d0d5f176fb3c877d4a5a09ac62c4faf088bf1eba0b41c6d2b9d55660fd4c52d4ba2a01f82db3679322756b6da6f37 postfix-3.0.1.tar.gz
c179534a7243bcf8c19b5367a703b54fcc88b7587ce7ef07ec111cfe00053779eed23b3ccda81eb20059599b857cae0a57cc02613526209f3dd966d65abd9a3f postfix.initd
1a92089410691d400953472be522c872be1456521203560a4feadb632cb85cfacaf3721108d62111873fb23478976b8a949077734cf801374ca58bcaf363922c dynamic-maps.patch
4d2624ee98f798f8818789433b05cce4ee337750e93ee49c4074bc0c741c678d426c42bd09088596d5010f0bc680ec3b5aed630acfd3d5513512f6a6af15b61c no-glibc.patch
49b8205166f575e5fb9bdaaaaa042dc1be9b556331bf659a55b1115c9fa48486896941f18ca9fb633dd54675079f29a9d69d53c214170731c2127862456ec90b dynamicmaps.cf
b35931865eb15b5cd6a2b95bbf486cd064d1447eac1a91d507a7d23155229ac7e7fdf6b8518e663c5c7072b201786c72aead0d95e94d8708a9b5a7c3f37be138 postfix-ldap.post-install
b35931865eb15b5cd6a2b95bbf486cd064d1447eac1a91d507a7d23155229ac7e7fdf6b8518e663c5c7072b201786c72aead0d95e94d8708a9b5a7c3f37be138 postfix-mysql.post-install
845871cacebb8c4d2073783db06a704c993d258f3113ac6c416e742f87649e8eababceb5f8426849256e7815c492e24654468ee76e7607d91b506e8cba78f2ed postfix-pcre.post-install
b35931865eb15b5cd6a2b95bbf486cd064d1447eac1a91d507a7d23155229ac7e7fdf6b8518e663c5c7072b201786c72aead0d95e94d8708a9b5a7c3f37be138 postfix-pgsql.post-install
b35931865eb15b5cd6a2b95bbf486cd064d1447eac1a91d507a7d23155229ac7e7fdf6b8518e663c5c7072b201786c72aead0d95e94d8708a9b5a7c3f37be138 postfix-sqlite.post-install"
cf9ef0d07e54011107da57e2855cbda10047c100047e2cc2fdede072ace1fc6c060a6b1cfc8c277417a28a23ecd3c6ffdc061da1673e8f61d2ed11899f1efb25 no-glibc.patch"
This diff is collapsed.
# Postfix dynamic maps configuration file.
#
# The first match found is the one that is used. Wildcards are not
# supported.
#
#type location of .so file name of open function
#==== ============================= =====================
#ldap /usr/lib/postfix/dict_ldap.so dict_ldap_open
#mysql /usr/lib/postfix/dict_mysql.so dict_mysql_open
#pcre /usr/lib/postfix/dict_pcre.so dict_pcre_open
#regex /usr/lib/postfix/dict_pcre.so dict_pcre_open
#pgsql /usr/lib/postfix/dict_pgsql.so dict_pgsql_open
# apk tools will manage the lines below
## AUTO BEGIN ##
## AUTO END ##
Check if we have __GLIBC__ defined at all before checking version
http://bugs.alpinelinux.org/issues/3423
This fixes the following when compiled with musl libc:
warning: unix_send_fd: your system has no support for file descriptor passing
--- ./src/util/sys_defs.h.orig
+++ ./src/util/sys_defs.h
@@ -810,7 +810,7 @@
# define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
@@ -812,7 +812,7 @@
#define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \
- || (__GLIBC__ < 2)
+ || (defined(__GLIBC__) && (__GLIBC__ < 2))
# define CANT_USE_SEND_RECV_MSG
# define DEF_SMTP_CACHE_DEMAND 0
#define CANT_USE_SEND_RECV_MSG
#define DEF_SMTP_CACHE_DEMAND 0
#else
#!/bin/sh
# update the dynamicmaps.cf
conf=/etc/postfix/dynamicmaps.cf
sed -i -e '/\#\# AUTO BEGIN/,/\#\# AUTO END/d' $conf
(
echo '## AUTO BEGIN ##'
if cd /usr/lib/postfix/; then
for i in *.so; do
m=${i#dict_}
m=${m%.so}
echo -e "$m\t/usr/lib/postfix/$i\tdict_${m}_open"
done
fi
echo '## AUTO END ##'
) >> $conf
#!/bin/sh
# update the dynamicmaps.cf
conf=/etc/postfix/dynamicmaps.cf
sed -i -e '/\#\# AUTO BEGIN/,/\#\# AUTO END/d' $conf
(
echo '## AUTO BEGIN ##'
if cd /usr/lib/postfix/; then
for i in *.so; do
m=${i#dict_}
m=${m%.so}
echo -e "$m\t/usr/lib/postfix/$i\tdict_${m}_open"
done
fi
echo '## AUTO END ##'
) >> $conf
#!/bin/sh
# update the dynamicmaps.cf
conf=/etc/postfix/dynamicmaps.cf
sed -i -e '/\#\# AUTO BEGIN/,/\#\# AUTO END/d' $conf
(
echo '## AUTO BEGIN ##'
if cd /usr/lib/postfix/; then
for i in *.so; do
m=${i#dict_}
m=${m%.so}
echo -e "$m\t/usr/lib/postfix/$i\tdict_${m}_open"
# pcre also handles regexp
if [ "$m" = "pcre" ]; then
echo -e "regex\t/usr/lib/postfix/$i\tdict_${m}_open"
fi
done
fi
echo '## AUTO END ##'
) >> $conf
#!/bin/sh
# update the dynamicmaps.cf
conf=/etc/postfix/dynamicmaps.cf
sed -i -e '/\#\# AUTO BEGIN/,/\#\# AUTO END/d' $conf
(
echo '## AUTO BEGIN ##'
if cd /usr/lib/postfix/; then
for i in *.so; do
m=${i#dict_}
m=${m%.so}
echo -e "$m\t/usr/lib/postfix/$i\tdict_${m}_open"
done
fi
echo '## AUTO END ##'
) >> $conf
#!/bin/sh
# update the dynamicmaps.cf
conf=/etc/postfix/dynamicmaps.cf
sed -i -e '/\#\# AUTO BEGIN/,/\#\# AUTO END/d' $conf
(
echo '## AUTO BEGIN ##'
if cd /usr/lib/postfix/; then
for i in *.so; do
m=${i#dict_}
m=${m%.so}
echo -e "$m\t/usr/lib/postfix/$i\tdict_${m}_open"
done
fi
echo '## AUTO END ##'
) >> $conf
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment