2010-08-06 11:34:34 +01:00
|
|
|
{ stdenv, fetchurl, db4, glibc, openssl, cyrus_sasl
|
2011-11-05 18:50:43 +00:00
|
|
|
, coreutils, findutils, gnused, gnugrep, bison, perl
|
2010-08-06 11:34:34 +01:00
|
|
|
}:
|
2006-03-10 23:48:34 +00:00
|
|
|
|
2010-08-06 11:34:34 +01:00
|
|
|
assert stdenv.isLinux;
|
2008-06-13 13:03:55 +01:00
|
|
|
|
2012-08-28 14:14:03 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2011-11-05 18:50:43 +00:00
|
|
|
name = "postfix-2.8.6";
|
2012-08-28 14:13:21 +01:00
|
|
|
|
2006-03-10 23:48:34 +00:00
|
|
|
src = fetchurl {
|
2012-08-28 14:14:03 +01:00
|
|
|
url = "ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/${name}.tar.gz";
|
2011-11-05 18:50:43 +00:00
|
|
|
sha256 = "1rfsfhna5hy5lc6hkg1zc2862pdc5c1y9z6aiy8rinlmzrfplhlb";
|
2006-03-10 23:48:34 +00:00
|
|
|
};
|
|
|
|
|
2008-06-13 05:30:57 +01:00
|
|
|
installTargets = ["non-interactive-package"];
|
2009-02-03 10:39:48 +00:00
|
|
|
|
2008-06-13 05:30:57 +01:00
|
|
|
installFlags = [" install_root=$out "];
|
2009-02-03 10:39:48 +00:00
|
|
|
|
|
|
|
preInstall = ''
|
2008-06-30 22:11:07 +01:00
|
|
|
sed -e '/^PATH=/d' -i postfix-install
|
2009-02-03 10:39:48 +00:00
|
|
|
'';
|
|
|
|
|
2008-06-13 05:30:57 +01:00
|
|
|
postInstall = ''
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out
|
2008-06-13 05:30:57 +01:00
|
|
|
mv ut/$out/* $out/
|
2008-06-30 22:11:07 +01:00
|
|
|
|
|
|
|
mkdir $out/share/postfix/conf
|
|
|
|
cp conf/* $out/share/postfix/conf
|
2011-11-05 21:14:30 +00:00
|
|
|
sed -e 's@PATH=.*@PATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin@' -i $out/share/postfix/conf/post-install $out/libexec/postfix/post-install
|
|
|
|
sed -e '2aPATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin' -i $out/share/postfix/conf/postfix-script $out/libexec/postfix/postfix-script
|
2008-06-30 22:11:07 +01:00
|
|
|
chmod a+x $out/share/postfix/conf/{postfix-script,post-install}
|
2008-06-13 05:30:57 +01: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 22:11:07 +01:00
|
|
|
|
2011-11-05 18:50:43 +00:00
|
|
|
make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${cyrus_sasl}/include/sasl' AUXLIBS='-lssl -lcrypto -lsasl2 -ldb -lnsl'
|
2008-06-13 05:30:57 +01:00
|
|
|
'';
|
|
|
|
|
2011-11-05 18:50:43 +00:00
|
|
|
buildInputs = [db4 openssl cyrus_sasl bison perl];
|
2012-08-28 14:13:21 +01:00
|
|
|
|
2011-11-05 18:50:43 +00:00
|
|
|
patches = [ ./postfix-2.2.9-db.patch ./postfix-2.2.9-lib.patch ./db-linux3.patch ];
|
2011-11-05 21:14:30 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e s,/usr/bin,/var/run/current-system/sw/bin, \
|
|
|
|
-e s,/usr/sbin,/var/run/current-system/sw/sbin, \
|
|
|
|
-e s,:/sbin,, src/util/sys_defs.h
|
2012-08-28 14:13:34 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://www.postfix.org/";
|
|
|
|
description = "a fast, easy to administer, and secure mail server";
|
|
|
|
license = stdenv.lib.licenses.bsdOriginal;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.simons ];
|
|
|
|
};
|
2011-11-05 21:14:30 +00:00
|
|
|
'';
|
2012-08-28 14:13:21 +01:00
|
|
|
|
2006-03-10 23:48:34 +00:00
|
|
|
inherit glibc;
|
|
|
|
}
|