~ruther/guix-local

314cacc3588c0caf7b20c33772aeed6832e793df — Zheng Junjie 1 year, 3 months ago 169ef76
gnu: opensmtpd: Use G-expressions.

* gnu/packages/mail.scm (opensmtpd)[arguments]<#:phases>: Use G-expressions.

Reviewed-by: 宋文武 <iyzsong@envs.net>
Change-Id: I97dce2865e2b67f0f7cd4f10b0b6cc10a459ceb7
1 files changed, 37 insertions(+), 38 deletions(-)

M gnu/packages/mail.scm
M gnu/packages/mail.scm => gnu/packages/mail.scm +37 -38
@@ 3338,44 3338,43 @@ from the Cyrus IMAP project.")
              (string-append "ac_cv_path_ZCAT="
                             #$(this-package-input "gzip") "/bin/zcat"))
      #:phases
      `(modify-phases %standard-phases
         ;; Fix some incorrectly hard-coded external tool file names.
         (add-after 'unpack 'patch-FHS-file-names
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "mk/pathnames"
               ;; avoids warning smtpd: couldn't enqueue offline message
               ;; smtpctl exited abnormally
               (("(-DPATH_SMTPCTL=).*\\\\" all def)
                (string-append def "\\\"/run/privileged/bin/smtpctl\\\" \\"))
               (("(-DPATH_MAKEMAP=).*\\\\" all def)
                (string-append def "\\\"/run/privileged/bin/makemap\\\" \\")))
             (substitute* "usr.sbin/smtpd/smtpctl.c"
               ;; ‘gzcat’ is auto-detected at compile time, but ‘cat’ isn't.
               (("/bin/cat" file) (search-input-file inputs file)))
             (substitute* "usr.sbin/smtpd/mda_unpriv.c"
               (("/bin/sh" file) (search-input-file inputs file)))))
         ;; Avoid install smtpd.conf to /etc.
         (add-after 'unpack 'fix-smtpd.conf-install-path
           (lambda _
             (let ((etc (string-append (assoc-ref %outputs "out")
                                       "/etc")))
               (mkdir-p etc)
               (substitute* "mk/smtpd/Makefile.am"
                 (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)/smtpd\\.conf")
                  (string-append etc "/smtpd.conf"))))))
         ;; OpenSMTPD provides a single smtpctl utility to control both the
         ;; daemon and the local submission subsystem.  To accomodate systems
         ;; that require historical interfaces such as sendmail, newaliases or
         ;; makemap, smtpctl operates in compatibility mode if called with the
         ;; historical name.
         (add-after 'install 'install-compability-links
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out  (assoc-ref outputs "out"))
                    (sbin (string-append out "/sbin/")))
               (for-each (lambda (command)
                           (symlink "smtpctl" (string-append sbin command)))
                         (list "mailq" "makemap" "newaliases"
                               "send-mail" "sendmail"))))))))
      #~(modify-phases %standard-phases
          ;; Fix some incorrectly hard-coded external tool file names.
          (add-after 'unpack 'patch-FHS-file-names
            (lambda* (#:key inputs #:allow-other-keys)
              (substitute* "mk/pathnames"
                ;; avoids warning smtpd: couldn't enqueue offline message
                ;; smtpctl exited abnormally
                (("(-DPATH_SMTPCTL=).*\\\\" all def)
                 (string-append def "\\\"/run/privileged/bin/smtpctl\\\" \\"))
                (("(-DPATH_MAKEMAP=).*\\\\" all def)
                 (string-append def "\\\"/run/privileged/bin/makemap\\\" \\")))
              (substitute* "usr.sbin/smtpd/smtpctl.c"
                ;; ‘gzcat’ is auto-detected at compile time, but ‘cat’ isn't.
                (("/bin/cat" file) (search-input-file inputs file)))
              (substitute* "usr.sbin/smtpd/mda_unpriv.c"
                (("/bin/sh" file) (search-input-file inputs file)))))
          ;; Avoid install smtpd.conf to /etc.
          (add-after 'unpack 'fix-smtpd.conf-install-path
            (lambda _
              (let ((etc (string-append #$output "/etc")))
                (mkdir-p etc)
                (substitute* "mk/smtpd/Makefile.am"
                  (("\\$\\(DESTDIR\\)\\$\\(sysconfdir\\)/smtpd\\.conf")
                   (string-append etc "/smtpd.conf"))))))
          ;; OpenSMTPD provides a single smtpctl utility to control both the
          ;; daemon and the local submission subsystem.  To accomodate systems
          ;; that require historical interfaces such as sendmail, newaliases or
          ;; makemap, smtpctl operates in compatibility mode if called with the
          ;; historical name.
          (add-after 'install 'install-compability-links
            (lambda* (#:key outputs #:allow-other-keys)
              (let* ((out  (assoc-ref outputs "out"))
                     (sbin (string-append out "/sbin/")))
                (for-each (lambda (command)
                            (symlink "smtpctl" (string-append sbin command)))
                          (list "mailq" "makemap" "newaliases"
                                "send-mail" "sendmail"))))))))
    (synopsis "Lightweight SMTP daemon")
    (description
     "OpenSMTPD is an implementation of server-side @acronym{SMTP, Simple Mail