bird2: init at 2.0.1
This commit is contained in:
parent
7fad46051e
commit
74736f26c2
@ -7,21 +7,27 @@ let
|
||||
let
|
||||
cfg = config.services.${variant};
|
||||
pkg = pkgs.${variant};
|
||||
birdBin = if variant == "bird6" then "bird6" else "bird";
|
||||
birdc = if variant == "bird6" then "birdc6" else "birdc";
|
||||
descr =
|
||||
{ bird = "1.9.x with IPv4 suport";
|
||||
bird6 = "1.9.x with IPv6 suport";
|
||||
bird2 = "2.x";
|
||||
}.${variant};
|
||||
configFile = pkgs.stdenv.mkDerivation {
|
||||
name = "${variant}.conf";
|
||||
text = cfg.config;
|
||||
preferLocalBuild = true;
|
||||
buildCommand = ''
|
||||
echo -n "$text" > $out
|
||||
${pkg}/bin/${variant} -d -p -c $out
|
||||
${pkg}/bin/${birdBin} -d -p -c $out
|
||||
'';
|
||||
};
|
||||
in {
|
||||
###### interface
|
||||
options = {
|
||||
services.${variant} = {
|
||||
enable = mkEnableOption "BIRD Internet Routing Daemon";
|
||||
enable = mkEnableOption "BIRD Internet Routing Daemon (${descr})";
|
||||
config = mkOption {
|
||||
type = types.lines;
|
||||
description = ''
|
||||
@ -36,12 +42,12 @@ let
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = [ pkg ];
|
||||
systemd.services.${variant} = {
|
||||
description = "BIRD Internet Routing Daemon";
|
||||
description = "BIRD Internet Routing Daemon (${descr})";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
Restart = "on-failure";
|
||||
ExecStart = "${pkg}/bin/${variant} -c ${configFile} -u ${variant} -g ${variant}";
|
||||
ExecStart = "${pkg}/bin/${birdBin} -c ${configFile} -u ${variant} -g ${variant}";
|
||||
ExecReload = "${pkg}/bin/${birdc} configure";
|
||||
ExecStop = "${pkg}/bin/${birdc} down";
|
||||
CapabilityBoundingSet = [ "CAP_CHOWN" "CAP_FOWNER" "CAP_DAC_OVERRIDE" "CAP_SETUID" "CAP_SETGID"
|
||||
@ -56,14 +62,15 @@ let
|
||||
users = {
|
||||
extraUsers.${variant} = {
|
||||
description = "BIRD Internet Routing Daemon user";
|
||||
group = "${variant}";
|
||||
group = variant;
|
||||
};
|
||||
extraGroups.${variant} = {};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
inherit (config.services) bird bird6;
|
||||
in {
|
||||
imports = [(generic "bird") (generic "bird6")];
|
||||
in
|
||||
|
||||
{
|
||||
imports = map generic [ "bird" "bird6" "bird2" ];
|
||||
}
|
||||
|
@ -1,29 +1,54 @@
|
||||
{ stdenv, fetchurl, flex, bison, readline
|
||||
, enableIPv6 ? false }:
|
||||
{ lib, stdenv, fetchurl, flex, bison, readline }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "bird-1.6.3";
|
||||
with lib;
|
||||
|
||||
src = fetchurl {
|
||||
url = "ftp://bird.network.cz/pub/bird/${name}.tar.gz";
|
||||
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";
|
||||
};
|
||||
|
||||
buildInputs = [ flex bison readline ];
|
||||
bird6 = generic {
|
||||
version = "1.6.3";
|
||||
sha256 = "0z3yrxqb0p7f8b7r2gk4mvrwfzk45zx7yr9aifbvba1vgksiri9r";
|
||||
enableIPv6 = true;
|
||||
};
|
||||
|
||||
patches = [
|
||||
./dont-create-sysconfdir.patch
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--localstatedir /var"
|
||||
] ++ stdenv.lib.optional enableIPv6 "--enable-ipv6";
|
||||
|
||||
meta = {
|
||||
description = "BIRD Internet Routing Daemon";
|
||||
homepage = http://bird.network.cz;
|
||||
license = stdenv.lib.licenses.gpl2Plus;
|
||||
maintainers = with stdenv.lib.maintainers; [ viric fpletz ];
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
bird2 = generic {
|
||||
version = "2.0.1";
|
||||
sha256 = "0qyh2cxj7hfz90x3fnczjdm3i9g7vr0nc4l4wjkj9qm0646vc52n";
|
||||
};
|
||||
}
|
||||
|
13
pkgs/servers/bird/dont-create-sysconfdir-2.patch
Normal file
13
pkgs/servers/bird/dont-create-sysconfdir-2.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index fdd5e6c..45f81a1 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -165,7 +165,7 @@ tags:
|
||||
# Install
|
||||
|
||||
install: all
|
||||
- $(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
|
||||
+ $(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir)
|
||||
$(INSTALL_PROGRAM) $(exedir)/bird $(DESTDIR)/$(sbindir)/bird
|
||||
$(INSTALL_PROGRAM) $(exedir)/birdcl $(DESTDIR)/$(sbindir)/birdcl
|
||||
if test -n "@CLIENT@" ; then \
|
@ -11915,8 +11915,8 @@ with pkgs;
|
||||
bind = callPackage ../servers/dns/bind { };
|
||||
dnsutils = bind.dnsutils;
|
||||
|
||||
bird = callPackage ../servers/bird { };
|
||||
bird6 = bird.override { enableIPv6 = true; };
|
||||
inherit (callPackages ../servers/bird { })
|
||||
bird bird6 bird2;
|
||||
|
||||
bosun = callPackage ../servers/monitoring/bosun { };
|
||||
scollector = bosun;
|
||||
|
Loading…
Reference in New Issue
Block a user