@@ -0,0 +1,72 @@
1+{ stdenv, fetchurl, libcap, libnl, readline, net_snmp, less, perl, texinfo }:
2+
3+stdenv.mkDerivation rec {
4+ name = "quagga-${version}";
5+ version = "0.99.24.1";
6+
7+ src = fetchurl {
8+ url = "mirror://savannah/quagga/${name}.tar.gz";
9+ sha256 = "0kvmc810m7ssrvgb3213271rpywyxb646v5bzjl1jl88vx3imbl4";
10+ };
11+
12+ buildInputs =
13+ [ readline net_snmp ]
14+ ++ stdenv.lib.optionals stdenv.isLinux [ libcap libnl ];
15+
16+ nativeBuildInputs = [ perl texinfo ];
17+
18+ configureFlags = [
19+ "--sysconfdir=/etc/quagga"
20+ "--localstatedir=/run/quagga"
21+ "--sbindir=$(out)/libexec/quagga"
22+ "--disable-exampledir"
23+ "--enable-user=quagga"
24+ "--enable-group=quagga"
25+ "--enable-configfile-mask=0640"
26+ "--enable-logfile-mask=0640"
27+ "--enable-vtysh"
28+ "--enable-vty-group=quaggavty"
29+ "--enable-snmp"
30+ "--enable-multipath=64"
31+ "--enable-rtadv"
32+ "--enable-irdp"
33+ "--enable-opaque-lsa"
34+ "--enable-ospf-te"
35+ "--enable-pimd"
36+ "--enable-isis-topology"
37+ ];
38+
39+ preConfigure = ''
40+ substituteInPlace vtysh/vtysh.c --replace \"more\" \"${less}/bin/less\"
41+ '';
42+
43+ postInstall = ''
44+ rm -f $out/bin/test_igmpv3_join
45+ mv -f $out/libexec/quagga/ospfclient $out/bin/
46+ '';
47+
48+ enableParallelBuilding = true;
49+
50+ meta = with stdenv.lib; {
51+ description = "Quagga BGP/OSPF/ISIS/RIP/RIPNG routing daemon suite";
52+ longDescription = ''
53+ GNU Quagga is free software which manages TCP/IP based routing protocols.
54+ It supports BGP4, BGP4+, OSPFv2, OSPFv3, IS-IS, RIPv1, RIPv2, and RIPng as
55+ well as the IPv6 versions of these.
56+
57+ As the predecessor Zebra has been considered orphaned, the Quagga project
58+ has been formed by members of the zebra mailing list and the former
59+ zebra-pj project to continue developing.
60+
61+ Quagga uses threading if the kernel supports it, but can also run on
62+ kernels that do not support threading. Each protocol has its own daemon.
63+
64+ It is more than a routed replacement, it can be used as a Route Server and
65+ a Route Reflector.
66+ '';
67+ homepage = http://www.quagga.net/;
68+ license = licenses.gpl2;
69+ platforms = platforms.unix;
70+ maintainers = with maintainers; [ tavyc ];
71+ };
72+}