2022-11-27 09:42:12 +00:00
|
|
|
{ lib, stdenv, fetchurl, m4, fixDarwinDylibNames }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libmilter";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "8.18.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "ftp://ftp.sendmail.org/pub/sendmail/sendmail.${version}.tar.gz";
|
2024-02-07 01:22:34 +00:00
|
|
|
sha256 = "sha256-y/HzCcOOSAb3zz6tJCYPF9H+j7YyVtE+2zzdGgmPB3A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cd libmilter
|
|
|
|
cat > a.m4 <<EOF
|
|
|
|
define(\`confCC', \`$CC')
|
|
|
|
define(\`confAR', \`$AR')
|
|
|
|
define(\`confEBINDIR', \`$out/libexec')
|
|
|
|
define(\`confINCLUDEDIR', \`$out/include')
|
|
|
|
define(\`confLIBDIR', \`$out/lib')
|
|
|
|
define(\`confMANROOT', \`$out/man/cat')
|
|
|
|
define(\`confMANROOTMAN', \`$out/man/man')
|
|
|
|
define(\`confMBINDIR', \`$out/sbin')
|
|
|
|
define(\`confSBINDIR', \`$out/sbin')
|
|
|
|
define(\`confSHAREDLIBDIR', \`$out/lib')
|
|
|
|
define(\`confUBINDIR', \`$out/bin')
|
|
|
|
define(\`confINCGRP', \`root')
|
|
|
|
define(\`confLIBGRP', \`root')
|
|
|
|
APPENDDEF(\`confENVDEF', \`-DNETINET6')
|
|
|
|
EOF
|
2020-06-18 07:06:33 +00:00
|
|
|
export MILTER_SOVER=1
|
2020-04-24 23:36:52 +00:00
|
|
|
sh Build -f ./a.m4
|
|
|
|
'';
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [ ./install.patch ./sharedlib.patch ./darwin.patch ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
nativeBuildInputs = [ m4 ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
|
|
|
|
|
|
|
postInstall = lib.optionalString stdenv.isDarwin ''
|
2023-07-15 17:15:38 +00:00
|
|
|
fixDarwinDylibNames $out/lib/libmilter.*.1
|
2022-11-27 09:42:12 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Sendmail Milter mail filtering API library";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ fpletz ];
|
|
|
|
license = licenses.sendmail;
|
|
|
|
};
|
|
|
|
}
|