From patchwork Fri Apr 9 19:30:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rovanion Luckey X-Patchwork-Id: 28435 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E96C327BC6F; Fri, 9 Apr 2021 20:35:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0137627BC6E for ; Fri, 9 Apr 2021 20:35:01 +0100 (BST) Received: from localhost ([::1]:48470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lUwuC-0001Cm-2X for patchwork@mira.cbaines.net; Fri, 09 Apr 2021 15:35:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lUwrM-0007ia-QY for guix-patches@gnu.org; Fri, 09 Apr 2021 15:32:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lUwrK-0000jF-LG for guix-patches@gnu.org; Fri, 09 Apr 2021 15:32:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lUwrK-0007SI-H9 for guix-patches@gnu.org; Fri, 09 Apr 2021 15:32:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47435] gnu: mail: Make the sendmail package actually output its binary Resent-From: Rovanion Luckey Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 09 Apr 2021 19:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47435 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: =?utf-8?q?L=C3=A9o?= Le Bouter Cc: 47435@debbugs.gnu.org, Leo Famulari Received: via spool by 47435-submit@debbugs.gnu.org id=B47435.161799668528601 (code B ref 47435); Fri, 09 Apr 2021 19:32:02 +0000 Received: (at 47435) by debbugs.gnu.org; 9 Apr 2021 19:31:25 +0000 Received: from localhost ([127.0.0.1]:50949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUwqi-0007RE-QA for submit@debbugs.gnu.org; Fri, 09 Apr 2021 15:31:25 -0400 Received: from mail-il1-f173.google.com ([209.85.166.173]:35499) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lUwqf-0007Qz-U1 for 47435@debbugs.gnu.org; Fri, 09 Apr 2021 15:31:23 -0400 Received: by mail-il1-f173.google.com with SMTP id x12so2779071ilm.2 for <47435@debbugs.gnu.org>; Fri, 09 Apr 2021 12:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=M5W5vUQklsgjmOGY/fxtv7RsTUcrAZ2vzpo19Nk4WQk=; b=ajJgMebcoeJv8ClOGdU4iPKqN25T4e28QzZ1evlLvoGQfDx1Yada/XqCe+3gAMrFqG ItTt6GLluZqbTRWFAUOyXApUu2dhbLOZsWM13VtOKVDWvpX/SJVgqleEml9EonBjUaMI SBd8gHTJob3dqAVkx4qW0NVarHHDEWm0ozeC8sDscKFuI6a2qFCHbHzeXZOhO3mhPW68 dXAYYSNB17KHKzQkuR8mOt21BqfOkUtEOxmOPWBhCJyPAxbeyi0B0lzvqOVWor2OQC0R hIaLUf7Ruv9dzqXvvKFFj9vzu8YQe6ppFtEkn8JaS0b8ttMk//ozeW3tLZhRL1C8VwIn dm9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=M5W5vUQklsgjmOGY/fxtv7RsTUcrAZ2vzpo19Nk4WQk=; b=jrIeYZNtdQCGi/iiIpSV4B8r8k9IJlaKyJoAWjCo7yF3W46Gp+6F0yxuL9AnUeF6c5 YwRjTBQMNC8Yn0P01UCbPgMm+lCtjUjc97mjbXyMKqvTK8CK1oAXhKxMtWKBuibFFPCa WJinIGgkZS8Bkgi2yeXZk8/q13IrsNVvy7YqujKPeB0gEuNriZgWtuq0sfMV67+Ygr2i KkARZ0cALThiPTjFOq5q7CvqCnL4TczSak3uBM3msCT4GkbD7hBAjFuRjWfzf00CvFaQ GRa5guIenMMiCAvv+ONezCF1X0BiWMdeQWVVYDGwDJzRU+e5DI/cCFYkHETbzH/6QTAw I4zg== X-Gm-Message-State: AOAM533hZEjPghujn46Qm0od/C/+w8EuPebSHLCxrqJq8cZB9cMeJvfv qbHqfiITGf/48q1bbTUtAhdvGWU13OoLIm/UtZ8= X-Google-Smtp-Source: ABdhPJzbaUSN8LV9AH2DawSqefXXSpvUkhUaPN/UAXFB7ZEXTHWMlFloxnpRh0EieWYAq+ArAQTkk93CyY7jKlzZ2gk= X-Received: by 2002:a05:6e02:170c:: with SMTP id u12mr12955089ill.100.1617996675695; Fri, 09 Apr 2021 12:31:15 -0700 (PDT) MIME-Version: 1.0 References: <75974c07f11e9e07061c192fe50c8704e4cb4d1c.camel@zaclys.net> In-Reply-To: <75974c07f11e9e07061c192fe50c8704e4cb4d1c.camel@zaclys.net> From: Rovanion Luckey Date: Fri, 9 Apr 2021 21:30:49 +0200 Message-ID: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches > 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. From 0da70d62ffd2e4c4eef3ba0c069a217f78ed97fe Mon Sep 17 00:00:00 2001 From: Rovanion Luckey 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