summary refs log tree commit diff
path: root/pkgs/tools/networking/gvpe/default.nix
blob: 1c83e08fc3e07781a5edefce8094a36a4048e723 (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
a @ { openssl, gmp, nettools, iproute, zlib, ... } :
let
  s = import ./src-for-default.nix;
  buildInputs = with a; [
    openssl gmp zlib
  ];
in
rec {
  src = a.fetchUrlFromSrcInfo s;

  inherit (s) name;
  inherit buildInputs;
  configureFlags = [
    "--enable-tcp"
    "--enable-http-proxy"
    "--enable-dns"
    ];

  /* doConfigure should be removed if not needed */
  phaseNames = ["doConfigure" "preBuild" "doMakeInstall"];
  preBuild = a.fullDepEntry (''
    sed -e 's@"/sbin/ifconfig.*"@"${a.iproute}/sbin/ip link set $IFNAME address $MAC mtu $MTU"@' -i src/device-linux.C
    sed -e 's@/sbin/ifconfig@${a.nettools}/sbin/ifconfig@g' -i src/device-*.C
  '') ["minInit" "doUnpack"];

  meta = {
    description = "A proteted multinode virtual network";
    maintainers = [
      a.lib.maintainers.raskin
    ];
    platforms = with a.lib.platforms; linux ++ freebsd;
  };
}