2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, fetchurl, iptables, libuuid, pkg-config
|
2021-04-05 15:23:46 +00:00
|
|
|
, which, iproute2, gnused, coreutils, gawk, makeWrapper
|
2021-05-20 23:08:51 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2021-04-05 15:23:46 +00:00
|
|
|
scriptBinEnv = lib.makeBinPath [ which iproute2 iptables gnused coreutils gawk ];
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-05 21:33:18 +00:00
|
|
|
pname = "miniupnpd";
|
|
|
|
version = "2.1.20190502";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-05 21:33:18 +00:00
|
|
|
url = "http://miniupnp.free.fr/files/download.php?file=miniupnpd-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1m8d0g9b0bjwsnqccw1yapp6n0jghmgzwixwjflwmvi2fi6hdp4b";
|
2021-08-05 21:33:18 +00:00
|
|
|
name = "miniupnpd-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ iptables libuuid ];
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs= [ pkg-config makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makefile = "Makefile.linux";
|
|
|
|
|
|
|
|
buildFlags = [ "miniupnpd" "genuuid" ];
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=$(out)" "INSTALLPREFIX=$(out)" ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
for script in $out/etc/miniupnpd/ip{,6}tables_{init,removeall}.sh
|
|
|
|
do
|
|
|
|
wrapProgram $script --set PATH '${scriptBinEnv}:$PATH'
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
passthru.tests = {
|
|
|
|
bittorrent-integration = nixosTests.bittorrent;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://miniupnp.free.fr/";
|
|
|
|
description = "A daemon that implements the UPnP Internet Gateway Device (IGD) specification";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
};
|
|
|
|
}
|