From 7629f800d16e37236e539397d0393d729bb06e73 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 | 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