about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/gvpe/default.nix
blob: 788d61e9ca95e8a7d39563870a3df3a83a04e1dd (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
{ lib, stdenv, fetchurl, openssl, gmp, zlib, iproute, nettools }:

stdenv.mkDerivation rec {
  pname = "gvpe";
  version = "3.0";

  src = fetchurl {
    url = "https://ftp.gnu.org/gnu/gvpe/gvpe-${version}.tar.gz";
    sha256 = "1v61mj25iyd91z0ir7cmradkkcm1ffbk52c96v293ibsvjs2s2hf";
  };

  patches = [ ./gvpe-3.0-glibc-2.26.patch ];

  buildInputs = [ openssl gmp zlib ];

  configureFlags = [
    "--enable-tcp"
    "--enable-http-proxy"
    "--enable-dns"
    ];

  preBuild = ''
    sed -e 's@"/sbin/ifconfig.*"@"${iproute}/sbin/ip link set $IFNAME address $MAC mtu $MTU"@' -i src/device-linux.C
    sed -e 's@/sbin/ifconfig@${nettools}/sbin/ifconfig@g' -i src/device-*.C
  '';

  meta = with lib; {
    description = "A protected multinode virtual network";
    homepage = "http://software.schmorp.de/pkg/gvpe.html";
    maintainers = [ maintainers.raskin ];
    platforms = with platforms; linux ++ freebsd;
    license = licenses.gpl2;
  };
}