diff --git a/libnftnl.spec b/libnftnl.spec index 192944a..f6af197 100644 --- a/libnftnl.spec +++ b/libnftnl.spec @@ -30,10 +30,18 @@ URL: http://netfilter.org/projects/libnftnl/ Source: %name-%version.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: pkgconfig >= 0.21 -BuildRequires: pkgconfig(jansson) >= 2.3 BuildRequires: pkgconfig(libmnl) >= 1.0.3 -%if 0%{?suse_version} -# Fedora does not have +%if 0%{?suse_version} >= 1220 +%define with_json 1 +%define with_mxml 1 +%endif +%if 0%{?fedora_version} +%define with_json 1 +%endif +%if 0%{?with_json} +BuildRequires: pkgconfig(jansson) >= 2.3 +%endif +%if 0%{?with_mxml} BuildRequires: pkgconfig(mxml) >= 2.6 %endif @@ -65,11 +73,14 @@ applications that want to make use of libnftnl. %setup -qn %name %build -%configure --includedir="%_includedir/pkg" \ -%if 0%{?suse_version} +%configure \ +%if 0%{?with_mxml} --with-xml-parsing \ %endif - --with-json-parsing +%if 0%{?with_json} + --with-json-parsing \ +%endif + --includedir="%_includedir/pkg" make %{?_smp_mflags} %install