From 0d9241f06213e80a9e3fe4cce36a79387c2e6521678dba58265b46e82039a342 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 20 Jan 2014 23:38:33 +0000 Subject: [PATCH] No libjansson for old distros OBS-URL: https://build.opensuse.org/package/show/security:netfilter/libnftnl?expand=0&rev=5 --- libnftnl.spec | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) 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