From 6bb016101fc20e8af54c2fc92b4cd44232bb7f74 Mon Sep 17 00:00:00 2001 From: Hoang Xuan Phu Date: Sun, 28 Feb 2016 16:19:18 +0800 Subject: postfix: use relative symlinks for mailq and newaliases --- pkgs/servers/mail/postfix/3.0.nix | 7 ++++++- pkgs/servers/mail/postfix/relative-symlinks.patch | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 pkgs/servers/mail/postfix/relative-symlinks.patch diff --git a/pkgs/servers/mail/postfix/3.0.nix b/pkgs/servers/mail/postfix/3.0.nix index 9ea151e597bb..52327090e441 100644 --- a/pkgs/servers/mail/postfix/3.0.nix +++ b/pkgs/servers/mail/postfix/3.0.nix @@ -35,7 +35,12 @@ in stdenv.mkDerivation rec { ++ lib.optional withMySQL libmysql ++ lib.optional withSQLite sqlite; - patches = [ ./postfix-script-shell.patch ./postfix-3.0-no-warnings.patch ./post-install-script.patch ]; + patches = [ + ./postfix-script-shell.patch + ./postfix-3.0-no-warnings.patch + ./post-install-script.patch + ./relative-symlinks.patch + ]; preBuild = '' sed -e '/^PATH=/d' -i postfix-install diff --git a/pkgs/servers/mail/postfix/relative-symlinks.patch b/pkgs/servers/mail/postfix/relative-symlinks.patch new file mode 100644 index 000000000000..f7a2078c0343 --- /dev/null +++ b/pkgs/servers/mail/postfix/relative-symlinks.patch @@ -0,0 +1,13 @@ +diff --git a/postfix-install b/postfix/postfix-install +index 1662c3d..0f20ec0 100644 +--- a/postfix-install ++++ b/postfix-install +@@ -336,7 +336,7 @@ compare_or_symlink() { + # 2) we cannot use mv to replace a symlink-to-directory; + # 3) "ln -n" is not in POSIX, therefore it's not portable. + # rm+ln is less atomic but this affects compatibility symlinks only. +- rm -f $2 && ln -sf $link $2 || exit 1 ++ rm -f $2 && ln -rsf $link $2 || exit 1 + } + } + -- cgit 1.4.1