diff --git a/pkgs/servers/mail/popa3d/default.nix b/pkgs/servers/mail/popa3d/default.nix index 809f424d6654..7a5d701ea8c1 100644 --- a/pkgs/servers/mail/popa3d/default.nix +++ b/pkgs/servers/mail/popa3d/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl, pkgconfig, openssl, lua5, curl, readline, bison, expat}: +{ stdenv, fetchurl, openssl }: stdenv.mkDerivation rec { @@ -9,7 +9,11 @@ stdenv.mkDerivation rec { sha256 = "0zvspgnlrx4jhhkb5b1p280nsf9d558jijgpvwfyvdp4q4v460z7"; }; - configurePhase = ''makeFlags="LIBS=-lcrypt PREFIX=$out MANDIR=$out/share/man"''; + buildInputs = [ openssl ]; + + patches = [ ./fix-mail-spool-path.patch ./use-openssl.patch ./use-glibc-crypt.patch ]; + + configurePhase = ''makeFlags="PREFIX=$out MANDIR=$out/share/man"''; meta = { homepage = "http://www.openwall.com/popa3d/"; diff --git a/pkgs/servers/mail/popa3d/fix-mail-spool-path.patch b/pkgs/servers/mail/popa3d/fix-mail-spool-path.patch new file mode 100644 index 000000000000..4f440ae59663 --- /dev/null +++ b/pkgs/servers/mail/popa3d/fix-mail-spool-path.patch @@ -0,0 +1,12 @@ +diff -ubr popa3d-1.0.2-orig/params.h popa3d-1.0.2/params.h +--- popa3d-1.0.2-orig/params.h 2012-09-19 01:19:56.698098130 +0200 ++++ popa3d-1.0.2/params.h 2012-09-19 01:21:13.748065132 +0200 +@@ -191,7 +191,7 @@ + * + * #undef this for qmail-style $HOME/Mailbox mailboxes. + */ +-#define MAIL_SPOOL_PATH "/var/mail" ++#define MAIL_SPOOL_PATH "/var/spool/mail" + + #ifndef MAIL_SPOOL_PATH + /* diff --git a/pkgs/servers/mail/popa3d/use-glibc-crypt.patch b/pkgs/servers/mail/popa3d/use-glibc-crypt.patch new file mode 100644 index 000000000000..35843a38bb31 --- /dev/null +++ b/pkgs/servers/mail/popa3d/use-glibc-crypt.patch @@ -0,0 +1,12 @@ +diff -ubr popa3d-1.0.2-orig/Makefile popa3d-1.0.2/Makefile +--- popa3d-1.0.2-orig/Makefile 2012-09-19 01:19:56.698098130 +0200 ++++ popa3d-1.0.2/Makefile 2012-09-19 01:24:33.871750473 +0200 +@@ -9,7 +9,7 @@ + LDFLAGS = -s + LIBS = + # Linux with glibc, FreeBSD, NetBSD +-#LIBS += -lcrypt ++LIBS += -lcrypt + # HP-UX trusted system + #LIBS += -lsec + # Solaris (POP_STANDALONE, POP_VIRTUAL) diff --git a/pkgs/servers/mail/popa3d/use-openssl.patch b/pkgs/servers/mail/popa3d/use-openssl.patch new file mode 100644 index 000000000000..54301dd873b9 --- /dev/null +++ b/pkgs/servers/mail/popa3d/use-openssl.patch @@ -0,0 +1,21 @@ +diff -ubr popa3d-1.0.2-orig/Makefile popa3d-1.0.2/Makefile +--- popa3d-1.0.2-orig/Makefile 2012-09-19 01:19:56.698098130 +0200 ++++ popa3d-1.0.2/Makefile 2012-09-19 01:23:00.309636423 +0200 +@@ -5,7 +5,7 @@ + INSTALL = install -c + CFLAGS = -Wall -O2 -fomit-frame-pointer + # You may use OpenSSL's MD5 routines instead of the ones supplied here +-#CFLAGS += -DHAVE_OPENSSL ++CFLAGS += -DHAVE_OPENSSL + LDFLAGS = -s + LIBS = + # Linux with glibc, FreeBSD, NetBSD +@@ -21,7 +21,7 @@ + # libwrap may also want this + #LIBS += -lnsl + # OpenSSL (-DHAVE_OPENSSL) +-#LIBS += -lcrypto ++LIBS += -lcrypto + + DESTDIR = + PREFIX = /usr/local