From 1da7a6960f250097801b0c82bcf080e56faf2c75 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 10 Jan 2019 20:09:26 +0100 Subject: move package --- guix/custom-packages/postfix.scm | 118 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 guix/custom-packages/postfix.scm (limited to 'guix') diff --git a/guix/custom-packages/postfix.scm b/guix/custom-packages/postfix.scm new file mode 100644 index 0000000..bb91dc3 --- /dev/null +++ b/guix/custom-packages/postfix.scm @@ -0,0 +1,118 @@ +(define-module (custom-packages postfix) + #:use-module (gnu packages databases) + #:use-module (gnu packages m4) + #:use-module (gnu packages pcre) + #:use-module (gnu packages tls) + #:use-module (gnu packages cyrus-sasl) + #:use-module (gnu packages openldap) + #:use-module (guix) + #:use-module (guix utils) + #:use-module (guix build-system gnu) + #:use-module ((guix licenses) #:prefix license:)) + + +(define-public postfix + (package + (name "postfix") + (version "3.3.2") + (source (origin + (method url-fetch) + (uri (string-append + "http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-" + version ".tar.gz")) + (sha256 (base32 + "0nxkszdgs6fs86j6w1lf3vhxvjh1hw2jmrii5icqx9a9xqgg74rw")))) + (native-inputs + `(("m4" ,m4))) + (inputs + `(("bdb" ,bdb) + ("openssl" ,openssl) + ("sqlite" ,sqlite) + ("pcre" ,pcre) + ("postgresql" ,postgresql) + ("openldap" ,openldap) + ("cyrus-sasl" ,cyrus-sasl) + ("lmdb" ,lmdb))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs inputs configure-flags #:allow-other-keys) + (define (dir-setting name dir) + (string-append name "=" (assoc-ref outputs "out") dir)) + (invoke + "make" + "makefiles" + (string-append "SHELL=" (which "sh")) + (dir-setting "daemon_directory" "/libexec/postfix") + (dir-setting "shlib_directory" "/lib/postfix") + (dir-setting "command_directory" "/lib/sbin") + (dir-setting "manpage_directory" "/share/man") + (dir-setting "newaliases_path" "/bin/newaliases") + (dir-setting "mailq_path" "/bin/mailq") + (dir-setting "sendmail_path" "/sbin/sendmail") + (string-append + "CCARGS=" + (string-join + (list + "-DHAS_DB" + "-DHAS_LMDB" + "-DHAS_PGSQL" + "-DHAS_PCRE" + "-DHAS_LDAP" + "-DHAS_SQLITE" + "-DUSE_TLS" + "-DUSE_SASL_AUTH" + "-DUSE_CYRUS_SASL" + ;; only the default, can be changed at run time + "-DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"" + "-DNO_NIS" + (string-append + "-I" + (assoc-ref inputs "cyrus-sasl") + "/include/sasl")) + " ")) + "shared=yes" + (string-append + "SHLIB_RPATH=-Wl,-rpath," + (assoc-ref outputs "out") + "/lib/postfix") + "dynamicmaps=yes" + "AUXLIBS=-ldb -lresolv -lssl -lcrypto -lsasl2" + "AUXLIBS_LMDB=-llmdb" + "AUXLIBS_LDAP=-lldap -llber" + "AUXLIBS_PCRE=-lpcre" + "AUXLIBS_PGSQL=-lpq" + "AUXLIBS_SQLITE=-lsqlite3 -lpthread"))) + (replace 'install + (lambda* (#:key outputs inputs configure-flags #:allow-other-keys) + (substitute* "postfix-install" + (("^SHELL=/bin/sh$") "SHELL=sh") + (("^PATH=.*$") "")) + (setenv "LD_LIBRARY_PATH" + (string-append (getcwd) "/lib")) + (invoke + "sh" + "postfix-install" + (string-append "install_root=" (assoc-ref outputs "out")) + "daemon_directory=/libexec/postfix" + "command_directory=/sbin" + "manpage_directory=/share/man" + "newaliases_path=/bin/newaliases" + "mailq_path=/bin/mailq" + "sendmail_path=/sbin/sendmail" + "shlib_directory=/lib/postfix" + "-non-interactive" + "-package")))))) + (synopsis "High-performance mail transport agent") + (description + "Postfix is Wietse Venema's mail transport agent that started + life as an alternative to the widely-used Sendmail program. + Postfix attempts to be fast, easy to administer, and secure, + while at the same time being sendmail compatible enough to + not upset existing users. Thus, the outside has a sendmail-ish + flavor, but the inside is completely different.") + (license license:ibmpl1.0) + (home-page "http://www.postfix.org/"))) -- cgit v1.2.3