File netperf.spec of Package netperf

#
# spec file for package netperf
#
# Copyright (c) 2020 SUSE LLC
#
# 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:           netperf
Version:        2.7.0
Release:        0
Summary:        Network benchmarking tool
License:        NonFree
Group:          System/Benchmark
URL:            http://www.netperf.org/
Source:         %{name}-%{version}.tar.bz2
# Patches from gentoo package
Patch0:         netperf-fix-scripts.patch
Patch1:         netperf-2.6.0-log-dir.patch
Patch2:         netperf-2.7.0-includes.patch
Patch3:         netperf-2.7.0-inline.patch
Patch4:         netperf-2.7.0-space.patch
BuildRequires:  lksctp-tools-devel
Requires(post): %{install_info_prereq}
Requires(preun): %{install_info_prereq}
Recommends:     ethtool
%ifarch ix86 x86_64
BuildRequires:  libsmbios-devel
%endif

%description
Netperf is a benchmark that can be used to measure the performance of many different types of networking. It provides tests for both unidirecitonal throughput, and end-to-end latency. The environments currently measureable by netperf include:

    * TCP and UDP via BSD Sockets for both IPv4 and IPv6
    * DLPI
    * Unix Domain Sockets
    * SCTP for both IPv4 and IPv6

%prep
%autosetup -p1

%build
CFLAGS="%{optflags} -fno-strict-aliasing -fcommon"
CXXFLAGS="%{optflgags} -D_GNU_SOURCE"
%configure \
  --enable-unixdomain \
  --enable-dccp \
  --enable-sctp \
  --enable-demo
%make_build

%install
%make_install
rm doc/examples/Makefile*

%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%files
%license COPYING
%doc AUTHORS ChangeLog README
%{_bindir}/netperf
%{_bindir}/netserver
%doc doc/examples
%{_mandir}/man1/*
%{_infodir}/%{name}.info%{?ext_info}

%changelog
openSUSE Build Service is sponsored by