2014-01-31 21:05:37 +01:00
|
|
|
{ stdenv, fetchurl, db, glibc, openssl, cyrus_sasl
|
2011-11-05 19:50:43 +01:00
|
|
|
, coreutils, findutils, gnused, gnugrep, bison, perl
|
2010-08-06 12:34:34 +02:00
|
|
|
}:
|
2006-03-11 00:48:34 +01:00
|
|
|
|
2010-08-06 12:34:34 +02:00
|
|
|
assert stdenv.isLinux;
|
2008-06-13 14:03:55 +02:00
|
|
|
|
2012-08-28 15:14:03 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2012-08-28 15:18:17 +02:00
|
|
|
name = "postfix-2.8.12";
|
2012-08-28 15:13:21 +02:00
|
|
|
|
2006-03-11 00:48:34 +01:00
|
|
|
src = fetchurl {
|
2012-08-28 15:14:03 +02:00
|
|
|
url = "ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/${name}.tar.gz";
|
2012-08-28 15:18:17 +02:00
|
|
|
sha256 = "11z07mjy53l1fnl7k4101yk4ilibgqr1164628mqcbmmr8bh2szl";
|
2006-03-11 00:48:34 +01:00
|
|
|
};
|
|
|
|
|
2014-01-31 21:05:37 +01:00
|
|
|
buildInputs = [db openssl cyrus_sasl bison perl];
|
2008-06-30 23:11:07 +02:00
|
|
|
|
2016-02-12 16:29:23 +01:00
|
|
|
hardening_format = false;
|
|
|
|
|
2015-12-31 10:02:45 +01:00
|
|
|
patches = [
|
|
|
|
./postfix-2.2.9-db.patch
|
|
|
|
./postfix-2.2.9-lib.patch
|
|
|
|
./db-linux3.patch
|
|
|
|
./postfix-script-shell.patch
|
|
|
|
];
|
2012-08-28 15:17:06 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e s,/usr/bin,/var/run/current-system/sw/bin, \
|
2015-04-01 22:57:06 +02:00
|
|
|
-e s,/usr/sbin,/var/run/current-system/sw/bin, \
|
2012-08-28 15:17:06 +02:00
|
|
|
-e s,:/sbin,, src/util/sys_defs.h
|
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
|
|
|
|
2015-04-05 19:26:13 +02:00
|
|
|
make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${cyrus_sasl}/include/sasl -fPIE -fstack-protector-all --param ssp-buffer-size=4 -O2 -D_FORTIFY_SOURCE=2' AUXLIBS='-lssl -lcrypto -lsasl2 -ldb -lnsl -pie -Wl,-z,relro,-z,now'
|
2008-06-13 06:30:57 +02:00
|
|
|
'';
|
|
|
|
|
2012-08-28 15:17:06 +02:00
|
|
|
installPhase = ''
|
|
|
|
sed -e '/^PATH=/d' -i postfix-install
|
|
|
|
$SHELL postfix-install install_root=out -non-interactive -package
|
2012-08-28 15:13:21 +02:00
|
|
|
|
2012-08-28 15:17:06 +02:00
|
|
|
mkdir -p $out
|
|
|
|
mv -v "out$out/"* $out/
|
2011-11-05 22:14:30 +01:00
|
|
|
|
2012-08-28 15:17:06 +02:00
|
|
|
mkdir -p $out/share/postfix
|
|
|
|
mv conf $out/share/postfix/
|
|
|
|
mv LICENSE TLS_LICENSE $out/share/postfix/
|
|
|
|
|
|
|
|
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
|
|
|
|
chmod a+x $out/share/postfix/conf/{postfix-script,post-install}
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit glibc;
|
2012-08-28 15:13:34 +02: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 ];
|
|
|
|
};
|
2006-03-11 00:48:34 +01:00
|
|
|
}
|