From 58f701ab74568692a49a4230f37eb07b3b63740d Mon Sep 17 00:00:00 2001 From: Léo Gaspard Date: Wed, 24 Oct 2018 00:07:17 +0900 Subject: opensmtpd: 6.0.3p1 -> 6.4.0p1 --- pkgs/servers/mail/opensmtpd/default.nix | 45 +++++++++++++----------------- pkgs/servers/mail/opensmtpd/fix-build.diff | 12 ++++++++ 2 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 pkgs/servers/mail/opensmtpd/fix-build.diff (limited to 'pkgs/servers') diff --git a/pkgs/servers/mail/opensmtpd/default.nix b/pkgs/servers/mail/opensmtpd/default.nix index 60c517230b4f..d55804504442 100644 --- a/pkgs/servers/mail/opensmtpd/default.nix +++ b/pkgs/servers/mail/opensmtpd/default.nix @@ -1,43 +1,33 @@ { stdenv, lib, fetchurl, fetchpatch, autoconf, automake, libtool, bison -, libasr, libevent, zlib, openssl, db, pam - -# opensmtpd requires root for no reason to encrypt passwords, this patch fixes it -# see also https://github.com/OpenSMTPD/OpenSMTPD/issues/678 -, unpriviledged_smtpctl_encrypt ? true - -# Deprecated: use the subaddressing-delimiter in the config file going forward -, tag_char ? null +, libasr, libevent, zlib, libressl, db, pam }: -if (tag_char != null) -then throw "opensmtpd: the tag_char argument is deprecated as it can now be specified at runtime via the 'subaddressing-delimiter' option of the configuration file" -else stdenv.mkDerivation rec { +stdenv.mkDerivation rec { name = "opensmtpd-${version}"; - version = "6.0.3p1"; + version = "6.4.0p1"; nativeBuildInputs = [ autoconf automake libtool bison ]; - buildInputs = [ libasr libevent zlib openssl db pam ]; + buildInputs = [ libasr libevent zlib libressl db pam ]; src = fetchurl { url = "https://www.opensmtpd.org/archives/${name}.tar.gz"; - sha256 = "291881862888655565e8bbe3cfb743310f5dc0edb6fd28a889a9a547ad767a81"; + sha256 = "1qxxhnlsmpfh9v4azgl0634955r085gsic1c66jdll21bd5w2mq8"; }; patches = [ ./proc_path.diff - (fetchpatch { - url = "https://github.com/OpenSMTPD/OpenSMTPD/commit/725ba4fa2ddf23bbcd1ff9ec92e86bbfaa6825c8.diff"; - sha256 = "19rla0b2r53jpdiz25fcza29c2msz6j6paivxhp9jcy1xl457dqa"; - }) + ./fix-build.diff # See https://github.com/OpenSMTPD/OpenSMTPD/pull/884 ]; - postPatch = with builtins; with lib; - optionalString unpriviledged_smtpctl_encrypt '' - substituteInPlace smtpd/smtpctl.c --replace \ - 'if (geteuid())' \ - 'if (geteuid() != 0 && !(argc > 1 && !strcmp(argv[1], "encrypt")))' - substituteInPlace mk/smtpctl/Makefile.in --replace "chmod 2555" "chmod 0555" - ''; + # See https://github.com/OpenSMTPD/OpenSMTPD/issues/885 for the `sh bootstrap` + # requirement + postPatch = '' + substituteInPlace smtpd/parse.y \ + --replace "/usr/libexec/" "$out/libexec/opensmtpd/" + substituteInPlace mk/smtpctl/Makefile.am --replace "chgrp" "true" + substituteInPlace mk/smtpctl/Makefile.am --replace "chmod 2555" "chmod 0555" + sh bootstrap + ''; configureFlags = [ "--sysconfdir=/etc" @@ -54,6 +44,9 @@ else stdenv.mkDerivation rec { "--with-table-db" ]; + # See https://github.com/OpenSMTPD/OpenSMTPD/pull/884 + makeFlags = [ "CFLAGS=-ffunction-sections" "LDFLAGS=-Wl,--gc-sections" ]; + installFlags = [ "sysconfdir=\${out}/etc" "localstatedir=\${TMPDIR}" @@ -67,6 +60,6 @@ else stdenv.mkDerivation rec { ''; license = licenses.isc; platforms = platforms.linux; - maintainers = with maintainers; [ rickynils obadz ]; + maintainers = with maintainers; [ rickynils obadz ekleog ]; }; } diff --git a/pkgs/servers/mail/opensmtpd/fix-build.diff b/pkgs/servers/mail/opensmtpd/fix-build.diff new file mode 100644 index 000000000000..1f995fd4f623 --- /dev/null +++ b/pkgs/servers/mail/opensmtpd/fix-build.diff @@ -0,0 +1,12 @@ +diff --git a/mk/smtpctl/Makefile.am b/mk/smtpctl/Makefile.am +index 5af0b713..f0fce735 100644 +--- a/mk/smtpctl/Makefile.am ++++ b/mk/smtpctl/Makefile.am +@@ -4,6 +4,7 @@ sbin_PROGRAMS= smtpctl + + smtpctl_SOURCES= $(smtpd_srcdir)/enqueue.c + smtpctl_SOURCES+= $(smtpd_srcdir)/parser.c ++smtpctl_SOURCES+= $(smtpd_srcdir)/config.c + smtpctl_SOURCES+= $(smtpd_srcdir)/log.c + smtpctl_SOURCES+= $(smtpd_srcdir)/envelope.c + smtpctl_SOURCES+= $(smtpd_srcdir)/queue_backend.c -- cgit 1.4.1