File bngblaster.spec of Package bngblaster

#
# spec file for package bngblaster
#
# Copyright (c) 2022-2025, Martin Hauke <mardnh@gmx.de>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

Name:           bngblaster
Version:        0.9.25
Release:        0
Summary:        BNG Blaster - Network testing tool
License:        BSD-3-Clause
Group:          Productivity/Networking/Diagnostic
URL:            https://rtbrick.github.io/bngblaster/
#Git-Clone:     https://github.com/rtbrick/bngblaster.git
Source:         https://github.com/rtbrick/bngblaster/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0:         0001-build-dynamically-link-libdict.patch
BuildRequires:  cmake
BuildRequires:  libdict-devel
BuildRequires:  libpcap-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(cmocka)
BuildRequires:  pkgconfig(jansson) >= 2.10
BuildRequires:  pkgconfig(libssl)
BuildRequires:  pkgconfig(ncursesw)
# bundled enhanced fork of the Lightweight TCP/IP stack (lwIP) licenced under the BSD-2-Clause
Provides:       bundled(lwip)
# the optional tool bgpupdate requires python-scapy which is not packaged in Factory
#BuildRequires:  python-scapy
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
BuildRequires:  gcc11
%else
BuildRequires:  gcc >= 11
%endif

%description
A network testing tool for access and routing protocols. It can emulate
massive PPPoE and IPoE (DHCP) subscribers including IPTV, and L2TP (LNS).
There are various routing protocols supported like ISIS and BGP.
So you can use it for end-to-end BNG and non-BNG router testing.

You can use the included traffic generator for forwarding verification,
QoS testing or to measure convergence times. The traffic generator supports
millions of separate tracked flows. This allows you to verify every single
forwarding state of a full feed internet routing table. You can also send
traffic to every single QoS queue of your service edge router.

The following helper tools are also provided:
* bngblaster-cli
  Python script to interact with the BNG Blaster control socket JSON RPC API.
* bgpupdate
  Python script to generate BGP RAW update streams for use with
  the BNG Blaster.

https://rtbrick.github.io/bngblaster/

%prep
%setup -q
%autopatch -p1
sed -i 's|#!%{_bindir}/env python3|#!%{_bindir}/python3|g' \
  code/bgpupdate \
  code/bngblaster-cli \
  code/ldpupdate

%build
%if 0%{?sle_version} >= 150400 && 0%{?sle_version} < 160000 && 0%{?is_opensuse}
export CC="gcc-11"
export CXX="g++-11"
%endif
mkdir build && cd build
cmake -DBNGBLASTER_TESTS=ON ..
%cmake_build

%install
%cmake_install

%check
%ctest

%files
%license LICENSE
%doc README.md
%doc examples/
%doc wireshark/
%exclude %{_bindir}/bgpupdate
%{_bindir}/ldpupdate
%{_sbindir}/bngblaster
%{_sbindir}/bngblaster-cli
%{_sbindir}/lspgen

%changelog
openSUSE Build Service is sponsored by