all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
@ 2021-03-27 17:34 Rovanion Luckey
  2021-03-27 18:07 ` Léo Le Bouter via Guix-patches via
  2021-03-27 18:22 ` Leo Famulari
  0 siblings, 2 replies; 8+ messages in thread
From: Rovanion Luckey @ 2021-03-27 17:34 UTC (permalink / raw)
  To: 47435


[-- Attachment #1.1: Type: text/plain, Size: 655 bytes --]

This is an attempt at getting the sendmail package working. Currently
installing the package does not make the `sendmail` executable appear in
`$PATH`:


> └$ guix environment --ad-hoc sendmail
> └$ sendmail
> bash: sendmail: command not found

This patch fixes that.

Though there are questions that still need to be resolved. While this patch
does fix what it sets out to fix, the solutions aren't neccicerily correct.
It configures a "helpfile" to be put in "$out/usr/share" and the same goes
for its "statistics" file. I have no idea what these does and where they
should go in reality. If someone happens to know, please do tell.

[-- Attachment #1.2: Type: text/html, Size: 800 bytes --]

[-- Attachment #2: 0001-gnu-mail-Make-the-sendmail-package-actually-output-i.patch --]
[-- Type: text/x-patch, Size: 3001 bytes --]

From db5c0cf1b4686410f365b36d708aceed1742efec Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Sat, 27 Mar 2021 18:28:02 +0100
Subject: [PATCH] gnu: mail: Make the sendmail package actually output its
 binary

The binary sendmail was not installed when sendmail was installed. This patch fixes this.
---
 gnu/packages/mail.scm | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index b02f547e03..6fefc15d65 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2761,23 +2761,41 @@ powerful user customization features.")
                (("SHELL=/bin/sh") (string-append "SHELL=" (which "sh"))))
              #t))
          (replace 'configure
-           (lambda _
+           (lambda* (#:key outputs #:allow-other-keys)
 
              ;; Render harmless any attempts to chown or chgrp
              (substitute* "devtools/bin/install.sh"
                (("owner=\\$2") "owner=''")
                (("group=\\$2") "group=''"))
 
-             (with-output-to-file "devtools/Site/site.config.m4"
-               (lambda ()
-                 (format #t "
+             (let ((out (assoc-ref outputs "out")))
+               (with-output-to-file "devtools/Site/site.config.m4"
+                 (lambda ()
+                   ;; See 'devtools/M4/UNIX/defines.m4' for the list of
+                   ;; installation directories.
+                   (format #t "
 define(`confCC', `gcc')
 define(`confOPTIMIZE', `-g -O2')
 define(`confLIBS', `-lresolv')
 define(`confINSTALL', `~a/devtools/bin/install.sh')
 define(`confDEPEND_TYPE', `CC-M')
 define(`confINST_DEP', `')
-" (getcwd))))
+
+define(`confHFDIR',   `~a/share')
+define(`confSTDIR',   `~a/share')
+define(`confMBINDIR', `~a/bin')
+define(`confUBINDIR', `~a/bin')
+define(`confSBINDIR', `~a/sbin')
+define(`confEBINDIR', `~a/libexec')
+define(`confMANROOT', `~a/share/man')~%"
+                           (getcwd)
+                           out out out out out out out))))
+
+             (substitute* "cf/cf/Makefile"
+               (("^MAILDIR=.*")
+                (string-append "MAILDIR = "
+                               (assoc-ref outputs "out")
+                               "/etc/mail\n")))
              #t))
          (replace 'build
            (lambda _
@@ -2789,10 +2807,9 @@ 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))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
  2021-03-27 17:34 [bug#47435] gnu: mail: Make the sendmail package actually output its binary Rovanion Luckey
@ 2021-03-27 18:07 ` Léo Le Bouter via Guix-patches via
  2021-03-27 18:22 ` Leo Famulari
  1 sibling, 0 replies; 8+ messages in thread
From: Léo Le Bouter via Guix-patches via @ 2021-03-27 18:07 UTC (permalink / raw)
  To: Rovanion Luckey, 47435

[-- Attachment #1: Type: text/plain, Size: 3302 bytes --]

On Sat, 2021-03-27 at 18:34 +0100, Rovanion Luckey wrote:
> This is an attempt at getting the sendmail package working. Currently
> installing the package does not make the `sendmail` executable appear
> in `$PATH`:
> 
> 
> > └$ guix environment --ad-hoc sendmail
> > └$ sendmail
> > bash: sendmail: command not found
> 
> This patch fixes that.
> 

Thanks a lot for working on this!

It seems the commit message does not follow the ChangeLog guidelines as
used by GNU Guix, I suggest using this:

> gnu: sendmail: Fix output's directory structure.
>     
> * gnu/packages/mail.scm (sendmail)[arguments]<#:phases>: Properly
> specify output directories in replacement 'configure and 'pre-
> install.

Look at the commit history of GNU Guix for more examples and
inspiration.

> Though there are questions that still need to be resolved. While this
> patch does fix what it sets out to fix, the solutions aren't
> neccicerily correct. It configures a "helpfile" to be put in
> "$out/usr/share" and the same goes for its "statistics" file. I have
> no idea what these does and where they should go in reality. If
> someone happens to know, please do tell.

If we look at the output of these commands:

With your patch applied:

$ tree $(./pre-inst-env guix build sendmail)
/gnu/store/ygz55p6g8z4kjbp6418w385jzy53324h-sendmail-8.15.2
├── bin
│   ├── hoststat -> /gnu/store/ygz55p6g8z4kjbp6418w385jzy53324h-
sendmail-8.15.2/bin/sendmail
│   ├── mailq -> /gnu/store/ygz55p6g8z4kjbp6418w385jzy53324h-sendmail-
8.15.2/bin/sendmail
│   ├── newaliases -> /gnu/store/ygz55p6g8z4kjbp6418w385jzy53324h-
sendmail-8.15.2/bin/sendmail
│   ├── purgestat -> /gnu/store/ygz55p6g8z4kjbp6418w385jzy53324h-
sendmail-8.15.2/bin/sendmail
│   ├── sendmail
│   └── vacation
├── etc
│   └── mail
│       ├── sendmail.cf
│       └── submit.cf
├── libexec
├── sbin
│   ├── editmap
│   ├── mailstats
│   ├── makemap
│   └── praliases
└── share
    ├── doc
    │   └── sendmail-8.15.2
    │       └── LICENSE
    ├── helpfile
    └── statistics

7 directories, 16 files

Without your patch applied:

$ tree $(./pre-inst-env guix build sendmail)
/gnu/store/yn6dlixw6cnbmgjggk640vbv8hidfhi7-sendmail-8.15.2
├── etc
│   └── mail
│       ├── helpfile
│       ├── sendmail.cf
│       ├── statistics
│       └── submit.cf
├── share
│   └── doc
│       └── sendmail-8.15.2
│           └── LICENSE
└── usr
    ├── bin
    │   ├── hoststat -> /usr/sbin/sendmail
    │   ├── mailq -> /usr/sbin/sendmail
    │   ├── newaliases -> /usr/sbin/sendmail
    │   ├── purgestat -> /usr/sbin/sendmail
    │   └── vacation
    └── sbin
        ├── editmap
        ├── mailstats
        ├── makemap
        ├── praliases
        ├── sendmail
        └── smrsh

8 directories, 16 files

We can see helpfile and statistics file go into etc/mail, then sendmail
goes into sbin, smrsh is missing in sbin.

Léo

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
  2021-03-27 17:34 [bug#47435] gnu: mail: Make the sendmail package actually output its binary Rovanion Luckey
  2021-03-27 18:07 ` Léo Le Bouter via Guix-patches via
@ 2021-03-27 18:22 ` Leo Famulari
  2021-03-28 11:57   ` Rovanion Luckey
  1 sibling, 1 reply; 8+ messages in thread
From: Leo Famulari @ 2021-03-27 18:22 UTC (permalink / raw)
  To: Rovanion Luckey; +Cc: 47435

On Sat, Mar 27, 2021 at 06:34:03PM +0100, Rovanion Luckey wrote:
> This is an attempt at getting the sendmail package working. Currently
> installing the package does not make the `sendmail` executable appear in
> `$PATH`:
> 
> 
> > └$ guix environment --ad-hoc sendmail
> > └$ sendmail
> > bash: sendmail: command not found
> 
> This patch fixes that.
> 
> Though there are questions that still need to be resolved. While this patch
> does fix what it sets out to fix, the solutions aren't neccicerily correct.
> It configures a "helpfile" to be put in "$out/usr/share" and the same goes
> for its "statistics" file. I have no idea what these does and where they
> should go in reality. If someone happens to know, please do tell.

Thanks for working on this!

> +             (substitute* "cf/cf/Makefile"
> +               (("^MAILDIR=.*")
> +                (string-append "MAILDIR = "
> +                               (assoc-ref outputs "out")
> +                               "/etc/mail\n")))

In addition to Léo Le Bouter's comments, I suggest either omitting or
amending this part. A Maildir is where the user's emails will be kept,
but it cannot be stored in the build output, because that directory will
be immutable after the build is complete.

https://en.wikipedia.org/wiki/Maildir

What is the default?




^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
  2021-03-27 18:22 ` Leo Famulari
@ 2021-03-28 11:57   ` Rovanion Luckey
  2021-03-29 14:24     ` Rovanion Luckey
  0 siblings, 1 reply; 8+ messages in thread
From: Rovanion Luckey @ 2021-03-28 11:57 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 47435


[-- Attachment #1.1: Type: text/plain, Size: 2011 bytes --]

> We can see helpfile and statistics file go into etc/mail, then sendmailgoes
into sbin, smrsh is missing in sbin.

Fixed.

In addition to Léo Le Bouter's comments, I suggest either omitting or
> amending this part. A Maildir is where the user's emails will be kept,
> but it cannot be stored in the build output, because that directory will
> be immutable after the build is complete.

 >

> What is the default?
>

`/etc/mail` is the default it seems. I modified the patch to use
`$out/var/spool/mail` instead. `/var/spool/mail` is where I would like to
put it on a conventional linux distribution. But I don't know if MAILDIR
means "where the user's mail will be kept" in this context because when I
do that I end up with the following file tree:


$ tree /gnu/store/05wxmp6m3pfg5d2jrwbx4rx5p3nxyyvc-sendmail-8.15.2
> /gnu/store/05wxmp6m3pfg5d2jrwbx4rx5p3nxyyvc-sendmail-8.15.2
> ├── bin
> │   ├── hoststat ->
> /gnu/store/05wxmp6m3pfg5d2jrwbx4rx5p3nxyyvc-sendmail-8.15.2/sbin/sendmail
> │   ├── mailq ->
> /gnu/store/05wxmp6m3pfg5d2jrwbx4rx5p3nxyyvc-sendmail-8.15.2/sbin/sendmail
> │   ├── newaliases ->
> /gnu/store/05wxmp6m3pfg5d2jrwbx4rx5p3nxyyvc-sendmail-8.15.2/sbin/sendmail
> │   ├── purgestat ->
> /gnu/store/05wxmp6m3pfg5d2jrwbx4rx5p3nxyyvc-sendmail-8.15.2/sbin/sendmail
> │   └── vacation
> ├── etc
> │   └── mail
> │       ├── helpfile
> │       └── statistics
> ├── libexec
> │   └── smrsh
> ├── sbin
> │   ├── editmap
> │   ├── mailstats
> │   ├── makemap
> │   ├── praliases
> │   └── sendmail
> ├── share
> │   └── doc
> │       └── sendmail-8.15.2
> │           └── LICENSE
> └── var
>     └── spool
>         └── mail
>             ├── sendmail.cf
>             └── submit.cf
>

with config files for sendmail in `$out/var/spool/mail`.

[-- Attachment #1.2: Type: text/html, Size: 2847 bytes --]

[-- Attachment #2: 0001-gnu-sendmail-Fix-output-s-directory-structure.patch --]
[-- Type: text/x-patch, Size: 3110 bytes --]

From 66b04a58ee3e3b5d301a16377afffc600e74c7db Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Sat, 27 Mar 2021 18:28:02 +0100
Subject: [PATCH] gnu: sendmail: Fix output's directory structure.

* gnu/packages/mail.scm (sendmail)[arguments]<#:phases>: Properly specify output directories in replacement 'configure and 'pre-> install.
---
 gnu/packages/mail.scm | 35 ++++++++++++++++++++++++++---------
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index b02f547e03..ed0e96a6e3 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2761,23 +2761,41 @@ powerful user customization features.")
                (("SHELL=/bin/sh") (string-append "SHELL=" (which "sh"))))
              #t))
          (replace 'configure
-           (lambda _
+           (lambda* (#:key outputs #:allow-other-keys)
 
              ;; Render harmless any attempts to chown or chgrp
              (substitute* "devtools/bin/install.sh"
                (("owner=\\$2") "owner=''")
                (("group=\\$2") "group=''"))
 
-             (with-output-to-file "devtools/Site/site.config.m4"
-               (lambda ()
-                 (format #t "
+             (let ((out (assoc-ref outputs "out")))
+               (with-output-to-file "devtools/Site/site.config.m4"
+                 (lambda ()
+                   ;; See 'devtools/M4/UNIX/defines.m4' for the list of
+                   ;; installation directories.
+                   (format #t "
 define(`confCC', `gcc')
 define(`confOPTIMIZE', `-g -O2')
 define(`confLIBS', `-lresolv')
 define(`confINSTALL', `~a/devtools/bin/install.sh')
 define(`confDEPEND_TYPE', `CC-M')
 define(`confINST_DEP', `')
-" (getcwd))))
+
+define(`confHFDIR',   `~a/etc/mail')
+define(`confSTDIR',   `~a/etc/mail')
+define(`confMBINDIR', `~a/sbin')
+define(`confUBINDIR', `~a/bin')
+define(`confSBINDIR', `~a/sbin')
+define(`confEBINDIR', `~a/sbin')
+define(`confMANROOT', `~a/share/man')~%"
+                           (getcwd)
+                           out out out out out out out))))
+
+             (substitute* "cf/cf/Makefile"
+               (("^MAILDIR=.*")
+                (string-append "MAILDIR = "
+                               (assoc-ref outputs "out")
+                               "/var/spool/mail\n")))
              #t))
          (replace 'build
            (lambda _
@@ -2789,10 +2807,9 @@ 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 "/etc/mail"))
-               (setenv "DESTDIR" out)
+               (mkdir-p (string-append out "/bin"))
+               (mkdir-p (string-append out "/sbin"))
+               (mkdir-p (string-append out "/var/spool/mail"))
                (with-directory-excursion "cf/cf"
                  (invoke "sh" "Build" "install-cf"))
                #t))))
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
  2021-03-28 11:57   ` Rovanion Luckey
@ 2021-03-29 14:24     ` Rovanion Luckey
  2021-03-30  2:05       ` Léo Le Bouter via Guix-patches via
  0 siblings, 1 reply; 8+ messages in thread
From: Rovanion Luckey @ 2021-03-29 14:24 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 47435


[-- Attachment #1.1: Type: text/plain, Size: 395 bytes --]

Attached to this email you will find three patches that
1. make the sendmail binary appear in PATH after the sendmail package is
installed,
2. add libmilter to the package collection and
3. updates sendmail and libmilter to 8.16.1.

I ended up putting smrsh back in libexec because that is where all the
other distros put it and seems like a program that should only be used by
sendmail itself.

[-- Attachment #1.2: Type: text/html, Size: 515 bytes --]

[-- Attachment #2: 0002-gnu-Add-libmilter.patch --]
[-- Type: text/x-patch, Size: 1576 bytes --]

From e09b4bf1195fcb8328a3b67f0d2eec254048bb7b Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Mon, 29 Mar 2021 15:56:25 +0200
Subject: [PATCH 2/3] gnu: Add libmilter

* gnu/packages/mail.scm (libmilter): New variable. A Sendmail API library for building mail filters.
---
 gnu/packages/mail.scm | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index a1f4147aa5..87615f5527 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2833,6 +2833,29 @@ transfer protocols.")
     (license (license:non-copyleft "file://LICENSE"
                                    "See LICENSE in the distribution."))))
 
+(define-public libmilter
+  (package
+    (inherit sendmail)
+    (name "libmilter")
+    (version "1.0.1")
+    (arguments
+     (substitute-keyword-arguments (package-arguments sendmail)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'build
+             (lambda* _
+               (with-directory-excursion "libmilter"
+                 (invoke "sh" "Build"))
+               #t))
+           (delete 'pre-install)
+           (replace 'install
+             (lambda* _
+               (with-directory-excursion "libmilter"
+                 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
+                 (invoke "make" "install"))
+               #t))))))
+    (synopsis "Sendmail library for creating mail filters.")))
+
 (define-public sieve-connect
   (package
     (name "sieve-connect")
-- 
2.30.0


[-- Attachment #3: 0003-gnu-sendmail-Update-to-8.16.1.patch --]
[-- Type: text/x-patch, Size: 1134 bytes --]

From fb7ea463cbf557e0a8f9952243593a54b6b9bde5 Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Mon, 29 Mar 2021 16:04:41 +0200
Subject: [PATCH 3/3] gnu: sendmail: Update to 8.16.1

* gnu/packages/mail.scm (sendmail): Update to 8.16.1
---
 gnu/packages/mail.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 87615f5527..eab4a9d821 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2733,7 +2733,7 @@ powerful user customization features.")
 (define-public sendmail
   (package
     (name "sendmail")
-    (version "8.15.2")
+    (version "8.16.1")
     (source
      (origin
        (method url-fetch)
@@ -2742,7 +2742,7 @@ powerful user customization features.")
              version ".tar.gz"))
        (sha256
         (base32
-         "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94"))
+         "1fk49v63w4lrpw4jjzl495vpi02w633vkd9jbwbqcss39gfdb1kq"))
        (patches (search-patches "sendmail-libmilter-shared-library.patch"))))
     (build-system gnu-build-system)
     (arguments
-- 
2.30.0


[-- Attachment #4: 0001-gnu-sendmail-Fix-output-s-directory-structure.patch --]
[-- Type: text/x-patch, Size: 7109 bytes --]

From 7629f800d16e37236e539397d0393d729bb06e73 Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Sat, 27 Mar 2021 18:28:02 +0100
Subject: [PATCH 1/3] gnu: sendmail: Fix output's directory structure.

* gnu/packages/mail.scm (sendmail)[arguments]<#:phases>: Properly specify output directories in replacement 'configure and 'pre-> install.
---
 gnu/packages/mail.scm                         | 41 ++++++++++----
 .../sendmail-libmilter-shared-library.patch   | 56 +++++++++++++++++++
 2 files changed, 87 insertions(+), 10 deletions(-)
 create mode 100644 gnu/packages/patches/sendmail-libmilter-shared-library.patch

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index b02f547e03..a1f4147aa5 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2742,7 +2742,8 @@ powerful user customization features.")
              version ".tar.gz"))
        (sha256
         (base32
-         "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94"))))
+         "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94"))
+       (patches (search-patches "sendmail-libmilter-shared-library.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -2761,23 +2762,44 @@ powerful user customization features.")
                (("SHELL=/bin/sh") (string-append "SHELL=" (which "sh"))))
              #t))
          (replace 'configure
-           (lambda _
+           (lambda* (#:key outputs #:allow-other-keys)
 
              ;; Render harmless any attempts to chown or chgrp
              (substitute* "devtools/bin/install.sh"
                (("owner=\\$2") "owner=''")
                (("group=\\$2") "group=''"))
 
-             (with-output-to-file "devtools/Site/site.config.m4"
-               (lambda ()
-                 (format #t "
+             (let ((out (assoc-ref outputs "out")))
+               (with-output-to-file "devtools/Site/site.config.m4"
+                 (lambda ()
+                   ;; See 'devtools/M4/UNIX/defines.m4' for the list of
+                   ;; installation directories.
+                   (format #t "
 define(`confCC', `gcc')
+define(`confAR', `ar')
+define(`confCCOPTS', `-fPIC')
 define(`confOPTIMIZE', `-g -O2')
 define(`confLIBS', `-lresolv')
 define(`confINSTALL', `~a/devtools/bin/install.sh')
 define(`confDEPEND_TYPE', `CC-M')
 define(`confINST_DEP', `')
-" (getcwd))))
+
+define(`confLIBDIR',     `~a/lib/')
+define(`confINCLUDEDIR', `~a/include')
+define(`confHFDIR',      `~a/etc/mail')
+define(`confSTDIR',      `~a/etc/mail')
+define(`confMBINDIR',    `~a/sbin')
+define(`confUBINDIR',    `~a/bin')
+define(`confSBINDIR',    `~a/sbin')
+define(`confEBINDIR',    `~a/libexec')
+define(`confMANROOT',    `~a/share/man')~%"
+                           (getcwd)
+                           out out out out out out out out out))))
+             (substitute* "cf/cf/Makefile"
+               (("^MAILDIR=.*")
+                (string-append "MAILDIR = "
+                               (assoc-ref outputs "out")
+                               "/etc/mail\n")))
              #t))
          (replace 'build
            (lambda _
@@ -2789,10 +2811,9 @@ 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 "/etc/mail"))
-               (setenv "DESTDIR" out)
+               (mkdir-p (string-append out "/bin"))
+               (mkdir-p (string-append out "/sbin"))
+               (mkdir-p (string-append out "/var/spool/mail"))
                (with-directory-excursion "cf/cf"
                  (invoke "sh" "Build" "install-cf"))
                #t))))
diff --git a/gnu/packages/patches/sendmail-libmilter-shared-library.patch b/gnu/packages/patches/sendmail-libmilter-shared-library.patch
new file mode 100644
index 0000000000..1e256c59ec
--- /dev/null
+++ b/gnu/packages/patches/sendmail-libmilter-shared-library.patch
@@ -0,0 +1,56 @@
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4 sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4	1970-01-01 01:00:00.000000000 +0100
++++ sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4	2009-08-22 21:51:10.000000000 +0200
+@@ -0,0 +1,39 @@
++divert(-1)
++#
++# Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
++#	All rights reserved.
++#
++# By using this file, you agree to the terms and conditions set
++# forth in the LICENSE file which can be found at the top level of
++# the sendmail distribution.
++#
++#
++#  Definitions for Makefile construction for sendmail
++#
++divert(0)dnl
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/links.m4')dnl
++define(`confSOEXT', ifdef(`confSOEXT', `confSOEXT', `so'))dnl
++bldLIST_PUSH_ITEM(`bldC_PRODUCTS', bldCURRENT_PRODUCT)dnl
++bldPUSH_TARGET(bldCURRENT_PRODUCT`.'confSOEXT bldCURRENT_PRODUCT`.a')dnl
++bldPUSH_INSTALL_TARGET(`install-'bldCURRENT_PRODUCT)dnl
++bldPUSH_CLEAN_TARGET(bldCURRENT_PRODUCT`-clean')dnl
++
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
++divert(bldTARGETS_SECTION)
++bldCURRENT_PRODUCT`.'confSOEXT: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++	${CCLINK} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.confSOEXT ifdef(`confSONAME',`-Wl,confSONAME,bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER}') ${bldCURRENT_PRODUCT`OBJS'} -lc ${LIBS}
++bldCURRENT_PRODUCT.a: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++	${AR} ${AROPTS} bldCURRENT_PRODUCT.a ${bldCURRENT_PRODUCT`OBJS'}
++	${RANLIB} ${RANLIBOPTS} bldCURRENT_PRODUCT.a
++ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
++
++install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.confSOEXT bldCURRENT_PRODUCT.a
++ifdef(`bldINSTALLABLE', `	ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}"; else :; fi ')
++	${INSTALL} -c bldCURRENT_PRODUCT.confSOEXT "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER}"
++	${LN} ${LNOPTS} bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER} "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.confSOEXT"
++	${INSTALL} -c -m 644 bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
++
++bldCURRENT_PRODUCT-clean:
++	rm -f ${OBJS} bldCURRENT_PRODUCT.confSOEXT bldCURRENT_PRODUCT.a ${MANPAGES}
++
++divert(0)
++COPTS+= confCCOPTS_SO
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4	2008-04-08 07:23:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4	2009-08-22 21:53:35.000000000 +0200
+@@ -9,7 +9,7 @@
+ SMSRCDIR=ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
+ PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
+ 
+-bldPRODUCT_START(`library', `libmilter')
++bldPRODUCT_START(`milterlibrary', `libmilter')
+ define(`bldINSTALLABLE', `true')
+ define(`LIBMILTER_EXTRAS', `errstring.c strl.c')
+ APPENDDEF(`confENVDEF', `-DNOT_SENDMAIL -Dsm_snprintf=snprintf')
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
  2021-03-29 14:24     ` Rovanion Luckey
@ 2021-03-30  2:05       ` Léo Le Bouter via Guix-patches via
  2021-03-30  2:13         ` Léo Le Bouter via Guix-patches via
  2021-04-09 19:30         ` Rovanion Luckey
  0 siblings, 2 replies; 8+ messages in thread
From: Léo Le Bouter via Guix-patches via @ 2021-03-30  2:05 UTC (permalink / raw)
  To: Rovanion Luckey, Leo Famulari; +Cc: 47435

[-- Attachment #1: Type: text/plain, Size: 4534 bytes --]

On Mon, 2021-03-29 at 16:24 +0200, Rovanion Luckey wrote:
> Attached to this email you will find three patches that
> 1. make the sendmail binary appear in PATH after the sendmail package
> is
> installed,
> 2. add libmilter to the package collection and
> 3. updates sendmail and libmilter to 8.16.1.
> 
> I ended up putting smrsh back in libexec because that is where all
> the
> other distros put it and seems like a program that should only be
> used by
> sendmail itself.

Thank you for the patches!

> +    (synopsis "Sendmail library for creating mail filters.")))
> +

On the commit message, the convention is that all titles end with a
period, also all statements in the subtext also end with a period, and
that the subtext is wrapped to 80 columns (unless links). Look at other
commit messages for examples.

It seems in your latest patches applied on top of master, the
'sendmail' package does not build:

starting phase `pre-install'
Using M4=/gnu/store/jlm51s1gz6pah5bn7mc1i12kj5xilhck-m4-1.4.18/bin/m4
../../devtools/bin/install.sh -c -o root -g bin -m 0444 sendmail.cf
/gnu/store/6iaqmnb3rgcjdh3jz56x4r1hafalrvmg-sendmail-
8.16.1/etc/mail/sendmail.cf
cp: cannot create regular file
'/gnu/store/6iaqmnb3rgcjdh3jz56x4r1hafalrvmg-sendmail-
8.16.1/etc/mail/sendmail.cf': No such file or directory
make: *** [Makefile:83: install-sendmail-cf] Error 1
command "sh" "Build" "install-cf" failed with status 2
builder for `/gnu/store/7rm2hkxw5sqz34k562wfgwsfvpg0avsk-sendmail-
8.16.1.drv' failed with exit code 1
@ build-failed /gnu/store/7rm2hkxw5sqz34k562wfgwsfvpg0avsk-sendmail-
8.16.1.drv - 1 builder for
`/gnu/store/7rm2hkxw5sqz34k562wfgwsfvpg0avsk-sendmail-8.16.1.drv'
failed with exit code 1
derivation '/gnu/store/7rm2hkxw5sqz34k562wfgwsfvpg0avsk-sendmail-
8.16.1.drv' offloaded to 'www.proxmox-2.schmilblick.org' failed: build
of `/gnu/store/7rm2hkxw5sqz34k562wfgwsfvpg0avsk-sendmail-8.16.1.drv'
failed
build of /gnu/store/7rm2hkxw5sqz34k562wfgwsfvpg0avsk-sendmail-
8.16.1.drv failed

libmilter builds fine however.

I noticed it builds as a static library:

/gnu/store/vdg98ynngj637sdn1xazgafb8af8fv2j-libmilter-
1.0.1/lib/libmilter.so.: ELF 64-bit LSB shared object, x86-64, version
1 (SYSV), statically linked, not stripped

Is there any build flag to disable that? If so, I think we probably
should, for security updates of it's dependencies, but it doesnt look
like it has any, not even the glibc? Maybe it's not so important here.

I also noticed that there was a weird naming for the actual so file, it
ends with a dot '.':

$ tree $(./pre-inst-env guix build libmilter)
/gnu/store/vdg98ynngj637sdn1xazgafb8af8fv2j-libmilter-1.0.1
├── include
│   └── libmilter
│       ├── mfapi.h
│       └── mfdef.h
├── lib
│   ├── libmilter.a
│   ├── libmilter.so -> libmilter.so. <<-- here
│   └── libmilter.so. <<-- also here
└── share
    └── doc
        └── libmilter-1.0.1
            └── LICENSE

6 directories, 6 files

Again it will work anyways I believe, not crucial.

> +(define-public libmilter
> +  (package
> +    (inherit sendmail)
> +    (name "libmilter")
> +    (version "1.0.1")

Where does this version come from? Are you sure about that? Also do
note that changing the version field here in libmilter does not change
the version used in the origin of the inherited package So it's using
the same sources as sendmail exactly, that's what you want?

> +    (arguments
> +     (substitute-keyword-arguments (package-arguments sendmail)
> +       ((#:phases phases)
> +        `(modify-phases ,phases
> +           (replace 'build
> +             (lambda* _
> +               (with-directory-excursion "libmilter"
> +                 (invoke "sh" "Build"))
> +               #t))
> +           (delete 'pre-install)
> +           (replace 'install
> +             (lambda* _
> +               (with-directory-excursion "libmilter"
> +                 (mkdir-p (string-append (assoc-ref %outputs "out")
> "/lib"))
> +                 (invoke "make" "install"))
> +               #t))))))
> +    (synopsis "Sendmail library for creating mail filters.")))
> +

I suggest adding a dedicated synopsis and description here, also
synopsises as I see it should not be sentences and not end with a
period, descriptions on the other hand should be full sentences, look
at the other packages for inspiration.

Léo

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
  2021-03-30  2:05       ` Léo Le Bouter via Guix-patches via
@ 2021-03-30  2:13         ` Léo Le Bouter via Guix-patches via
  2021-04-09 19:30         ` Rovanion Luckey
  1 sibling, 0 replies; 8+ messages in thread
From: Léo Le Bouter via Guix-patches via @ 2021-03-30  2:13 UTC (permalink / raw)
  To: Rovanion Luckey, Leo Famulari; +Cc: 47435

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

To add on my previous message, also run the linter like below and try
to fix the warnings:

$ ./pre-inst-env guix lint libmilter sendmail
gnu/packages/mail.scm:2871:2: libmilter@1.0.1: 'm4' should probably be
a native input
gnu/packages/mail.scm:2871:2: libmilter@1.0.1: file names of patches
should start with the package name
gnu/packages/mail.scm:2891:14: libmilter@1.0.1: no period allowed at
the end of the synopsis
gnu/packages/mail.scm:2871:2: libmilter@1.0.1: permanent redirect from 
http://sendmail.org to 
https://www.proofpoint.com/us/products/email-protection/open-source-email-solution
gnu/packages/mail.scm:2871:2: libmilter@1.0.1: source not archived on
Software Heritage
gnu/packages/mail.scm:2858:5: sendmail@8.16.1: 'm4' should probably be
a native input
gnu/packages/mail.scm:2860:15: sendmail@8.16.1: permanent redirect from
http://sendmail.org to 
https://www.proofpoint.com/us/products/email-protection/open-source-email-solution
gnu/packages/mail.scm:2772:5: sendmail@8.16.1: source not archived on
Software Heritage

Thank you!

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [bug#47435] gnu: mail: Make the sendmail package actually output its binary
  2021-03-30  2:05       ` Léo Le Bouter via Guix-patches via
  2021-03-30  2:13         ` Léo Le Bouter via Guix-patches via
@ 2021-04-09 19:30         ` Rovanion Luckey
  1 sibling, 0 replies; 8+ messages in thread
From: Rovanion Luckey @ 2021-04-09 19:30 UTC (permalink / raw)
  To: Léo Le Bouter; +Cc: 47435, Leo Famulari


[-- Attachment #1.1: Type: text/plain, Size: 4272 bytes --]

> On the commit message, the convention is that all titles end with a
> period, also all statements in the subtext also end with a period, and
> that the subtext is wrapped to 80 columns (unless links). Look at other
> commit messages for examples.
>

Should be fixed in the attached patch.


> It seems in your latest patches applied on top of master, the
> 'sendmail' package does not build.
>

This too.


> I noticed it builds as a static library:
>
> /gnu/store/vdg98ynngj637sdn1xazgafb8af8fv2j-libmilter-
> 1.0.1/lib/libmilter.so.: ELF 64-bit LSB shared object, x86-64, version
> 1 (SYSV), statically linked, not stripped
>
> Is there any build flag to disable that? If so, I think we probably
> should, for security updates of it's dependencies, but it doesnt look
> like it has any, not even the glibc? Maybe it's not so important here.
>

I thought the patch I pulled in from Debian made it into a shared library.
It brought it from a .a that pymilter would not build against to a .so that
it would build against. This is the first time I build C libraries for
distribution so I have no idea what I'm doing.

I seem to have misplaced my package definition for pymilter when I rebased
on master so I have to confirm again that this libmilter is actually
usable. There was something about the pymilter tests not running IIRC.


> I also noticed that there was a weird naming for the actual so file, it
> ends with a dot '.':
>

I think something somewhere in the build system wants to add a number after
that dot, but that there was no number available so it just added an empty
string after the dot.

$ tree $(./pre-inst-env guix build libmilter)
> /gnu/store/vdg98ynngj637sdn1xazgafb8af8fv2j-libmilter-1.0.1
> ├── include
> │   └── libmilter
> │       ├── mfapi.h
> │       └── mfdef.h
> ├── lib
> │   ├── libmilter.a
> │   ├── libmilter.so -> libmilter.so. <<-- here
> │   └── libmilter.so. <<-- also here
> └── share
>     └── doc
>         └── libmilter-1.0.1
>             └── LICENSE
>
> 6 directories, 6 files
>
> Again it will work anyways I believe, not crucial.
>
> > +(define-public libmilter
> > +  (package
> > +    (inherit sendmail)
> > +    (name "libmilter")
> > +    (version "1.0.1")
>
> Where does this version come from?


I think I just took it from Debian for some reason:
https://packages.debian.org/experimental/libmilter1.0.1


> Are you sure about that?


Hard no on that.


> Also do
> note that changing the version field here in libmilter does not change
> the version used in the origin of the inherited package So it's using
> the same sources as sendmail exactly, that's what you want?
>

Yeah, that is what I intended. I intended to only change the metadata
attached to the libmilter package in the Guix package repository.



> > +    (arguments
> > +     (substitute-keyword-arguments (package-arguments sendmail)
> > +       ((#:phases phases)
> > +        `(modify-phases ,phases
> > +           (replace 'build
> > +             (lambda* _
> > +               (with-directory-excursion "libmilter"
> > +                 (invoke "sh" "Build"))
> > +               #t))
> > +           (delete 'pre-install)
> > +           (replace 'install
> > +             (lambda* _
> > +               (with-directory-excursion "libmilter"
> > +                 (mkdir-p (string-append (assoc-ref %outputs "out")
> > "/lib"))
> > +                 (invoke "make" "install"))
> > +               #t))))))
> > +    (synopsis "Sendmail library for creating mail filters.")))
> > +
>
> I suggest adding a dedicated synopsis and description here, also
> synopsises as I see it should not be sentences and not end with a
> period, descriptions on the other hand should be full sentences, look
> at the other packages for inspiration.


Added a description and removed the period from the synopsis.

I will keep the website as sendmail.org despite the redirect, the patch
will not start with the filename for libmilter. I do not know what to do
about there being no "updater" for sendmail, but then again the last
release was in 2016.

[-- Attachment #1.2: Type: text/html, Size: 6387 bytes --]

[-- Attachment #2: 0003-gnu-sendmail-Update-to-8.16.1.patch --]
[-- Type: text/x-patch, Size: 1136 bytes --]

From 87d1ede0d39dd952f625de63f39df025a4dddbe8 Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Mon, 29 Mar 2021 16:04:41 +0200
Subject: [PATCH 3/3] gnu: sendmail: Update to 8.16.1.

* gnu/packages/mail.scm (sendmail): Update to 8.16.1.
---
 gnu/packages/mail.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 0a6e710611..5844c94c90 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2768,7 +2768,7 @@ powerful user customization features.")
 (define-public sendmail
   (package
     (name "sendmail")
-    (version "8.15.2")
+    (version "8.16.1")
     (source
      (origin
        (method url-fetch)
@@ -2777,7 +2777,7 @@ powerful user customization features.")
              version ".tar.gz"))
        (sha256
         (base32
-         "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94"))
+         "1fk49v63w4lrpw4jjzl495vpi02w633vkd9jbwbqcss39gfdb1kq"))
        (patches (search-patches "sendmail-libmilter-shared-library.patch"))))
     (build-system gnu-build-system)
     (arguments
-- 
2.30.0


[-- Attachment #3: 0002-gnu-Add-libmilter.patch --]
[-- Type: text/x-patch, Size: 1794 bytes --]

From 812b45c66d04648444a9df3944de8e1e94d32180 Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Mon, 29 Mar 2021 15:56:25 +0200
Subject: [PATCH 2/3] gnu: Add libmilter.

* gnu/packages/mail.scm (libmilter): New variable. A Sendmail API library for
  building mail filters.
---
 gnu/packages/mail.scm | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 8cb548044e..0a6e710611 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2869,6 +2869,32 @@ transfer protocols.")
     (license (license:non-copyleft "file://LICENSE"
                                    "See LICENSE in the distribution."))))
 
+(define-public libmilter
+  (package
+    (inherit sendmail)
+    (name "libmilter")
+    (version "1.0.1")
+    (arguments
+     (substitute-keyword-arguments (package-arguments sendmail)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (replace 'build
+             (lambda* _
+               (with-directory-excursion "libmilter"
+                 (invoke "sh" "Build"))
+               #t))
+           (delete 'pre-install)
+           (replace 'install
+             (lambda* _
+               (with-directory-excursion "libmilter"
+                 (mkdir-p (string-append (assoc-ref %outputs "out") "/lib"))
+                 (invoke "make" "install"))
+               #t))))))
+    (synopsis "Sendmail library for creating mail filters")
+    (description "The Sendmail Mail Filter API (Milter) is designed to allow
+third-party programs access to mail messages as they are being processed in
+order to filter meta-information(headers) and content.")))
+
 (define-public sieve-connect
   (package
     (name "sieve-connect")
-- 
2.30.0


[-- Attachment #4: 0001-gnu-sendmail-Fix-output-s-directory-structure.patch --]
[-- Type: text/x-patch, Size: 7371 bytes --]

From 0da70d62ffd2e4c4eef3ba0c069a217f78ed97fe Mon Sep 17 00:00:00 2001
From: Rovanion Luckey <rovanion.luckey@gmail.com>
Date: Sat, 27 Mar 2021 18:28:02 +0100
Subject: [PATCH 1/3] gnu: sendmail: Fix output's directory structure.

* gnu/packages/mail.scm (sendmail)[arguments]<#:phases>: Properly specify
  output directories in replacement 'configure and 'pre-> install.
---
 gnu/packages/mail.scm                         | 42 ++++++++++----
 .../sendmail-libmilter-shared-library.patch   | 56 +++++++++++++++++++
 2 files changed, 88 insertions(+), 10 deletions(-)
 create mode 100644 gnu/packages/patches/sendmail-libmilter-shared-library.patch

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 56fae3fcba..8cb548044e 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -2777,7 +2777,8 @@ powerful user customization features.")
              version ".tar.gz"))
        (sha256
         (base32
-         "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94"))))
+         "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94"))
+       (patches (search-patches "sendmail-libmilter-shared-library.patch"))))
     (build-system gnu-build-system)
     (arguments
      `(#:phases
@@ -2796,23 +2797,44 @@ powerful user customization features.")
                (("SHELL=/bin/sh") (string-append "SHELL=" (which "sh"))))
              #t))
          (replace 'configure
-           (lambda _
+           (lambda* (#:key outputs #:allow-other-keys)
 
              ;; Render harmless any attempts to chown or chgrp
              (substitute* "devtools/bin/install.sh"
                (("owner=\\$2") "owner=''")
                (("group=\\$2") "group=''"))
 
-             (with-output-to-file "devtools/Site/site.config.m4"
-               (lambda ()
-                 (format #t "
+             (let ((out (assoc-ref outputs "out")))
+               (with-output-to-file "devtools/Site/site.config.m4"
+                 (lambda ()
+                   ;; See 'devtools/M4/UNIX/defines.m4' for the list of
+                   ;; installation directories.
+                   (format #t "
 define(`confCC', `gcc')
+define(`confAR', `ar')
+define(`confCCOPTS', `-fPIC')
 define(`confOPTIMIZE', `-g -O2')
 define(`confLIBS', `-lresolv')
 define(`confINSTALL', `~a/devtools/bin/install.sh')
 define(`confDEPEND_TYPE', `CC-M')
 define(`confINST_DEP', `')
-" (getcwd))))
+
+define(`confLIBDIR',     `~a/lib/')
+define(`confINCLUDEDIR', `~a/include')
+define(`confHFDIR',      `~a/etc/mail')
+define(`confSTDIR',      `~a/etc/mail')
+define(`confMBINDIR',    `~a/sbin')
+define(`confUBINDIR',    `~a/bin')
+define(`confSBINDIR',    `~a/sbin')
+define(`confEBINDIR',    `~a/libexec')
+define(`confMANROOT',    `~a/share/man')~%"
+                           (getcwd)
+                           out out out out out out out out out))))
+             (substitute* "cf/cf/Makefile"
+               (("^MAILDIR=.*")
+                (string-append "MAILDIR = "
+                               (assoc-ref outputs "out")
+                               "/etc/mail\n")))
              #t))
          (replace 'build
            (lambda _
@@ -2824,17 +2846,17 @@ 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)
+               (mkdir-p (string-append out "/var/spool/mail"))
                (with-directory-excursion "cf/cf"
                  (invoke "sh" "Build" "install-cf"))
                #t))))
        ;; There is no make check.  There are some post installation tests, but those
        ;; require root privileges
        #:tests? #f))
-    (inputs
+    (native-inputs
      `(("m4" ,m4)
        ("perl" ,perl)))
     (home-page "http://sendmail.org")
diff --git a/gnu/packages/patches/sendmail-libmilter-shared-library.patch b/gnu/packages/patches/sendmail-libmilter-shared-library.patch
new file mode 100644
index 0000000000..1e256c59ec
--- /dev/null
+++ b/gnu/packages/patches/sendmail-libmilter-shared-library.patch
@@ -0,0 +1,56 @@
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4 sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4	1970-01-01 01:00:00.000000000 +0100
++++ sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4	2009-08-22 21:51:10.000000000 +0200
+@@ -0,0 +1,39 @@
++divert(-1)
++#
++# Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
++#	All rights reserved.
++#
++# By using this file, you agree to the terms and conditions set
++# forth in the LICENSE file which can be found at the top level of
++# the sendmail distribution.
++#
++#
++#  Definitions for Makefile construction for sendmail
++#
++divert(0)dnl
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/links.m4')dnl
++define(`confSOEXT', ifdef(`confSOEXT', `confSOEXT', `so'))dnl
++bldLIST_PUSH_ITEM(`bldC_PRODUCTS', bldCURRENT_PRODUCT)dnl
++bldPUSH_TARGET(bldCURRENT_PRODUCT`.'confSOEXT bldCURRENT_PRODUCT`.a')dnl
++bldPUSH_INSTALL_TARGET(`install-'bldCURRENT_PRODUCT)dnl
++bldPUSH_CLEAN_TARGET(bldCURRENT_PRODUCT`-clean')dnl
++
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
++divert(bldTARGETS_SECTION)
++bldCURRENT_PRODUCT`.'confSOEXT: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++	${CCLINK} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.confSOEXT ifdef(`confSONAME',`-Wl,confSONAME,bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER}') ${bldCURRENT_PRODUCT`OBJS'} -lc ${LIBS}
++bldCURRENT_PRODUCT.a: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++	${AR} ${AROPTS} bldCURRENT_PRODUCT.a ${bldCURRENT_PRODUCT`OBJS'}
++	${RANLIB} ${RANLIBOPTS} bldCURRENT_PRODUCT.a
++ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
++
++install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.confSOEXT bldCURRENT_PRODUCT.a
++ifdef(`bldINSTALLABLE', `	ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}"; else :; fi ')
++	${INSTALL} -c bldCURRENT_PRODUCT.confSOEXT "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER}"
++	${LN} ${LNOPTS} bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER} "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.confSOEXT"
++	${INSTALL} -c -m 644 bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
++
++bldCURRENT_PRODUCT-clean:
++	rm -f ${OBJS} bldCURRENT_PRODUCT.confSOEXT bldCURRENT_PRODUCT.a ${MANPAGES}
++
++divert(0)
++COPTS+= confCCOPTS_SO
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4	2008-04-08 07:23:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4	2009-08-22 21:53:35.000000000 +0200
+@@ -9,7 +9,7 @@
+ SMSRCDIR=ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
+ PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
+ 
+-bldPRODUCT_START(`library', `libmilter')
++bldPRODUCT_START(`milterlibrary', `libmilter')
+ define(`bldINSTALLABLE', `true')
+ define(`LIBMILTER_EXTRAS', `errstring.c strl.c')
+ APPENDDEF(`confENVDEF', `-DNOT_SENDMAIL -Dsm_snprintf=snprintf')
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-04-09 19:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-27 17:34 [bug#47435] gnu: mail: Make the sendmail package actually output its binary Rovanion Luckey
2021-03-27 18:07 ` Léo Le Bouter via Guix-patches via
2021-03-27 18:22 ` Leo Famulari
2021-03-28 11:57   ` Rovanion Luckey
2021-03-29 14:24     ` Rovanion Luckey
2021-03-30  2:05       ` Léo Le Bouter via Guix-patches via
2021-03-30  2:13         ` Léo Le Bouter via Guix-patches via
2021-04-09 19:30         ` Rovanion Luckey

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.