2021-01-19 07:50:56 +01:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, bison, file, flex
|
2019-11-13 07:12:59 +01:00
|
|
|
, asciidoc, libxslt, findXMLCatalogs, docbook_xml_dtd_45, docbook_xsl
|
2019-08-18 19:14:48 +02:00
|
|
|
, libmnl, libnftnl, libpcap
|
|
|
|
, gmp, jansson, readline
|
2019-11-13 10:52:54 +01:00
|
|
|
, withDebugSymbols ? false
|
|
|
|
, withPython ? false , python3
|
2019-08-18 19:14:48 +02:00
|
|
|
, withXtables ? false , iptables
|
|
|
|
}:
|
|
|
|
|
2021-01-15 15:45:37 +01:00
|
|
|
with lib;
|
2014-08-24 01:16:06 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-05-26 00:02:10 +02:00
|
|
|
version = "0.9.9";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "nftables";
|
2014-08-24 01:16:06 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "https://netfilter.org/projects/nftables/files/${pname}-${version}.tar.bz2";
|
2021-05-26 00:02:10 +02:00
|
|
|
sha256 = "1d7iwc8xlyfsbgn6qx1sdfcq7jhpl8wpfj39hcd06y8dzp3jvvvn";
|
2014-08-24 01:16:06 +02:00
|
|
|
};
|
|
|
|
|
2019-11-13 07:12:59 +01:00
|
|
|
nativeBuildInputs = [
|
2021-01-19 07:50:56 +01:00
|
|
|
pkg-config bison file flex
|
2020-10-31 16:38:30 +01:00
|
|
|
asciidoc docbook_xml_dtd_45 docbook_xsl findXMLCatalogs libxslt
|
2019-11-13 07:12:59 +01:00
|
|
|
];
|
2014-08-24 01:16:06 +02:00
|
|
|
|
2019-08-18 19:14:48 +02:00
|
|
|
buildInputs = [
|
|
|
|
libmnl libnftnl libpcap
|
2019-11-13 10:52:54 +01:00
|
|
|
gmp jansson readline
|
|
|
|
] ++ optional withXtables iptables
|
|
|
|
++ optional withPython python3;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-json"
|
|
|
|
] ++ optional (!withDebugSymbols) "--disable-debug"
|
|
|
|
++ optional (!withPython) "--disable-python"
|
|
|
|
++ optional withPython "--enable-python"
|
|
|
|
++ optional withXtables "--with-xtables";
|
2014-08-24 01:16:06 +02:00
|
|
|
|
2019-08-18 19:14:48 +02:00
|
|
|
meta = {
|
2016-06-20 12:53:46 +02:00
|
|
|
description = "The project that aims to replace the existing {ip,ip6,arp,eb}tables framework";
|
2019-08-18 19:14:48 +02:00
|
|
|
homepage = "https://netfilter.org/projects/nftables/";
|
2014-08-24 01:16:06 +02:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2020-10-31 16:38:30 +01:00
|
|
|
maintainers = with maintainers; [ izorkin ];
|
2014-08-24 01:16:06 +02:00
|
|
|
};
|
|
|
|
}
|