From 169ef7616b376c6047dcaa14c7c208504e3b49be Mon Sep 17 00:00:00 2001 From: Zheng Junjie Date: Thu, 6 Feb 2025 22:41:55 +0800 Subject: [PATCH] gnu: opensmtpd: Set sysconfdir to /etc. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/packages/mail.scm (opensmtpd)[arguments]<#:configure-flags>: Add --sysconfdir=/etc. <#:phases>: Add fix-smtpd.conf-install-path phase. Reviewed-by: 宋文武 Change-Id: I949b8ec18e36b059cf3f56a109e750af1284b1d2 --- gnu/packages/mail.scm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index bcfdeab326f60fa1271300bcbe084a68f02ecf8d..3e90b3d0b80778f99b0af0c86e70d9e5939cf0ec 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -57,7 +57,7 @@ ;;; Copyright © 2023 Wilko Meyer ;;; Copyright © 2024 Benjamin Slade ;;; Copyright © 2024 Jean Simard -;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> +;;; Copyright © 2024, 2025 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2024 Ashish SHUKLA ;;; Copyright © 2025 Tanguy Le Carrour ;;; Copyright © 2025 Sharlatan Hellseher @@ -3322,6 +3322,8 @@ from the Cyrus IMAP project.") (list #:configure-flags #~(list "--localstatedir=/var" + ;; Allow work with /etc/mailname. + "--sysconfdir=/etc" "--with-libbsd" ;; This is the default only if it exists at build time—it doesn't. "--with-path-socket=/var/run" @@ -3352,6 +3354,15 @@ from the Cyrus IMAP project.") (("/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