[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: gnu: Add postfix.
From: |
guix-commits |
Subject: |
01/02: gnu: Add postfix. |
Date: |
Fri, 7 Feb 2020 08:49:14 -0500 (EST) |
boskovits pushed a commit to branch wip-postfix
in repository guix.
commit 5154e27e57c251ec0fd4cae1a8e97a63a97eab94
Author: Gábor Boskovits <address@hidden>
AuthorDate: Mon Feb 3 13:31:34 2020 +0100
gnu: Add postfix.
* gnu/packages/mail.scm (postfix-minimal): New variable.
Co-authored-by: Brant Gardner <address@hidden>
---
gnu/packages/mail.scm | 115 +++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 113 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 67aa079..33f7471 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -26,9 +26,10 @@
;;; Copyright © 2017, 2018 Rene Saavedra <address@hidden>
;;; Copyright © 2018, 2019 Pierre Langlois <address@hidden>
;;; Copyright © 2018 Alex Vong <address@hidden>
-;;; Copyright © 2018 Gábor Boskovits <address@hidden>
+;;; Copyright © 2018, 2020 Gábor Boskovits <address@hidden>
;;; Copyright © 2018, 2019 Ricardo Wurmus <address@hidden>
;;; Copyright © 2019 Tanguy Le Carrour <address@hidden>
+;;; Copyright © 2020 Brant Gardner <address@hidden>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -128,7 +129,7 @@
gpl2 gpl2+ gpl3 gpl3+ lgpl2.1 lgpl2.1+ lgpl3+
non-copyleft (expat . license:expat) bsd-3
public-domain bsd-4 isc (openssl . license:openssl)
- bsd-2 x11-style agpl3 asl2.0 perl-license))
+ bsd-2 x11-style agpl3 asl2.0 perl-license ibmpl1.0))
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
@@ -3160,3 +3161,113 @@ related tools to process winmail.dat files.")
complement or replace traditional mailing lists. Readers may read via NNTP,
Atom feeds or HTML archives.")
(license agpl3+))))
+
+(define-public postfix-minimal
+ (package
+ (name "postfix-minimal")
+ (version "3.4.8")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "http://cdn.postfix.johnriley.me/"
+ "mirrors/postfix-release/official/"
+ "postfix-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0hw9kbr05qdzvfqhxi4dp4n3s9xvdh0gr0la08a4bip06ybl4pcd"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'patch-/bin/sh
+ (lambda _
+ (substitute* (find-files "." "^Makefile.in")
+ (("/bin/sh") (which "sh")))
+ #t))
+ ;; allow us to find the bdb headers
+ (add-before 'build 'patch-/usr/include
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* '("makedefs")
+ (("/usr/include") (string-append (assoc-ref inputs "bdb")
+ "/include")))
+ #t))
+ (add-before 'build 'set-up-environment
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; os detection on Guix System does not provide this
+ (setenv "AUXLIBS" "-lnsl")
+ ;; have to set this here, so that we get the correct
+ ;; location in the compiled binaries
+ (setenv "shlib_directory" (assoc-ref outputs "out"))
+ #t))
+ ;; do not allow writes to the configuration directory,
+ ;; so that we can keep that in the store
+ (add-before 'build 'disable-postconf-edit
+ (lambda _
+ (substitute* "src/postconf/postconf_edit.c"
+ (("pcf_set_config_dir\\(\\);") "return 0;"))))
+ (add-before 'build 'configure-compile
+ (lambda _
+ (invoke "make" "makefiles" "pie=yes" "dynamicmaps=yes")))
+ (add-before 'install 'fix-postfix-scripts-path
+ (lambda _
+ (for-each
+ (lambda (command)
+ (substitute* '("postfix-install" "conf/post-install")
+ (((string-append command " ")) (string-append (which
command) " "))))
+ '("awk" "chmod" "chown" "chgrp" "cp" "find" "ln" "mkdir" "mv"
"rm" "sed"
+ "sort" "touch" "uname"))
+ #t))
+ (add-before 'install 'configure-install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (setenv "sendmail_path" (string-append out "/sendmail"))
+ (setenv "newaliases_path" (string-append out "/newaliases"))
+ (setenv "mailq_path" (string-append out "/mailq"))
+ (setenv "command_directory" out)
+ (setenv "config_directory" out)
+ (setenv "daemon_directory" out)
+ (setenv "data_directory" out)
+ (setenv "html_directory" out)
+ (setenv "queue_directory" out)
+ (setenv "manpage_directory" out)
+ (setenv "sample_directory" out)
+ (setenv "meta_directory" out)
+ (setenv "readme_directory" out))
+ (setenv "tempdir" "/tmp")
+ #t))
+ ;; done in the service activation snippet
+ ;; we don't have the account here
+ (add-before 'fix-postfix-scripts-path 'disable-chown
+ (lambda _
+ (substitute* "postfix-install"
+ (("chown") (which "true")))
+ (substitute* "postfix-install"
+ (("chgrp") (which "true")))
+ #t))
+ ;; disable writing the configuration files (service provides these)
+ ;; disable chowning (does not matter, stuff ends up in the store)
+ ;; and disable live update code (we always install to a clean
directory)
+ (add-after 'configure-install 'disable-postinstall
+ (lambda _
+ (substitute* "postfix-install"
+ (("# we're sorry.") "exit 0"))
+ #t))
+ ;; postfix by default uses an interactive installer
+ ;; replacing it with the upgrade target allows for
+ ;; a non-interactive install.
+ (replace 'install
+ (lambda _
+ (invoke "make" "upgrade")))
+ (delete 'configure)
+ (delete 'check))))
+ (inputs `(("bdb" ,bdb)
+ ("libnsl" ,libnsl)))
+ (native-inputs `(("coreutils" ,coreutils)
+ ("m4" ,m4)))
+ (home-page "http://www.postfix.org") ; https disabled on server
+ (synopsis "Wietse Venema's mail server")
+ (description "Postfix is Wietse Venema's mail server that started life at
+IBM research as an alternative to the widely-used Sendmail program. Now at
+Google, Wietse continues to support Postfix. Postfix attempts to be fast, easy
+to administer, and secure. The outside has a definite Sendmail-ish flavor, but
+the inside is completely different.")
+ (license ibmpl1.0)))