summary refs log tree commit diff
path: root/pkgs/servers/bird/default.nix
blob: 94bd92abb4f876b41b4f7e01ebd5731e5af2052e (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib, stdenv, fetchurl, flex, bison, readline }:

with lib;

let

  generic = { version, sha256, enableIPv6 ? false }:
    stdenv.mkDerivation rec {
      name = "bird-${version}";

      src = fetchurl {
        inherit sha256;
        url = "ftp://bird.network.cz/pub/bird/${name}.tar.gz";
      };

      nativeBuildInputs = [ flex bison ];
      buildInputs = [ readline ];

      patches = [
        (./. + (builtins.toPath "/dont-create-sysconfdir-${builtins.substring 0 1 version}.patch"))
      ];

      configureFlags = [
        "--localstatedir=/var"
      ] ++ optional enableIPv6 "--enable-ipv6";

      meta = {
        description = "BIRD Internet Routing Daemon";
        homepage = http://bird.network.cz;
        license = licenses.gpl2Plus;
        maintainers = with maintainers; [ viric fpletz ];
        platforms = platforms.linux;
      };
    };

in

{
  bird = generic {
    version = "1.6.3";
    sha256 = "0z3yrxqb0p7f8b7r2gk4mvrwfzk45zx7yr9aifbvba1vgksiri9r";
  };

  bird6 = generic {
    version = "1.6.3";
    sha256 = "0z3yrxqb0p7f8b7r2gk4mvrwfzk45zx7yr9aifbvba1vgksiri9r";
    enableIPv6 = true;
  };

  bird2 = generic {
    version = "2.0.2";
    sha256 = "03s8hcl761y3489j1krarm3r3iy5qid26508i91yvy38ypb92pq3";
  };
}