all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ivan Gankevich <i.gankevich@spbu.ru>
To: 49685@debbugs.gnu.org
Cc: Ivan Gankevich <i.gankevich@spbu.ru>
Subject: [bug#49685] [PATCH] gnu: sendmail: Install executables to $prefix/sbin and $prefix/bin directories.
Date: Fri, 23 Jul 2021 21:15:39 +0300	[thread overview]
Message-ID: <20210723181538.8402-1-i.gankevich@spbu.ru> (raw)
In-Reply-To: <20210721183504.9388-1-i.gankevich@spbu.ru>

Currently "sendmail" installs executables to $PREFIX/usr/sbin and
$PREFIX/usr/bin directories. This patch changes them to $PREFIX/sbin and
$PREFIX/bin respectively. Also this patch fixes broken symlinks in
$PREFIX/bin and updates package definitions that use old sendmail paths.

* gnu/packages/mail.scm (sendmail): Set new paths.
 [arguments]<#:phases>{replace-/usr}: Remove /usr prefix.
 [arguments]<#:phases>{post-install}: Fix broken symlinks
 [arguments]<#:phases>{configure}: Set paths without /usr prefix.
* gnu/packages/mail.scm (claws-mail): Use new sendmail paths.
* gnu/packages/version-control.scm (python-git-multimail): Use new
  sendmail paths.
---
 gnu/packages/mail.scm            | 28 ++++++++++++++++++++++++----
 gnu/packages/version-control.scm |  2 +-
 2 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index f0f1540cc9..a76a56694c 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -1635,7 +1635,7 @@ compresses it.")
              (let* ((mailutils (assoc-ref inputs "mailutils"))
                     (inc (string-append mailutils "/bin/mu-mh/inc"))
                     (send-mail (assoc-ref inputs "sendmail"))
-                    (sendmail (string-append send-mail "/usr/sbin/sendmail")))
+                    (sendmail (string-append send-mail "/sbin/sendmail")))
                (substitute* "src/common/defs.h"
                  (("/usr/bin/mh/inc") inc)
                  (("/usr/sbin/sendmail") sendmail)))))
@@ -2881,6 +2881,13 @@ powerful user customization features.")
              (substitute* "devtools/bin/Build"
                (("SHELL=/bin/sh") (string-append "SHELL=" (which "sh"))))
              #t))
+         (add-before 'build 'replace-/usr
+           (lambda _
+             (substitute*
+               '("devtools/OS/Linux"
+                 "cf/ostype/mklinux.m4"
+                 "cf/ostype/linux.m4")
+               (("/usr/sbin") "/sbin"))))
          (replace 'configure
            (lambda _
 
@@ -2892,6 +2899,11 @@ powerful user customization features.")
              (with-output-to-file "devtools/Site/site.config.m4"
                (lambda ()
                  (format #t "
+define(`confEBINDIR', `/sbin')
+define(`confSBINDIR', `/sbin')
+define(`confMBINDIR', `/sbin')
+define(`confUBINDIR', `/bin')
+define(`confLINKS', `')
 define(`confCC', `gcc')
 define(`confOPTIMIZE', `-g -O2')
 define(`confLIBS', `-lresolv')
@@ -2910,13 +2922,21 @@ define(`confINST_DEP', `')
          (add-before 'install 'pre-install
            (lambda _
              (let ((out (assoc-ref %outputs "out")))
-               (mkdir-p (string-append out "/usr/bin"))
-               (mkdir-p (string-append out "/usr/sbin"))
+               (mkdir-p (string-append out "/bin"))
+               (mkdir-p (string-append out "/sbin"))
                (mkdir-p (string-append out "/etc/mail"))
                (setenv "DESTDIR" out)
                (with-directory-excursion "cf/cf"
                  (invoke "sh" "Build" "install-cf"))
-               #t))))
+               #t)))
+         (add-after 'install 'post-install
+           (lambda _
+               ;; Make symbolic links manually, because build script uses
+               ;; absolute paths for them and ignores DESTDIR.
+               (for-each
+                 (lambda (name)
+                   (symlink "../sbin/sendmail" (string-append %output "/bin/" name)))
+                 '("hoststat" "newaliases" "mailq" "purgestat")))))
        ;; There is no make check.  There are some post installation tests, but those
        ;; require root privileges
        #:tests? #f))
diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index 7c1dbe8b26..814a87904e 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -1036,7 +1036,7 @@ a built-in cache to decrease server I/O pressure.")
                                "'"))
                (("/usr/sbin/sendmail")
                 (string-append (assoc-ref inputs "sendmail")
-                               "/usr/sbin/sendmail")))
+                               "/sbin/sendmail")))
              #t)))))
     (inputs
      `(("git" ,git)
-- 
2.32.0





  parent reply	other threads:[~2021-07-23 18:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 18:35 [bug#49685] [PATCH] gnu: Add task-spooler Ivan Gankevich
2021-07-21 19:00 ` Maxime Devos
2021-07-23 18:22   ` Ivan Gankevich
2021-07-23 18:15 ` Ivan Gankevich [this message]
2021-08-10 15:20   ` bug#49685: " Ludovic Courtès
2021-07-23 18:19 ` [bug#49685] " Ivan Gankevich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210723181538.8402-1-i.gankevich@spbu.ru \
    --to=i.gankevich@spbu.ru \
    --cc=49685@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.