Commit 0672c3e0 authored by Natanael Copa's avatar Natanael Copa

extra/postfix,cyrus-sasl: moved postfix 2.6.1 from testing

parent f3d0c8cc
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postfix
pkgver=2.5.6
pkgrel=5
pkgver=2.6.1
pkgrel=0
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 postgresql-dev mysql-dev openldap-dev"
depends="db pcre openssl libsasl"
makedepends="db-dev pcre-dev openssl-dev postgresql-dev mysql-dev openldap-dev cyrus-sasl-dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc $pkgname-ldap $pkgname-mysql $pkgname-pcre
$pkgname-pgsql"
source="ftp://ftp.porcupine.org/mirrors/$pkgname-release/official/$pkgname-$pkgver.tar.gz
$pkgname.initd
$install
postfix-2.5.5-dynamicmaps.patch
postfix-2.6.1-dynamicmaps.patch
dynamicmaps.cf
postfix-ldap.post-install
postfix-mysql.post-install
......@@ -51,8 +51,12 @@ build () {
ccargs="$ccargs -DUSE_TLS"
auxlibs="$auxlibs -lssl -lcrypto"
# dovecot-sasl
ccargs="$ccargs -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
## dovecot-sasl
#ccargs="$ccargs -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
# cyrus sasl
ccargs="$ccargs -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
auxlibs="$auxlibs -lsasl2"
# postgresql
ccargs="$ccargs -DHAS_PGSQL -I$(pg_config --includedir)"
......@@ -99,8 +103,13 @@ build () {
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"/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
install -d -o postfix -g postfix "$pkgdir"/var/spool/postfix
......@@ -124,11 +133,11 @@ mysql() { _mv_dict mysql libmysqlclient;}
pcre() { _mv_dict pcre pcre; }
pgsql() { _mv_dict pgsql libpq; }
md5sums="ec2cb63b53f5f36c3ca91da8f3bc9407 postfix-2.5.6.tar.gz
md5sums="737bbc245da9c72c174893397f70ae86 postfix-2.6.1.tar.gz
8416354d402f3be288fa98b60af86240 postfix.initd
2bfc3864183694e5484ac073bb0cb7ef postfix.pre-install
0064d45c2c8a46c374b55c4abc46cfb2 postfix.post-install
e71b0c501150cba4d30aef52a6fb542c postfix-2.5.5-dynamicmaps.patch
b8812dbf2d076c79cf948ee017e81b39 postfix-2.6.1-dynamicmaps.patch
0efff9b4bb493ad2ff0b9915cb244d14 dynamicmaps.cf
2ebe51a882eb9d6d7866583eb6af3969 postfix-ldap.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-mysql.post-install
......
This diff is collapsed.
postfix-ldap.post-install
\ No newline at end of file
#!/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
postfix-ldap.post-install
\ No newline at end of file
#!/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
postfix-ldap.post-install
\ No newline at end of file
#!/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
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=postfix
pkgver=2.6.1
pkgrel=0
pkgdesc="Secure and fast drop-in replacement for Sendmail (MTA)"
url="http://www.postfix.org/"
license="IPL-1"
depends="db pcre openssl libsasl"
makedepends="db-dev pcre-dev openssl-dev postgresql-dev mysql-dev openldap-dev cyrus-sasl-dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-doc $pkgname-ldap $pkgname-mysql $pkgname-pcre
$pkgname-pgsql"
source="ftp://ftp.porcupine.org/mirrors/$pkgname-release/official/$pkgname-$pkgver.tar.gz
$pkgname.initd
$install
postfix-2.6.1-dynamicmaps.patch
dynamicmaps.cf
postfix-ldap.post-install
postfix-mysql.post-install
postfix-pcre.post-install
postfix-pgsql.post-install
"
# the dynamic maps patch is taken from mandriva
# http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/postfix/current/SOURCES
build () {
cd "$srcdir/$pkgname-$pkgver"
for i in ../*.patch; do
msg "Applying $i..."
patch -p1 < $i || return 1
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|" \
src/util/sys_defs.h || return 1
sed -i -e "s:/usr/local/:/usr/:g" conf/master.cf || return 1
# needed for dynamic maps.
local ccargs="-DHAS_DLOPEN -DHAS_SHL_LOAD"
local auxlibs="$LDFLAGS -lpthread -lcrypt"
ccargs="$ccargs -DDEF_DAEMON_DIR=\\\"/usr/lib/postfix\\\""
# pcre
ccargs="$ccargs -DHAS_PCRE"
#auxlibs="$auxlibs -lpcre"
# ssl
ccargs="$ccargs -DUSE_TLS"
auxlibs="$auxlibs -lssl -lcrypto"
## dovecot-sasl
#ccargs="$ccargs -DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\""
# cyrus sasl
ccargs="$ccargs -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl"
auxlibs="$auxlibs -lsasl2"
# postgresql
ccargs="$ccargs -DHAS_PGSQL -I$(pg_config --includedir)"
#auxlibs="$auxlibs -lpq -L$(pg_config --libdir)"
# mysql
ccargs="$ccargs -DHAS_MYSQL $(mysql_config --include)"
#auxlibs="$auxlibs -lmysqlclient -lm -lz"
# compile
make DEBUG="" \
OPT="$CFLAGS" \
CCARGS="$ccargs" \
AUXLIBS="$auxlibs" \
makefiles || return 1
make OPT="$CFLAGS" || return 1
for i in 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 \
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 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
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
}
_mv_dict() {
local m=$1
shift
pkgdesc="$m map support for postfix"
depends="postfix uclibc $@"
install="postfix-${m}.post-install"
mkdir -p "$subpkgdir"/usr/lib/postfix
mv "$pkgdir"/usr/lib/postfix/dict_${m}.so \
"$subpkgdir"/usr/lib/postfix/
}
ldap() { _mv_dict ldap libldap; }
mysql() { _mv_dict mysql libmysqlclient;}
pcre() { _mv_dict pcre pcre; }
pgsql() { _mv_dict pgsql libpq; }
md5sums="737bbc245da9c72c174893397f70ae86 postfix-2.6.1.tar.gz
8416354d402f3be288fa98b60af86240 postfix.initd
2bfc3864183694e5484ac073bb0cb7ef postfix.pre-install
0064d45c2c8a46c374b55c4abc46cfb2 postfix.post-install
b8812dbf2d076c79cf948ee017e81b39 postfix-2.6.1-dynamicmaps.patch
0efff9b4bb493ad2ff0b9915cb244d14 dynamicmaps.cf
2ebe51a882eb9d6d7866583eb6af3969 postfix-ldap.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-mysql.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-pcre.post-install
2ebe51a882eb9d6d7866583eb6af3969 postfix-pgsql.post-install"
# 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
#pgsq /usr/lib/postfix/dict_pgsql.so dict_pgsql_open
# apk tools will manage the lines below
## AUTO BEGIN ##
## AUTO END ##
#!/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"
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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/mail-mta/postfix/files/postfix.rc6.2.5,v 1.3 2008/08/18 14:18:40 falco Exp $
# If you plan to simultaneously use several Postfix instances, don't forget
# to specify your alternate_config_directories variable in your main main.cf file.
# Then make a symlink from /etc/init.d/postfix to /etc/init.d/postfix.alt,
# prepare your new /etc/postfix.alt environment, and at least change these working paths:
# queue_directory = /var/spool/postfix.alt
# data_directory = /var/lib/postfix.alt
CONF_DIR="/etc/postfix"
CONF_OPT="${SVCNAME##*.}"
if [ -n ${CONF_OPT} -a ${SVCNAME} != "postfix" ]; then
CONF_DIR="${CONF_DIR}.${CONF_OPT}"
fi
opts="${opts} reload"
depend() {
use logger dns ypbind amavisd mysql postgresql antivirus postfix_greylist net saslauthd
if [ "${SVCNAME}" = "postfix" ]; then
provide mta
fi
}
start() {
ebegin "Starting postfix (${CONF_DIR})"
if [ ! -d ${CONF_DIR} ]; then
eend 1 "${CONF_DIR} does not exist"
return 1
fi
/usr/sbin/postfix -c ${CONF_DIR} start >/dev/null 2>&1
eend $?
}
stop() {
ebegin "Stopping postfix (${CONF_DIR})"
/usr/sbin/postfix -c ${CONF_DIR} stop >/dev/null 2>&1
eend $?
}
reload() {
ebegin "Reloading postfix (${CONF_DIR})"
/usr/sbin/postfix -c ${CONF_DIR} reload >/dev/null 2>&1
eend $?
}
#!/bin/sh
chown postfix /var/spool/postfix/* /var/lib/postfix
chgrp postdrop /var/spool/postfix/maildrop /var/spool/postfix/public
exit 0
#!/bin/sh
addgroup postfix 2>/dev/null
addgroup postdrop 2>/dev/null
adduser postfix -h /var/spool/postfix -G postfix,mail 2>/dev/null
exit 0
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