about summary refs log tree commit diff
path: root/pkgs/tools/networking/miniupnpd/default.nix
blob: 5d62222d1419bff9555268b6b5747d6349411bb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv, fetchurl, iptables }:

assert stdenv.isLinux;

stdenv.mkDerivation rec {
  name = "miniupnpd-1.4";

  src = fetchurl {
    url = "http://miniupnp.free.fr/files/download.php?file=${name}.tar.gz";
    sha256 = "06q5agkzv2snjxcsszpm27h8bqv41jijahs8jqnarxdrik97rfl5";
  };

  buildInputs = [ iptables ];

  NIX_CFLAGS_COMPILE = "-DIPTABLES_143";

  NIX_CFLAGS_LINK = "-liptc";
  
  makefile = "Makefile.linux";

  makeFlags = "LIBS=";

  postBuild = "cat config.h";

  installFlags = "PREFIX=$(out) INSTALLPREFIX=$(out)";

  postInstall =
    ''
      ensureDir $out/share/man/man1
      cp miniupnpd.1 $out/share/man/man1/
    '';

  meta = {
    homepage = http://miniupnp.free.fr/;
    description = "A daemon that implements the UPnP Internet Gateway Device (IGD) specification";
  };
}