summary refs log tree commit diff
path: root/pkgs/os-specific/linux/gw6c/default.nix
blob: a11037c0ebedc7adfdb9999b0312b1ab728652d7 (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
38
39
40
args : with args; 
let version = "6.0"; in
rec {
  src = fetchurl {
    url = http://go6.net/4105/file.asp?file_id=158;
    sha256 = "0cnxqyw8rdr0sii77n2pv97f0c00dx6ykvnb3mf2acyrarh04nq8";
    name = "gateway6-client-${version}.tar.gz";
  };

  buildInputs = [nettools openssl procps];
  configureFlags = [];
  makeFlags = ["target=linux"];
  installFlags = ["installdir=$out"];

  /* doConfigure should be specified separately */
  phaseNames = ["preBuild" "doMakeInstall"];

  goSrcDir = "cd tspc-advanced";

  preBuild = FullDepEntry (''
    sed -e 's@/dev/net/tun@/dev/tun@' -i platform/linux/tsp_tun.c;
    sed -e 's@/sbin/ifconfig@${nettools}/sbin/ifconfig@' -i template/linux.sh
    sed -e 's@/sbin/route@${nettools}/sbin/route@' -i template/linux.sh
    sed -e 's@/sbin/ip@${iproute}/sbin/ip@' -i template/linux.sh
    sed -e 's@/sbin/sysctl@${procps}/sbin/sysctl@' -i template/linux.sh
  '') ["minInit" "addInputs" "doUnpack"];
      
  name = "gateway6-client-" + version;
  meta = {
    description = "Gateway6 client - provides IPv6 tunnel";
    longDescription = "
      This package provides Gateway6 client (gw6c) daemon,
      which connects to so called tunnel broker via IPv4 
      network, and tunnels IPv6 packets through broker,
      thus giving global IPv6 connectivity. You may need 
      tun, ipv6 and sit modules.
    ";
    homepage = http://go6.net ;
  };
}