Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 22bfd645c1978a46f8f04e362b8d86df > files > 35

postfix-2.1.5-6mdk.src.rpm

# compatability macros
%{?!mkrel:%define mkrel(c:) %{-c:0.%{-c*}.}%{!?_with_unstable:%(perl -e '$_="%{1}";m/(.\*)(\\d+)$/;$rel=${2}-1;re;print "$1$rel";').%{?subrel:%subrel}%{!?subrel:1}.%{?distversion:%distversion}%{?!distversion:%(echo $[%{mdkversion}/10])}}%{?_with_unstable:%{1}}%{?distsuffix:%distsuffix}%{?!distsuffix:mdk}}

%{?!_with_unstable: %{error:%(echo -e "\n\n\nYou are building package for a stable release, please see \nhttp://qa.mandrakesoft.com/twiki/bin/view/Main/DistroSpecificReleaseTag\nif you think this is incorrect\n\n\n ")}%(sleep 2)}

# If set to 0 if official version, 1 if snapshot
%define experimental	0
%{?_without_experimental:   %{expand: %%global experimental 0}}
%{?_with_experimental:   %{expand: %%global experimental 1}}
# call package postfix-experimental?
# it cannot be parallel installed anyway
%if %{experimental}
%define parallel	1
%else
%define parallel	0
%endif
%{?_without_parallel:   %{expand: %%global parallel 0}}
%{?_with_parallel:   %{expand: %%global parallel 1}}

%define pname		postfix
%define pver		2.1.5
%define releasedate	20040913
%define prel		6
# THIS IS USED FOR UPDATES/BACKPORTS
%define subver		1
%define	tlsver		0.8.18
%define	openssl_ver	0.9.7
%define	openssl_letter	d
%define ipv6ver		1.26

%if ! %{experimental}
%define distver		%pver
%define distverdot	%pver
%define ftp_directory	official
%else
%define distver		%pver-%releasedate
%define distverdot	%pver.%releasedate
%define ftp_directory	experimental
%endif

#define tlsno 		pfixtls-%{tlsver}-%{distver}-%{openssl_ver}%{openssl_letter}
%define tlsno 		pfixtls-%{tlsver}-2.1.3-%{openssl_ver}%{openssl_letter}
#use this if i had to rediff tls
%define tls_rediff	0
%define tls_patch	%{nil}

%define ipv6no 		tls+ipv6-%{ipv6ver}-pf-%{distver}

%define alternatives 	1
%define alternatives_install_cmd update-alternatives --install %{_sbindir}/sendmail mta %{_sbindir}/sendmail.postfix 30 --slave %{_prefix}/lib/sendmail mta-in_libdir %{_sbindir}/sendmail.postfix --slave %{_bindir}/mailq mta-mailq %{_bindir}/mailq.postfix --slave %{_bindir}/newaliases mta-newaliases %{_bindir}/newaliases.postfix --slave %{_bindir}/rmail mta-rmail %{_bindir}/rmail.postfix --slave %{_mandir}/man1/mailq.1.bz2 mta-mailqman %{_mandir}/man1/mailq.postfix.1.bz2 --slave %{_mandir}/man1/newaliases.1.bz2 mta-newaliasesman %{_mandir}/man1/newaliases.postfix.1.bz2 --slave %{_mandir}/man5/aliases.5.bz2 mta-aliasesman %{_mandir}/man5/aliases.postfix.5.bz2 --slave %{_sysconfdir}/aliases mta-etc_aliases %{_sysconfdir}/postfix/aliases

%if %alternatives
%define post_install_parameters	daemon_directory=%{_libdir}/postfix command_directory=%{_sbindir} queue_directory=%{queue_directory} sendmail_path=%{_sbindir}/sendmail.postfix newaliases_path=%{_bindir}/newaliases.postfix mailq_path=%{_bindir}/mailq.postfix mail_owner=postfix setgid_group=%{maildrop_group} manpage_directory=%{_mandir} sample_directory=%{_docdir}/%name-%version/samples readme_directory=%{_docdir}/%name-%version/README_FILES html_directory=%{_docdir}/%name-%version/html 
%else
%define post_install_parameters	daemon_directory=%{_libdir}/postfix command_directory=%{_sbindir} queue_directory=%{queue_directory} sendmail_path=%{_sbindir}/sendmail newaliases_path=%{_bindir}/newaliases mailq_path=%{_bindir}/mailq mail_owner=postfix setgid_group=%{maildrop_group} manpage_directory=%{_mandir} sample_directory=%{_docdir}/%name-%version/samples readme_directory=%{_docdir}/%name-%version/README_FILES html_directory=%{_docdir}/%name-%version/html 
%endif

%define dynamicmaps	1

%define with_LDAP	1  
%define with_MYSQL	1
%define with_PGSQL	1
%define with_PCRE	1
%define with_SASL	1
%define with_TLS	0
%define with_IPV6	1
%define with_PAM	0
%define with_SMTPD_MULTILINE_GREETING	0
%define with_VDA	0
%define with_MUNGE_BARECR	0
%define with_CHROOT 	1

%{?_without_ldap:  %{expand: %%global with_LDAP 0}}
%{?_without_mysql: %{expand: %%global with_MYSQL 0}}
%{?_without_pgsql: %{expand: %%global with_PGSQL 0}}
%{?_without_pcre:  %{expand: %%global with_PCRE 0}}
%{?_without_sasl:  %{expand: %%global with_SASL 0}}
%{?_without_tls:   %{expand: %%global with_TLS 0}}
%{?_without_ipv6:   %{expand: %%global with_IPV6 0}}
%{?_without_pam:   %{expand: %%global with_PAM 0}}
%{?_without_multiline:   %{expand: %%global with_SMTPD_MULTILINE_GREETING 0}}
%{?_without_VDA:   %{expand: %%global with_VDA 0}}
%{?_without_barecr:   %{expand: %%global with_MUNGE_BARECR 0}}
%{?_without_chroot:   %{expand: %%global with_CHROOT 0}}

%{?_with_ldap:  %{expand: %%global with_LDAP 1}}
%{?_with_mysql: %{expand: %%global with_MYSQL 1}}
%{?_with_pgsql: %{expand: %%global with_PGSQL 1}}
%{?_with_pcre:  %{expand: %%global with_PCRE 1}}
%{?_with_sasl:  %{expand: %%global with_SASL 1}}
%{?_with_tls:   %{expand: %%global with_TLS 1}}
%{?_with_tls:   %{expand: %%global with_IPV6 0}}
%{?_with_ipv6:   %{expand: %%global with_IPV6 1}}
%{?_with_ipv6:   %{expand: %%global with_TLS 0}}
%{?_with_pam:   %{expand: %%global with_PAM 1}}
%{?_with_multiline:   %{expand: %%global with_SMTPD_MULTILINE_GREETING 1}}
%{?_with_VDA:   %{expand: %%global with_VDA 1}}
%{?_with_barecr:   %{expand: %%global with_MUNGE_BARECR 1}}
%{?_with_chroot:   %{expand: %%global with_CHROOT 1}}

# Postfix requires one exlusive uid/gid and a 2nd exclusive gid for its own use.
%define maildrop_group	postdrop
%define queue_directory	%{_var}/spool/postfix

%if %{dynamicmaps}
%define dynmap_add_cmd() FILE=%{_sysconfdir}/postfix/dynamicmaps.cf; if ! grep -q "^%{1}[[:space:]]" ${FILE}; then echo "%{1}	%{_libdir}/postfix/dict_%{1}.so	dict_%{1}_open" >> ${FILE}; fi
%define dynmap_rm_cmd() FILE=%{_sysconfdir}/postfix/dynamicmaps.cf; if [ $1 = 0 -a -s $FILE ]; then  cp -p ${FILE} ${FILE}.$$; grep -v "^%{1}[[:space:]]" ${FILE}.$$ > ${FILE}; rm -f ${FILE}.$$; fi
%endif

%if ! %{parallel}
Name:		%{pname}
Version:	%{distverdot}
Release:	%mkrel %{prel}
Conflicts:	%{pname}-experimental
%else
Name:		%{pname}-experimental
Version:	%{pver}
Release:	mkrel -c %{releasedate} %{prel}
Provides:	%{pname}
Conflicts:	%{pname}
%endif
Summary:	Postfix Mail Transport Agent
Epoch:		1
URL:		http://www.postfix.org/
Source0: 	ftp://ftp.porcupine.org/mirrors/postfix-release/%{ftp_directory}/%{pname}-%{distver}.tar.bz2
# postfix tls patches http://www.aet.TU-Cottbus.DE/personen/jaenicke/postfix_tls/
Source1: 	ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/%{tlsno}.tar.bz2
Source2: 	postfix-main.cf
Source3: 	postfix-etc-init.d-postfix
Source4:	postfix-etc-pam.d-smtp
Source5:	postfix-aliases
Source6:	postfix-ip-up
Source7:	postfix-ip-down
Source8:	postfix-ifup-d
Source10:	postfix-README.MDK
#Source11:	http://www.comedia.it/~bluca/postfix/CYRUS_README
Source12:	postfix-bash-completion
Source13:	http://www.seaglass.com/postfix/faq.html
Source14:	postfix-chroot.sh.bz2
Source15:	postfix-smtpd.conf

# still unused
Source16:	ftp://ftp.corpit.ru/pub/postfix/postfix-dict_cdb-1.1.11-20021104.tar.bz2


# Simon J. Mudd stuff
Source21:	http://ftp.wl0.org/postfinger/postfinger-1.29.bz2

# Jim Seymour stuff
Source25:	http://jimsun.LinxNet.com/misc/postfix-anti-UCE.txt
Source26:	http://jimsun.LinxNet.com/misc/header_checks.txt
Source27:	http://jimsun.LinxNet.com/misc/body_checks.txt

# Dynamic map patch originally from debian
Patch0:		postfix-2.1.0-dynamic-maps.patch.bz2

Patch1:		postfix-2.1.0-mdkconfig.patch.bz2
Patch2:		postfix-alternatives-mdk.patch.bz2
Patch3:		postfix-smtp_sasl_proto.c.patch.bz2
Patch4:		postfix-2.1.1-tlsdoc.patch.bz2
Patch5:		postfix-2.1.0-saslpath.patch.bz2

# Shamelessy stolen from debian
Patch6:		postfix-2.1.0-dbupgrade.patch.bz2
Patch7:		postfix-2.0.16-20031113-smtpstone.patch.bz2

# applied if %with_PAM=1
# originally from http://d.scn.ru/proj/postfix/dict_pam/
Patch9:		postfix-2.0.16-20030921.pam.patch.bz2 

# applied if %with_SMTPD_MULTILINE_GREETING=1
Patch10: ftp://ftp.wl0.org/SOURCES/postfix-2.0.16-20031026-multiline-greeting.patch.bz2

# applied if %with_VDA=1
Patch11: http://web.onda.com.br/nadal/postfix/VDA/postfix-2.1.4-trash.patch.bz2

# from postfix-users ml
Patch15:	postfix-2.0.16-20031231-sasl_logging.patch.bz2

# Viktor Duchovni's patches
# applied if %with_MUNGE_BARECR=1
#Originally: http://www.stahl.bau.tu-bs.de/~hildeb/postfix/duchovni/barecr.gz
Patch20:	postfix-2.0.16-20031231-barecr.patch.bz2
# not yet
#Patch21:	http://www.stahl.bau.tu-bs.de/~hildeb/postfix/duchovni/install.gz

Patch998:	http://www.ipnet6.org/postfix/download/%{ipv6no}.patch.bz2
Patch997:	postfix-2.1.5-dynamic-maps-ipv6.patch.bz2
Patch996:	postfix-2.1.5-saslpath-ipv6.patch.bz2

%if %{tls_rediff}
Patch999:	%{tls_patch}
%endiff

License:	IBM Public License
Group:		System/Servers
Provides:	smtpdaemon
# MailTransportAgent should go away, but some package require it atm
Provides:	MailTransportAgent
PreReq: 	/sbin/chkconfig, /sbin/service, coreutils
PreReq:		sysklogd, fileutils
PreReq: 	rpm-helper >= 0.3, sed
%if %alternatives
PreReq:		/usr/sbin/update-alternatives
%else
Conflicts:	sendmail exim qmail
%endif
BuildRequires:	db4-devel, gawk, /usr/bin/perl, sed, ed
BuildRequires:	html2text
BuildRoot:	%{_tmppath}/%{name}-%{pver}-%{prel}-root

%if %{with_SASL}
BuildRequires:	libsasl-devel >= 2.0
%endif

%if %{with_TLS}
BuildRequires:	openssl-devel >= %openssl_ver
%endif

%if %{with_IPV6}
BuildRequires:	openssl-devel >= %openssl_ver
%endif

%if %{dynamicmaps}
%define libname %mklibname postfix 1
Requires:	%{libname} = %epoch:%version-%release
%endif

%description
Postfix is a Mail Transport Agent (MTA), supporting LDAP, SMTP AUTH (SASL),
TLS and running in a chroot environment.

Postfix is Wietse Venema's mailer that started life as an alternative 
to the widely-used Sendmail program.
Postfix attempts to be fast, easy to administer, and secure, while at 
the same time being sendmail compatible enough to not upset existing 
users. Thus, the outside has a sendmail-ish flavor, but the inside is 
completely different.
This software was formerly known as VMailer. It was released by the end
of 1998 as the IBM Secure Mailer. From then on it has lived on as Postfix. 

This rpm supports SMTP AUTH (trough cyrus-sasl) and TLS.  If you need MySQL,
Postgres SQL, LDAP, PCRE please install the corresponding postfix-XXX package
Build time options:
	Smtpd multiline greeting: --with multiline %{with_SMTPD_MULTILINE_GREETING}
	Virtual Delivery Agent: --with VDA %{with_VDA}
	Munge bare CR: --with barecr %{with_MUNGE_BARECR}
	TLS support: --with tls %{with_TLS}
	TLS+IPV6 support: --with tls %{with_IPV6}
	Chroot by default: --with chroot %{with_CHROOT}

%if %{dynamicmaps}
%package -n %{libname}
Summary:	Shared libraries required to run Postfix
Group:		System/Servers

%description -n %{libname}
This package contains shared libraries used by Postfix.

%if %{with_LDAP}
%package ldap
Summary:	LDAP map support for Postfix
Group:		System/Servers
BuildRequires:	libldap-devel >= 2.1
Requires:	%name = %epoch:%version-%release

%description ldap
This package provides support for LDAP maps in Postfix.
%endif

%if %{with_PCRE}
%package pcre
Summary:	PCRE map support for Postfix
Group:		System/Servers
BuildRequires:	pcre-devel
Requires:	%name = %epoch:%version-%release

%description pcre
This package provides support for PCRE (perl compatible regular expression)
maps in Postfix.
%endif

%if %{with_MYSQL}
%package mysql
Summary:	MYSQL map support for Postfix
Group:		System/Servers
BuildRequires:	MySQL-devel
Requires:	%name = %epoch:%version-%release

%description mysql
This package provides support for MYSQL maps in Postfix.
%endif

%if %{with_PGSQL}
%package pgsql
Summary:	Postgres SQL map support for Postfix
Group:		System/Servers
BuildRequires:	postgresql-devel
Requires:	%name = %epoch:%version-%release

%description pgsql
This package provides support for Postgres SQL maps in Postfix.
%endif

%if %{with_PAM}
%package pam
Summary:	PAM map support for Postfix
Group:		System/Servers
BuildRequires:	pam-devel
Requires:	%name = %epoch:%version-%release

%description pam
This package provides support for PAM maps in Postfix.
%endif

%endif
# dynamicmaps

%prep
%if %{with_IPV6}
%setup -n %{pname}-%{distver} -q
%patch998 -p1 -b .tls+ipv6.orig
%else
%setup -n %{pname}-%{distver} -q -a 1
# Apply the TLS patch, must be first, because of global changes
# I apply it even if not building tls
%if %{tls_rediff}
%patch999 -p1 -b .tls.orig
%else
patch -p1 -F 1 -s -b -z .tls.orig < %{tlsno}/pfixtls.diff
%endif
%endif

%if %{dynamicmaps}
#then apply the dynamic maps patch (depends on tls atm)
%if %{with_IPV6}
%patch997 -p1 -b .dynamic 
%else
%patch0 -p1 -b .dynamic 
%endif
# ugly hack for 32/64 arches
if [ %{_lib} != lib ]; then
	ed conf/dynamicmaps.cf <<-EOF || exit 1
	,s/\/lib\//\/%{_lib}\//g
	w
	q
EOF
fi
%endif

%patch1 -p1 -b .mdkconfig
mkdir -p conf/dist
mv conf/main.cf conf/dist
cp %{SOURCE2} conf/main.cf
# ugly hack for 32/64 arches
if [ %{_lib} != lib ]; then
	ed conf/main.cf <<-EOF || exit 1
	,s/\/lib\//\/%{_lib}\//g
	w
	q
EOF
fi

%if %alternatives
%patch2 -p1 -b .alternatives
%endif

%patch3 -p1 -b .auth
%patch4 -p1 -b .tlsdoc
%if %{with_IPV6}
%patch996 -p1 -b .saslpath
%else
%patch5 -p1 -b .saslpath 
%endif
%patch6 -p1 -b .dbupgrade 
%patch7 -p1 -b .smtpstone 

# Apply PAM Patch
%if %{with_PAM}
%patch9 -p1 -b .pam
#rm -f README_FILES/PAM_README.pam
%endif

# Apply SMTPD Multiline greeting patch
%if %{with_SMTPD_MULTILINE_GREETING}
%patch10 -p1 -b .multiline
%endif

%if %{with_VDA}
%patch11 -p1 -b .vda
%endif

%patch15 -p1 -b .sasl_logging

%if %{with_MUNGE_BARECR}
%patch20 -p1 -b .barecr
%endif

# Move around the TLS docs
%if %{with_TLS}
mkdir TLS
mv %{tlsno}/doc/* TLS
mv %{tlsno}/contributed/*HOWTO.* TLS
for i in ACKNOWLEDGEMENTS CHANGES INSTALL README TODO; do
  mv %{tlsno}/$i TLS/$i
done
%endif
%if %{with_IPV6}
mkdir TLS
mv pfixtls/doc/* TLS
#mv pfixtls/contributed/*HOWTO.* TLS
for i in ACKNOWLEDGEMENTS CHANGES INSTALL README TODO; do
  mv pfixtls/$i TLS/$i
rm -f TLS/*.orig
done
%endif

install -m644 %{SOURCE10} README.MDK
#install -m644 %{SOURCE11} README_FILES/CYRUS_README
install -m644 %{SOURCE13} postfix-users-faq.html

mkdir UCE
install -m644 %{SOURCE25} UCE
install -m644 %{SOURCE26} UCE
install -m644 %{SOURCE27} UCE

%if %{with_CHROOT}
cp -p conf/master.cf conf/master.cf.chroot
awk -v NEVER_CHROOT_PROGRAM='^(proxymap|local|pipe|virtual)$' \
	-v NEVER_CHROOT_SERVICE='^cyrus$' '
		BEGIN                   { IFS="[ \t]+"; OFS="\t"; }
		/^#/                    { print; next; }
		/^ /                    { print; next; }
		$1 ~ NEVER_CHROOT_SERVICE    { print; next; }
		$8 ~ NEVER_CHROOT_PROGRAM    { print; next; }
		$5 == "n"               { $5="y"; print $0; next; }
								{ print; }
	' conf/master.cf.chroot > conf/master.cf
%endif

# use sed to fix mantools/postlink for our non posix sed
cp -p mantools/postlink mantools/postlink.posix
sed -e 's/\[\[:<:\]\]/\\</g; s/\[\[:>:\]\]/\\>/g' mantools/postlink.posix > mantools/postlink

#touch README_FILES/*

%build
%serverbuild
CCARGS=
AUXLIBS=

%ifarch s390 s390x ppc
CCARGS="${CCARGS} -fsigned-char"
%endif

%if %{with_LDAP}
  CCARGS="${CCARGS} -DHAS_LDAP"
%endif
%if %{with_PCRE}
  CCARGS="${CCARGS} -DHAS_PCRE"
%endif
%if %{with_MYSQL}
  CCARGS="${CCARGS} -DHAS_MYSQL -I/usr/include/mysql"
%endif
%if %{with_PGSQL}
  CCARGS="${CCARGS} -DHAS_PGSQL -I/usr/include/pgsql"
%endif
%if %{with_SASL}
  CCARGS="${CCARGS} -DUSE_SASL_AUTH -I/usr/include/sasl"
%endif
%if %{with_TLS} || %{with_IPV6}
  CCARGS="${CCARGS} -DUSE_SSL -I/usr/include/openssl"
%endif
%if %{with_PAM}
  CCARGS="${CCARGS} -DHAS_PAM"
%endif

export CCARGS AUXLIBS
make -f Makefile.init makefiles

unset CCARGS AUXLIBS
make DEBUG="" OPT="$RPM_OPT_FLAGS"
make manpages

for i in lib/*.a; do
	j=${i#lib/lib}
	ln -s ${i#lib/} lib/libpostfix-${j%.a}.so.1
done

%if %{dynamicmaps}
# generate main.cf.default here, since in make it will fail
cat > conf/main.cf.default << EOF
# DO NOT EDIT THIS FILE. EDIT THE MAIN.CF FILE INSTEAD. THE
# TEXT HERE JUST SHOWS DEFAULT SETTINGS BUILT INTO POSTFIX.
#
EOF
LD_LIBRARY_PATH=$PWD/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH} \
	./src/postconf/postconf -d | \
	egrep -v '^(myhostname|mydomain|mynetworks) ' >> conf/main.cf.default
%endif

# add correct parameters to main.cf.dist
LD_LIBRARY_PATH=$PWD/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH} \
	./src/postconf/postconf -c ./conf/dist -e \
	%post_install_parameters
mv conf/dist/main.cf conf/main.cf.dist

%install
rm -fr %buildroot
# install postfix into the build root
LD_LIBRARY_PATH=$PWD/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} \
sh postfix-install -non-interactive \
	install_root=%buildroot \
	config_directory=%{_sysconfdir}/postfix \
	%post_install_parameters \
	|| exit 1

for i in lib/*.a; do
	j=${i#lib/lib}
	install $i %{buildroot}%{_libdir}/libpostfix-${j%.a}.so.1
done

# rpm %%doc macro wants to take his files in buildroot
rm -fr DOC
mkdir DOC
mv %buildroot%{_docdir}/%name-%version/html DOC/html
mv %buildroot%{_docdir}/%name-%version/README_FILES DOC/README_FILES

# for sasl configuration
/bin/mkdir -p %buildroot%{_sysconfdir}/postfix/sasl
cp %{SOURCE15} %buildroot%{_sysconfdir}/postfix/sasl/smtpd.conf

# This installs into the /etc/rc.d/init.d directory
/bin/mkdir -p %buildroot%{_initrddir}
install -c %{SOURCE3} %buildroot%{_initrddir}/postfix
/bin/mkdir -p %buildroot%{_sysconfdir}/pam.d
install -c %{SOURCE4} %buildroot%{_sysconfdir}/pam.d/smtp

mkdir -p %buildroot%{_sysconfdir}/ppp/ip-{up,down}.d
mkdir -p %buildroot%{_sysconfdir}/sysconfig/network-scripts/ifup.d
install -c %{SOURCE6} %buildroot%{_sysconfdir}/ppp/ip-up.d/postfix
install -c %{SOURCE7} %buildroot%{_sysconfdir}/ppp/ip-down.d/postfix
install -c %{SOURCE8} %buildroot%{_sysconfdir}/sysconfig/network-scripts/ifup.d/postfix
touch %buildroot%{_sysconfdir}/sysconfig/postfix

# this is used by some examples (cyrus)
mkdir -p %buildroot%{queue_directory}/extern

install -c auxiliary/rmail/rmail %buildroot%{_bindir}/rmail

# copy new aliases files and generate a ghost aliases.db file
cp -f %{SOURCE5} %buildroot%{_sysconfdir}/postfix/aliases
chmod 644 %buildroot%{_sysconfdir}/postfix/aliases
touch %buildroot%{_sysconfdir}/postfix/aliases.db

# install chroot script and postfinger
bzip2 -dc %{SOURCE14} > %buildroot%{_sbindir}/postfix-chroot.sh
bzip2 -dc %{SOURCE21} >  %buildroot%{_sbindir}/postfinger
chmod 755 %buildroot%{_sbindir}/postfix-chroot.sh %buildroot%{_sbindir}/postfinger

# install qshape
install -m755 auxiliary/qshape/qshape.pl %buildroot%{_sbindir}/qshape
cp man/man1/qshape.1 %buildroot%{_mandir}/man1/qshape.1

# Move stuff around so we don't conflict with sendmail
mv %buildroot%{_bindir}/rmail %buildroot%{_bindir}/rmail.postfix
mv %buildroot%{_mandir}/man1/mailq.1 %buildroot%{_mandir}/man1/mailq.postfix.1
mv %buildroot%{_mandir}/man1/newaliases.1 %buildroot%{_mandir}/man1/newaliases.postfix.1
mv %buildroot%{_mandir}/man5/aliases.5 %buildroot%{_mandir}/man5/aliases.postfix.5

# RPM compresses man pages automatically.
# - Edit postfix-files to reflect this, so post-install won't get confused
#   when called during package installation.
ed %buildroot%{_sysconfdir}/postfix/postfix-files <<-EOF || exit 1
	,s/\(\/man[158]\/.*\.[158]\):/\1.bz2:/
	w
	q
EOF

%if %{dynamicmaps}
# remove files that are not in the main package
ed %buildroot%{_sysconfdir}/postfix/postfix-files <<-EOF || exit 1
	g/dict_ldap.so/d
	g/dict_pam.so/d
	g/dict_pcre.so/d
	g/dict_mysql.so/d
	g/dict_pgsql.so/d
	w
	q
EOF
%endif

%pre
%_pre_useradd postfix %{queue_directory} /bin/false
%_pre_groupadd %{maildrop_group} postfix

%post
# upgrade configuration files if necessary
sh %{_sysconfdir}/postfix/post-install \
	config_directory=%{_sysconfdir}/postfix \
	%post_install_parameters \
	upgrade-package

# move previous sasl configuration files to new location if applicable
# have to go through many loops to prevent damaging user configuration
saslpath=`postconf -h smtpd_sasl_path | cut -d: -f 1`
if [ -n "${saslpath}" -a "${saslpath%/}" != "%{_libdir}/sasl2" -a -e %{_libdir}/sasl2/smtpd.conf ]; then
	if ! grep -qsve '^\(#.*\|[[:space:]]*\)$' ${saslpath}/smtpd.conf; then
		# ${saslpath}/smtpd.conf missing or just comments
		if [ -s ${saslpath}/smtpd.conf ] && [ ! -e ${saslpath}/smtpd.conf.rpmnew -o ${saslpath}/smtpd.conf -nt ${saslpath}/smtpd.conf.rpmnew ];then
			mv ${saslpath}/smtpd.conf ${saslpath}/smtpd.conf.rpmnew
		fi
		mv %{_libdir}/sasl2/smtpd.conf ${saslpath}/smtpd.conf
	fi
fi

if [ -e /etc/sysconfig/postfix ]; then
	%{_sbindir}/postfix-chroot.sh -q update
%if %{with_CHROOT}
else
	%{_sbindir}/postfix-chroot.sh -q enable
%endif
fi
%_post_service postfix

%if %alternatives
%{alternatives_install_cmd}
%endif

%if %alternatives
%triggerpostun -- postfix
# (gc) necessary when we upgrade from a non alternativized package, because it's executed after the old files are removed
[ -e %{_sbindir}/sendmail.postfix ] && %{alternatives_install_cmd} || :
%endif

%triggerin -- glibc setup nss_ldap nss_db samba-winbind nss_wins samba2-winbind nss_wins2 samba3-winbind nss_wins3
# Generate chroot jails on the fly when needed things are installed/upgraded
%{_sbindir}/postfix-chroot.sh -q update

%preun
rmqueue() {
	[ $2 -gt 0 ] || return
	local i
	for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F; do
		if [ -d $1/$i ]; then
			rmqueue $1/$i $(( $2 - 1 ))
			rm -f $1/$i/*
			rmdir $1/$i
		fi
	done
}

# selectively remove the queue directory structure
queue_directory_remove () {
# first remove the "queues"
local IFS=', '
for dir in `%{_sbindir}/postconf -h hash_queue_names`; do
	test -d $dir && rmqueue %{queue_directory}/$dir `%{_sbindir}/postconf -h hash_queue_depth`
done

# now remove the other directories
for dir in corrupt maildrop pid private public trace; do
	test -d $dir && /bin/rm -f $dir/*
done
}

%_preun_service postfix

if [ $1 = 0 ]; then
%if %alternatives
	update-alternatives --remove mta %{_sbindir}/sendmail.postfix
%endif

	# Clean up chroot environment and spool directory
	%{_sbindir}/postfix-chroot.sh -q remove
	cd %{queue_directory} && queue_directory_remove || true
fi

%postun
%_postun_userdel postfix
%_postun_groupdel %{maildrop_group}

%clean
rm -rf %buildroot

%files
%defattr(-, root, root, 755)
%dir %{_sysconfdir}/postfix
%dir %{_sysconfdir}/postfix/sasl
%config(noreplace) %{_sysconfdir}/postfix/sasl/smtpd.conf
%config(noreplace) %{_sysconfdir}/postfix/postfix-script
%config(noreplace) %{_sysconfdir}/postfix/post-install
%config(noreplace) %{_sysconfdir}/postfix/postfix-files
%config(noreplace) %{_sysconfdir}/postfix/main.cf
%config(noreplace) %{_sysconfdir}/postfix/main.cf.dist
%config(noreplace) %{_sysconfdir}/postfix/main.cf.default
%config(noreplace) %{_sysconfdir}/postfix/master.cf
%config(noreplace) %{_sysconfdir}/postfix/access
%config(noreplace) %{_sysconfdir}/postfix/aliases
%ghost %{_sysconfdir}/postfix/aliases.db
%config(noreplace) %{_sysconfdir}/postfix/canonical
%config(noreplace) %{_sysconfdir}/postfix/header_checks
%config(noreplace) %{_sysconfdir}/postfix/relocated
%config(noreplace) %{_sysconfdir}/postfix/transport
%config(noreplace) %{_sysconfdir}/postfix/virtual
%config(noreplace) %{_sysconfdir}/postfix/makedefs.out
%if %{dynamicmaps}
%config(noreplace) %{_sysconfdir}/postfix/dynamicmaps.cf
%endif

%attr(0755, root, root) %config(noreplace) %{_initrddir}/postfix
%attr(0644, root, root) %config(noreplace) %{_sysconfdir}/pam.d/smtp
%attr(0755, root, root) %config(noreplace) %{_sysconfdir}/ppp/ip-up.d/postfix
%attr(0755, root, root) %config(noreplace) %{_sysconfdir}/ppp/ip-down.d/postfix
%attr(0755, root, root) %config(noreplace) %{_sysconfdir}/sysconfig/network-scripts/ifup.d/postfix
%ghost %{_sysconfdir}/sysconfig/postfix

# For correct directory permissions check postfix-install script
%dir %{queue_directory}
%dir %attr(0700, postfix, root) %{queue_directory}/active
%dir %attr(0700, postfix, root) %{queue_directory}/bounce
%dir %attr(0700, postfix, root) %{queue_directory}/corrupt
%dir %attr(0700, postfix, root) %{queue_directory}/defer
%dir %attr(0700, postfix, root) %{queue_directory}/deferred
%dir %attr(0700, postfix, root) %{queue_directory}/flush
%dir %attr(0700, postfix, root) %{queue_directory}/hold
%dir %attr(0700, postfix, root) %{queue_directory}/incoming
%dir %attr(0700, postfix, root) %{queue_directory}/private
%dir %attr(0700, postfix, root) %{queue_directory}/trace
%dir %attr(0730, postfix, %{maildrop_group}) %{queue_directory}/maildrop
%dir %attr(0710, postfix, %{maildrop_group}) %{queue_directory}/public
%dir %attr(0755, root, root) %{queue_directory}/pid
%dir %attr(0755, root, root) %{queue_directory}/extern

%doc AAAREADME
%doc US_PATENT_6321267
%doc examples/smtpd-policy
%doc COMPATIBILITY
%doc COPYRIGHT
%doc HISTORY
%doc LICENSE
%doc PORTING
%doc RELEASE_NOTES*
%if %{with_TLS} || %{with_IPV6}
%doc TLS
%endif
%doc html
%doc DOC/html
%doc DOC/README_FILES
%doc README.MDK
%doc postfix-users-faq.html
%doc UCE

%dir %{_libdir}/postfix
%attr(0755, root, root) %{_libdir}/postfix/bounce
%attr(0755, root, root) %{_libdir}/postfix/cleanup
%attr(0755, root, root) %{_libdir}/postfix/error
%attr(0755, root, root) %{_libdir}/postfix/flush
%attr(0755, root, root) %{_libdir}/postfix/lmtp
%attr(0755, root, root) %{_libdir}/postfix/local
%attr(0755, root, root) %{_libdir}/postfix/master
%attr(0755, root, root) %{_libdir}/postfix/nqmgr
%attr(0755, root, root) %{_libdir}/postfix/oqmgr
%attr(0755, root, root) %{_libdir}/postfix/pickup
%attr(0755, root, root) %{_libdir}/postfix/pipe
%attr(0755, root, root) %{_libdir}/postfix/proxymap
%attr(0755, root, root) %{_libdir}/postfix/qmgr
%attr(0755, root, root) %{_libdir}/postfix/qmqpd
%attr(0755, root, root) %{_libdir}/postfix/showq
%attr(0755, root, root) %{_libdir}/postfix/smtp
%attr(0755, root, root) %{_libdir}/postfix/smtpd
%attr(0755, root, root) %{_libdir}/postfix/spawn
%attr(0755, root, root) %{_libdir}/postfix/trivial-rewrite
%attr(0755, root, root) %{_libdir}/postfix/virtual

%if %{with_TLS} || %{with_IPV6}
%attr(0755, root, root) %{_libdir}/postfix/tlsmgr
%endif

#attr(0755, root, root) %{_libdir}/postfix/anvil
%attr(0755, root, root) %{_libdir}/postfix/verify

%attr(0755, root, root) %{_sbindir}/postalias
%attr(0755, root, root) %{_sbindir}/postcat
%attr(0755, root, root) %{_sbindir}/postconf
%attr(2755,root,%{maildrop_group}) %{_sbindir}/postdrop
%attr(2755,root,%{maildrop_group}) %{_sbindir}/postqueue
%attr(0755, root, root) %{_sbindir}/postfix
%attr(0755, root, root) %{_sbindir}/postkick
%attr(0755, root, root) %{_sbindir}/postlock
%attr(0755, root, root) %{_sbindir}/postlog
%attr(0755, root, root) %{_sbindir}/postmap
%attr(0755, root, root) %{_sbindir}/postsuper

%attr(0755, root, root) %{_sbindir}/qmqp-sink
%attr(0755, root, root) %{_sbindir}/qmqp-source
%attr(0755, root, root) %{_sbindir}/smtp-sink
%attr(0755, root, root) %{_sbindir}/smtp-source

%attr(0755, root, root) %{_sbindir}/postfinger
%attr(0755, root, root) %{_sbindir}/postfix-chroot.sh
%attr(0755, root, root) %{_sbindir}/qshape

%if %alternatives
%attr(0755, root, root) %{_sbindir}/sendmail.postfix
%attr(0755, root, root) %{_bindir}/mailq.postfix
%attr(0755, root, root) %{_bindir}/newaliases.postfix
%attr(0755, root, root) %{_bindir}/rmail.postfix
%else
%attr(0755, root, root) %{_sbindir}/sendmail
%attr(0755, root, root) %{_bindir}/mailq
%attr(0755, root, root) %{_bindir}/newaliases
%attr(0755, root, root) %{_bindir}/rmail
%endif

%{_mandir}/*/*

%attr(0755, root, root) %{_libdir}/postfix/dict_cidr.so
#attr(0755, root, root) %{_libdir}/postfix/dict_tcp.so

# this comes from tls patch, but is not tls related
%attr(0755, root, root) %{_libdir}/postfix/dict_sdbm.so

%if %{dynamicmaps}
%files -n %{libname}
%defattr(755, root, root)
%attr(0755, root, root) %{_libdir}/libpostfix-dns.so.1
%attr(0755, root, root) %{_libdir}/libpostfix-global.so.1
%attr(0755, root, root) %{_libdir}/libpostfix-master.so.1
%attr(0755, root, root) %{_libdir}/libpostfix-util.so.1
%if %{with_TLS} || %{with_IPV6}
%attr(0755, root, root) %{_libdir}/libpostfix-tls.so.1
%endif

%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig

%if %{with_LDAP}
%files ldap
%attr(755, root, root) %{_libdir}/postfix/dict_ldap.so
%post ldap
%dynmap_add_cmd ldap
%postun ldap
%dynmap_rm_cmd ldap
%endif

%if %{with_MYSQL}
%files mysql
%attr(755, root, root) %{_libdir}/postfix/dict_mysql.so 
%post mysql
%dynmap_add_cmd mysql
%postun mysql
%dynmap_rm_cmd mysql
%endif

%if %{with_PAM}
%files pam
%attr(755, root, root) %{_libdir}/postfix/dict_pam.so
%post pam
%dynmap_add_cmd pam
%postun pam
%dynmap_rm_cmd pam
%endif

%if %{with_PCRE}
%files pcre
%attr(755, root, root) %{_libdir}/postfix/dict_pcre.so
%post pcre
%dynmap_add_cmd pcre
%postun pcre
%dynmap_rm_cmd pcre
%endif

%if %{with_PGSQL}
%files pgsql
%attr(755, root, root) %{_libdir}/postfix/dict_pgsql.so
%post pgsql
%dynmap_add_cmd pgsql
%postun pgsql
%dynmap_rm_cmd pgsql
%endif
%endif

%changelog
* Wed Mar 16 2005 Luca Berra <bluca@vodka.it> 2.1.5-6mdk
- upgrade ipv6 patch to 1.26 (possible secuirity issue)
- provide a default /etc/postfix/sasl/smtpd.conf
- updated README.MDK
- updated postfix-users faq

* Fri Feb 04 2005 Buchan Milne <bgmilne@linux-mandrake.com> 2.1.5-5mdk
- rebuild for ldap2.2_7

* Sat Jan 22 2005 Luca Berra <bluca@vodka.it> 2.1.5-4mdk
- include man page for qshape (bugzilla #13119)

* Sat Jan 15 2005 Luca Berra <bluca@vodka.it> 2.1.5-2mdk
- use distro specific release tags
- updated README.MDK
- provide a default /etc/pam.d/smtp for saslauthd users
- don't move sasl conf if not necessary
- make main.cf.dist a working config file
- enable xforward for content filters (e.g. recent amavisd-new)

* Fri Dec 10 2004 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 2.1.5-2mdk
- s/Mandrake Linux/Mandrakelinux/ in default conf and docs

* Sun Nov 28 2004 Luca Berra <bluca@vodka.it> 2.1.5-1mdk 
- 2.1.5
- fix creation of aliases at startup
- do not refresh aliases at install time
- use tls+ipv6 instead of tls
- now requires html2text to build documentation

* Sat Aug 28 2004 Luca Berra <bluca@vodka.it> 2.1.4-2mdk 
- rebuilt with db-4.2

* Sun Aug 08 2004 Luca Berra <bluca@vodka.it> 2.1.4-1mdk 
- 2.1.4 (should fix problems for ppc users)
- added vda patch (disabled in default build)
- reworked map creation at startup, to catch parameters postconf won't show

* Thu Jul 29 2004 Stew Benedict <sbenedict@mandrakesoft.com> 2.1.1-2mdk 
- sendmail symlink needs to be in /usr/lib (LSB)

* Mon May 03 2004 Luca Berra <bluca@vodka.it> 2.1.1-1mdk 
- 2.1.1
- pfixtls-0.8.18-2.1.0-0.9.7d
- added p4 (tls docs)
- touch readmes so it does not try to rebuild them

* Sun Apr 25 2004 Luca Berra <bluca@vodka.it> 2.1.0-1mdk 
- 2.1.0 release
- rediffed p0, p1, p5, p6, tls
- dropped p14, p16
- goodbye samples, hello html documentation
- included qshape
- updated postfinger, postfix faq, Jim Seymour's stuff
- fixed map creation at startup (thanks to Andrzej Kukula for ideas)
- check for chroot sanity at startup

* Sat Feb 21 2004 Luca Berra <bluca@vodka.it> 2.1.0-0.20040209.18mdk 
- changed package version to 2.1.0
- removed anvil and dict_tcp which will not be in 2.1
- fixed soname for dict_cidr
- fixed uninstall problems (#8209)

* Tue Feb 10 2004 Luca Berra <bluca@vodka.it> 2.0.18.20040209-0.17mdk 
- 20040209
- cosmetic specfile changes

* Thu Feb 05 2004 Luca Berra <bluca@vodka.it> 2.0.18.20040205-0.16mdk 
- 20040205
- removed P11 P12 P13 P17, merged upstream

* Thu Feb 05 2004 Luca Berra <bluca@vodka.it> 2.0.18.20040122-0.15mdk 
- postfix_tls-0.8.18
- configurable sasl path
- move sasl config to /etc/postfix/sasl during upgrade
- added P11 P12 P13 P14 P16 P17 from postfix-users ml

* Sun Feb 01 2004 Luca Berra <bluca@vodka.it> 2.0.18.20040122-0.14mdk 
- 20040122
- use -F 1 when patching tls so it actually fails instead of misplacing stuff
- rediffed P0 P1 tls
- removed P11 P12 P13 P14, merged upstream
- show compiled in options in %%description

* Tue Jan 20 2004 Luca Berra <bluca@vodka.it> 2.0.16.20031231-0.13mdk 
- added some more epochs
- added mailing list faq
- fix for possible anvil race

* Sun Jan 18 2004 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.0.16.20031231-0.12mdk
- prereq sysklogd and fileutils (xargs) since post scripts fail without
  these packages 
- Added epoch to libpostfix dependency to fix rpm 4.2.2 behavior

* Wed Jan 07 2004 Luca Berra <bluca@vodka.it> 2.0.16.20031231-0.11mdk
- fix /etc/sysconfig/network-scripts/ifup.d/postfix
- disable receive_override_options for pickup service
- fix postconf run during build
- enable tlsmgr in master.cf (needed for tls and chroot)
- versioned buildrequires

* Sun Jan 04 2004 Luca Berra <bluca@vodka.it> 2.0.16.20031231-0.10mdk 
- 20031231
- postfix_tls-0.8.17
- use hash_queue_names and hash_queue_depth to remove files from the queue
- [postfix-chroot] work around fr missing nss libs, allows skipping some nss
- [postfix-chroot] copy config files for nss that require it
- [postfix-chroot] add feature to copy other files to chroot as well
- patch to remove bare-cr in mail, disabled by default
- remove warning on mails from cron

* Fri Dec 26 2003 Luca Berra <bluca@vodka.it> 2.0.16.20031224-0.9mdk
- 20031224
- small fixes to postfix-chroot.sh
- fix ppp-up/down scripts, and added an ifup.d one
- [spec] run postfix-chroot.sh if upgraded from old versions (check /etc/sysconfig/postfix)
- added library package to please rpmlint
- updated README.MDK

* Tue Dec 23 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.8mdk
- 20031223
- rewrote postfix-chroot.sh script
- [spec] rediffed tls
- [spec] use macros for dynamic maps parsing
- [spec] use postfix-chroot.sh script
- [master.cf] removed pre/post-cleanup in favor of receive_override_options
- [master.cf] changed names of cyrus interfaces, again

* Mon Dec 15 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.7mdk
- starting to test it on amd64
- fixed lmtp/smtp typo in master.cf
- no content filter on pickup

* Mon Dec 01 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.6mdk
- upgraded experimental to 20031113
- well, do install and remove README_FILES again, in a different way
- add dynamic maps patch for experimental build
- add some misc patches from debian
- fix --with pam option (disabled, needs rediff with dynamic-maps)
- updated multiline-greeting patch, still unapplied (memory leak)
- added ppp ip-up/down scripts that deal with changing dns
- non experimental is not supported atm

* Mon Oct 27 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.5mdk
- upgraded experimental to 20031022
- experimental provides postfix
- split pflogsum
- add postfinger and postfix-chroot.sh (not yet used)

* Wed Oct 15 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.4mdk
- don't install then remove README_FILES, ensures we don't miss any
- addedd policy server sample to exp

* Mon Oct 13 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.3mdk
- added support for generic filter in the default install,
  check comments in master.cf

* Tue Oct 07 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.2mdk
- rebuild of experimental

* Sun Oct 05 2003 Luca Berra <bluca@vodka.it> 2.0.16-0.1mdk
- Added ns-mx-acl patch
- added pam patch
- added pflogsumm and anti-uce examples from Jim Seymour
- %%version macro sucks

* Mon Sep 22 2003 Luca Berra <bluca@vodka.it> 2.0.13-6mdk
- added man pages for smtp-sink and smtp-source

* Sun Sep 21 2003 Luca Berra <bluca@vodka.it> 2.0.13-5mdk
- removed spaces from options to services in master.cf

* Sun Sep 07 2003 Luca Berra <bluca@vodka.it> 2.0.13-4mdk
- do not require procmail anymore
- remove chroot awk script
- add examples and descriptions for integrating with cyrus

* Mon Aug 18 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.13-3mdk
- add CHROOT_INFO.README.MANDRAKE in doc section, in particular to
  explain how to sync system and chroot files

* Thu Aug 14 2003 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.0.13-2mdk
- BuildRequires: db4-devel, libsasl-devel to match other deps

* Wed Aug  6 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.13-1mdk
- 2.0.13

* Fri Jun 27 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.12-3mdk
- fix default cyrus transport location thx to Buchan Milne
- build against db4.1

* Fri Jun 13 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.12-2mdk
- use sasl2

* Thu Jun 12 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.12-1mdk
- new version

* Mon May 26 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.10-1mdk
- new version

* Thu May 22 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.9-4mdk
- update multiline greeting patch

* Wed May 07 2003 Yves Duret <yves@zarb.org> 2.0.9-3mdk
- opensslpower.

* Mon May 05 2003 Olivier Thauvin <thauvin@aerov.jussieu.fr> 2.0.9-2mdk
- workaround to fix requires openssl (yves sucks)

* Sat May 03 2003 Yves Duret <yves@zarb.org> 2.0.9-1mdk
- 2.0.9

* Thu Mar  6 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.6-1mdk
- 2.0.6 is a minor security fix
- build against openssl-0.9.7a
- build against libdb4.0 instead of libdb3.3

* Tue Jan 21 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.1-2mdk
- fix proxymap to not be launched chroot'ed thx to <mr at uue dot org>
  (Michael Reinsch)
- needs sasl1 to build, not any (not sasl2 that is)

* Mon Jan 20 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 2.0.1-1mdk
- new version (plank the children (c) dams)
- drop the domain.name -> example.com patch: we've had a similar patch on
  1.1.x since Wed May 29 2002, but postfix mainstream authors still haven't
  changed accordingly in postfix mainstream sources; therefore I assume
  they don't agree with such a patch, and there is no point bothering on
  our side to maintain such a patch

* Tue Dec 17 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.12-2mdk
- have initscript 'start' update the db's, thx to Todd Lyons <tlyons@mandrakesoft.com>

* Mon Dec 09 2002 Yves Duret <yves@zarb.org> 1.1.12-1mdk
- new upstream version.
- updated postfix tls to according postfix version.

* Mon Nov 11 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 1.1.11-6mdk
- Make it lib64 aware

* Thu Nov 07 2002 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.11-5mdk
- fix gc vs c-r
- prereq : s/(sh-|text|file)utils/coreutils/

* Tue Sep 17 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.11-3mdk
- don't use "rmail.postfix" but "rmail" in master.cf, fix uucp,
  thx Buchan Milne <bgmilne@cae.co.za>

* Fri Aug 30 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.11-3mdk
- fix upgrades from Mandrake 8.2 (call update-alternatives in triggerpostun
  so that old files removal is already done)

* Tue Jul 30 2002 Frederic Lepied <flepied@mandrakesoft.com> 1.1.11-2mdk
- use %%_pre_groupadd and %%_postun_groupdel %{maildrop_group}

* Wed Jul 24 2002 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.11-1mdk
- new version
- updated postfix_lfs source to 0.8.11a-1.1.11-0.9.6d

* Fri Jul 12 2002 Frederic Lepied <flepied@mandrakesoft.com> 1.1.10-3mdk
- add postfix user

* Wed May 29 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.10-2mdk
- specfile: added --with --without build conditions to override included defines.
- MySQL: adjust requires and buildrequires.
- main.cf: fix a typo.
- added P100 to perform domain.name-to-example.com everywhere 
  as requested by the .name TLD maintainer Andreas Aardal Hanssen <ahanssen@gnr.com>.

* Sun May 19 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.10-1mdk
- version 1.1.10.
- updated source9 (postfix_tls) to pfixtls-0.8.10-1.1.10-0.9.6d for postfix 1.1.10.
- requires openssl with version according to pfixtls need (0.9.6d here).
- fix sample_directory pointed to /sample in main.cf (tvignaud).
- fix /etc/aliases symlink (alternatives).
- chroot: added etc/{resolv.conf,hosts,host.conf} to the chroot-jail.
- chroot: fix db3 trigger (on libdb3.3)
- chroot: fix ldap trigger (on libldap2 instead of generic openldap package).
- chroot: renamed ROOT by CHROOT.
- do not ship two times the TLS doc (in TLS). 
- use %%_docdir instead of %%_datadir/doc.
- rpmlint: use %%SOURCE6 instead of %%sourcedir.
- spec: replace official condif by reverse experimental condif (so my vim macro works again).
- description: add a space before begining with a new sentence.

* Tue May 14 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.9-1mdk
- version 1.1.9
- updated source9 (postfix_tls) to pfixtls-0.8.9-1.1.9-0.9.6d for postfix 1.1.9
- source in gzip format instead of bzip2
- include .sig file for postfix src and pfixtls
- fix %%postun script (exit if $0=0 instead of restart postfix)
  pointed by Guillaume Cottenceau
  
* Mon May 13 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.8-3mdk
- fix chroot pbs in upgrade too. thx Pascal Terjean. i really sux.
- add db3 in chroot jail.

* Mon May 13 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.8-2mdk
- finally fix uppgrade. i sux.

* Fri May 10 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.8-1mdk
- version 1.1.8-20020508 (bug fixes)
- updated source9 (postfix_tls) to pfixtls-0.8.8-1.1.8-0.9.6d for postfix 1.1.8

* Wed Apr 24 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.7-3mdk
- fix alternative pb (symlink not created)

* Wed Apr 17 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.7-2mdk
- added %_libdir/sendmail link for backward compatibility

* Sun Apr 14 2002 Yves Duret <yduret@mandrakesoft.com> 1.1.7-1mdk
- the long awaiting postfix update (added Epoch tag).
- complete spec file rewrite (using the RedHat one).

* Tue Jan 29 2002 Geoffrey Lee <snailtalk@mandarkesoft.com> 20010228-20mdk
- A much needed upgrade to pl08.
- pfixtls 0.7.13 for pl08.
- Remove the postfix useradd and groupadd.
- Requires latest setup package.

* Mon Nov 26 2001 Vincent Danen <vdanen@mandrakesoft.com> 20010228-19mdk
- apply security fix from Venema that fixes potential DoS

* Wed Nov 14 2001 Philippe Libat <philippe@mandrakesoft.com> 20010228-18mdk
- add pam.d/smtp, sasl/smtpd.conf for sasl configuration

* Wed Nov 14 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 20010228-17mdk
- remove empty include statement that was preventing USE_SASL_AUTH to be
  defined. Thanks to James Farrell <jfarrell@candyraver.com> for reporting and
  fixing this problem.

* Tue Oct 23 2001 Florin <florin@mandrakesoft.com> 20010228-16mdk
- rebuild for db3

* Tue Sep  4 2001 Guillaume Cottenceau <gc@mandrakesoft.com> 20010228-15mdk
- subst `Linux-Mandrake' with `Mandrake Linux' in SMTP Greeting Banner

* Mon Sep 03 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 20010228-14mdk
- Hand modified the config file patch, to fix bug #4048

* Mon Sep 03 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 20010228-13mdk
- Provides: MailTransportAgent

* Sat Jul 07 2001 Stefan van der Eijk <stefan@eijk.nu> 20010228-12mdk
- BuildRequires:	libsasl-devel

* Fri Jul 06 2001 Philippe Libat <philippe@mandrakesoft.com> 20010228-11mdk
- new db3

* Mon Jun 25 2001 Jeff Garzik <jgarzik@mandrakesoft.com> 20010228-10mdk
- Patch dnsverify.pl, to have /usr/bin/perl not /users2/local/bin/perl
  on first line, as the interpreter to be run.

* Thu Jun 19 2001 Philippe Libat <philippe@mandrakesoft.com> 20010228-9mdk
- version pl3
- TLS, LDAP

* Wed Jun 13 2001 Philippe Libat <philippe@mandrakesoft.com> 20010228-8mdk
- SASL Support

* Tue Jun 12 2001 Philippe Libat <philippe@mandrakesoft.com> 20010228-7mdk
- Added config samples

* Tue Apr 17 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 20010228-6mdk
- Do not stop postfix before installing, it will prevent us from restarting it.

* Tue Apr 17 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 20010228-5mdk
- Revert latest change, cause the DB are already re-generated in postfix.init
  at each startup.

* Thu Apr 05 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 20010228-4mdk
- When upgrading, always regenerate all .db file (except aliases)
  This fix bug #2260 (upgrade postfix need to recreate /etc/postfix/*.db
  files). This avoid problem when the DB file version change.
  
  thanks to Steffen Ullrich <coyote.frank@gmx.de> for reporting and helping
  fixing this bug.

* Wed Apr 04 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 20010228-3mdk
- Fix bug #1810 (postfix invokes procmail with options that cause a `>From '
  line in the headers) by adding the -o options to the procmail call.

* Thu Mar 29 2001 Guillaume Cottenceau <gc@mandrakesoft.com> 20010228-2mdk
- use post/preun service macros
- user serverbuild for safer flags

* Tue Mar  6 2001 Vincent Danen <vdanen@mandrakesoft.com> 20010228-1mdk
- 20010228 release
- macros
- added conflicts: qmail
- added buildrequires: db3-devel
- added buildconflicts: BerkeleyDB-devel

* Wed Jan 17 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231_pl13-2mdk
- install rmail script.

* Wed Jan 17 2001 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231_pl13-1mdk
- Upgrade to patch level 13.
- add delay_warning_time option to main.cf (fix bug #1390).

* Thu Nov 16 2000 Chmouel Boudjnah <chmouel@mandrakesoft.com> 19991231_pl08-6mdk
- Explicit compile with db1.

* Tue Aug 29 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231_pl08-5mdk
- change license to IBM Public License

* Tue Aug 29 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231_pl08-4mdk
- use noreplace
- use %{_initrddir}

* Tue Aug 29 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231_pl08-3mdk
- correct 2 shell syntax error in %postun

* Wed Aug  2 2000 Guillaume Cottenceau <gc@mandrakesoft.com> 19991231_pl08-2mdk
- %config(noreplace)

* Fri Jul 21 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231_pl08-1mdk
- updated to postfix release 19991231-pl8.
- small specfile cleanup.

* Mon Jul 10 2000 Thierry Vignaud <tvignaud@mandrakesoft.com> 19991231-8mdk
- let spechelper compress man-pages and strip binaries (hey guyes, we do this
  for a _long_ time)
- use new macros

* Sat Jul 08 2000 Stefan van der Eijk <s.vandereijk@chello.nl> 19991231-7mdk
- modified find statement to only find files (not directories)
- moved BuildRoot to /var/tmp

* Fri May 05 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231-6mdk
- Fix an aliases.db problem...

* Tue Mar 21 2000 Yoann Vandoorselaere <yoann@mandrakesoft.com> 19991231-5mdk
- Fix group.

* Wed Mar  8 2000 Pixel <pixel@mandrakesoft.com> 19991231-4mdk
- add prereq wc

* Mon Jan  3 2000 Jean-Michel Dault <jmdault@netrevolution.com>
- updated to 19991231
- added postfix group
- corrected aliases.db bug

* Mon Dec 27 1999 Jerome Dumonteil <jd@mandrakesoft.com>
- Add postfix check in post to create sub dirs in spool

* Mon Dec 20 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- Add -a $DOMAIN -d $LOGNAME to procmail (philippe).
- New banner.

* Wed Nov 10 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>
- fix if conflicts with sendmail.

* Sat Jun  5 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
- install bins from libexec/

* Sat Jun  5 1999 Bernhard Rosenkränzer <bero@mandrakesoft.com>
- 19990601
- .spec cleanup for easier updates

* Wed May 26 1999 Axalon Bloodstone <axalon@linux-mandrake.com>
- created link from /usr/sbin/sendmail to %{_libdir}/sendmail
  so it doesn't bug out when i rpm -e sendmail
- Now removes /var/lock/subsys/postfix like a good little prog
  upon rpm -e

* Fri Apr 23 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com>

- Mandrake adptations.

* Tue Apr 13 1999 Arne Coucheron <arneco@online.no>
  [19990317-pl04-1]

* Tue Mar 30 1999 Arne Coucheron <arneco@online.no>
  [19990317-pl03-2]
- Castro, Castro, pay attention my friend. You're making it very hard
  maintaining the package if you don't follow the flow of the releases

* Thu Mar 25 1999 Arne Coucheron <arneco@online.no>
  [19990317-pl02-1]

* Tue Mar 23 1999 Arne Coucheron <arneco@online.no>
  [19990317-3]
- added bugfix patch01

* Sat Mar 20 1999 Arne Coucheron <arneco@online.no>
  [19990317-2]
- removed the mynetworks line in main.cf, let postfix figure it out
- striping of the files in /usr/sbin
- alias database moved to /etc/postfix and made a symlink to it in /etc
- enabled procmail support in main.cf and added it to Requires:
- check status on master instead of postfix in the init script
- obsoletes postfix-beta
- had to move some of my latest changelog entries up here since Edgard Castro
  didn't follow my releases

* Thu Mar 18 1999 Edgard Castro <castro@usmatrix.net>
  [19990317]

* Tue Mar 16 1999 Edgard Castro <castro@usmatrix.net>
  [alpha-19990315]

* Tue Mar  9 1999 Edgard Castro <castro@usmatrix.net>
  [19990122-pl01-2]
- shell and gecho information changed to complie with Red Hat stardand
- changed the name of the rpm package to postfix, instead of postfix-beta

* Tue Feb 16 1999 Edgard Castro <castro@usmatrix.net>
  [19990122-pl01-1]

* Sun Jan 24 1999 Arne Coucheron <arneco@online.no>
  [19990122-1]
- shell for postfix user changed to /bin/true to avoid logins to the account
- files in /usr/libexec/postfix moved to %{_libdir}/postfix since this complies
  more with the Red Hat standard

* Wed Jan 06 1999 Arne Coucheron <arneco@online.no>
  [19981230-2]
- added URL for the source
- added a cron job for daily check of errors
- sample config files moved from /etc/postfix/sample to the docdir 
- dropped making of symlinks in /usr/sbin and instead installing the real
  files there
- because of the previous they're not needed anymore in /usr/libexec/postfix,
  so they are removed from that place

* Fri Jan 01 1999 Arne Coucheron <arneco@online.no>
  [19981230-1]

* Tue Dec 29 1998 Arne Coucheron <arneco@online.no>
  [19981222-1]
- first build of rpm version