diff --git a/netsniff-ng.spec b/netsniff-ng.spec index 6fcdce6..0fc6470 100644 --- a/netsniff-ng.spec +++ b/netsniff-ng.spec @@ -12,6 +12,8 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ +%define bison_version %(rpm -q --qf='%{VERSION}' bison | %__perl -n -e 'print $1 * 100 + $2 if /^(\d+)\.(\d+)/') + Name: netsniff-ng Version: 0.5.6 Release: 0 @@ -32,8 +34,15 @@ BuildRequires: liburcu-devel %else %define with_nf 0 %endif -BuildRequires: flex +BuildRequires: bison +%if 0%{?bison_version} >= 250 BuildRequires: bison >= 2.5 +BuildRequires: flex +%define with_bison 1 +%else +BuildConflicts: flex +%define with_bison 0 +%endif BuildRequires: cmake >= 2.8 BuildRequires: gcc make glibc-devel BuildRequires: autoconf automake libtool @@ -79,15 +88,17 @@ popd %doc THANKS Documentation %config %{_sysconfdir}/netsniff-ng %{_sbindir}/ashunt -%{_sbindir}/bpfc %{_sbindir}/ifpps %{_sbindir}/netsniff-ng %{_sbindir}/trafgen %doc %{_mandir}/man8/ashunt.8* -%doc %{_mandir}/man8/bpfc.8* %doc %{_mandir}/man8/ifpps.8* %doc %{_mandir}/man8/netsniff-ng.8* %doc %{_mandir}/man8/trafgen.8* +%if %with_bison +%{_sbindir}/bpfc +%doc %{_mandir}/man8/bpfc.8* +%endif %if %with_nf %{_sbindir}/flowtop %doc %{_mandir}/man8/flowtop.8*