2009-02-03 11:39:48 +01:00
|
|
|
{stdenv, fetchurl, db4, glibc, openssl, cyrus_sasl}:
|
2006-03-11 00:48:34 +01:00
|
|
|
|
2009-02-03 11:39:48 +01:00
|
|
|
assert stdenv.isLinux && stdenv ? coreutils;
|
2008-06-13 14:03:55 +02:00
|
|
|
|
2006-03-11 00:48:34 +01:00
|
|
|
stdenv.mkDerivation {
|
2007-09-11 12:15:07 +02:00
|
|
|
name = "postfix-2.2.11";
|
2009-02-03 11:39:48 +01:00
|
|
|
|
2006-03-11 00:48:34 +01:00
|
|
|
src = fetchurl {
|
2007-09-11 12:15:07 +02:00
|
|
|
url = ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/postfix-2.2.11.tar.gz;
|
|
|
|
sha256 = "04hxpyd3h1f48fnppjwqqxbil13bcwidzpfkra2pgm7h42d9blq7";
|
2006-03-11 00:48:34 +01:00
|
|
|
};
|
|
|
|
|
2008-06-13 06:30:57 +02:00
|
|
|
installTargets = ["non-interactive-package"];
|
2009-02-03 11:39:48 +01:00
|
|
|
|
2008-06-13 06:30:57 +02:00
|
|
|
installFlags = [" install_root=$out "];
|
2009-02-03 11:39:48 +01:00
|
|
|
|
|
|
|
preInstall = ''
|
2008-06-30 23:11:07 +02:00
|
|
|
sed -e '/^PATH=/d' -i postfix-install
|
2009-02-03 11:39:48 +01:00
|
|
|
'';
|
|
|
|
|
2008-06-13 06:30:57 +02:00
|
|
|
postInstall = ''
|
|
|
|
ensureDir $out
|
|
|
|
mv ut/$out/* $out/
|
2008-06-30 23:11:07 +02:00
|
|
|
|
|
|
|
mkdir $out/share/postfix/conf
|
|
|
|
cp conf/* $out/share/postfix/conf
|
|
|
|
sed -e 's@PATH=.*@PATH=${stdenv.coreutils}/bin:${stdenv.findutils}/bin:${stdenv.gnused}/bin:${stdenv.gnugrep}/bin:$out/sbin@' -i $out/share/postfix/conf/post-install
|
|
|
|
sed -e '2aPATH=${stdenv.coreutils}/bin:${stdenv.findutils}/bin:${stdenv.gnused}/bin:${stdenv.gnugrep}/bin:$out/sbin' -i $out/share/postfix/conf/postfix-script
|
|
|
|
chmod a+x $out/share/postfix/conf/{postfix-script,post-install}
|
2008-06-13 06:30:57 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export daemon_directory=$out/libexec/postfix
|
|
|
|
export command_directory=$out/sbin
|
|
|
|
export queue_directory=/var/spool/postfix
|
|
|
|
export sendmail_path=$out/bin/sendmail
|
|
|
|
export mailq_path=$out/bin/mailq
|
|
|
|
export newaliases_path=$out/bin/newaliases
|
|
|
|
export html_directory=$out/share/postfix/doc/html
|
|
|
|
export manpage_directory=$out/share/man
|
|
|
|
export sample_directory=$out/share/postfix/doc/samples
|
|
|
|
export readme_directory=$out/share/postfix/doc
|
2008-06-30 23:11:07 +02:00
|
|
|
|
|
|
|
make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DHAS_DB -I${cyrus_sasl}/include/sasl' AUXLIBS='-lssl -lcrypto -lsasl2 -ldb'
|
2008-06-13 06:30:57 +02:00
|
|
|
'';
|
|
|
|
|
2009-05-09 17:37:50 +02:00
|
|
|
buildInputs = [db4 openssl cyrus_sasl];
|
2009-02-03 11:39:48 +01:00
|
|
|
|
2006-03-11 00:48:34 +01:00
|
|
|
patches = [./postfix-2.2.9-db.patch ./postfix-2.2.9-lib.patch];
|
2009-02-03 11:39:48 +01:00
|
|
|
|
2006-03-11 00:48:34 +01:00
|
|
|
inherit glibc;
|
|
|
|
}
|