File iperf.spec of Package iperf
%define realname iperf
%define gen 3
%define srcext tar.gz
%define so_ver 0
# Common info
Name: %{realname}%{?gen}
Version: 3.2
Release: wiz%{?extraver:0.}1%{?dist}
License: BSD-3-Clause
Group: Productivity/Networking/Other
URL: http://software.es.net/iperf
Summary: A TCP, UDP, and SCTP network bandwidth measurement tool
# Install-time parameters
Provides: lib%{realname}%{?so_ver}
# Build-time parameters
BuildRequires: pkgconfig gcc-c++
BuildRequires: pkgconfig(openssl)
BuildRoot: %{_tmppath}/%{name}-root
Source: http://downloads.es.net/pub/iperf/%{realname}-%{version}%{?extraver}.%{srcext}
%description
iperf is a tool for active measurements of the maximum achievable bandwidth
on IP networks. It supports tuning of various parameters related to timing,
protocols, and buffers. For each test it reports the bandwidth, loss, and
other parameters.
This version, sometimes referred to as iperf3, is a redesign of an original
version developed at NLANR/DAST. iperf3 is a new implementation from scratch,
with the goal of a smaller, simpler code base, and a library version of the
functionality that can be used in other programs. iperf3 also a number of
features found in other tools such as nuttcp and netperf, but were missing from
the original iperf. These include, for example, a zero-copy mode and optional
JSON output. Note that iperf3 is not backwards compatible with the
original iperf.
%package devel
Group: Development/Libraries/C and C++
Summary: Development files for %{name}
Requires: %{name} = %{version}
Provides: lib%{realname}-devel lib%{realname}%{?so_ver}-devel
%description devel
Development files for %{name}
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{version}%{?extraver}
%{__sed} -ri '/^iperf3_profile_\w+FLAGS/ d' src/Makefile.in
%build
%configure \
--disable-static \
CFLAGS="%{optflags} %{?gcc_lto}" \
CXXFLAGS="%{optflags} %{?gcc_lto}" \
LDFLAGS="-Wl,--as-needed -Wl,--strip-all %{?gcc_lto}"
%{__make} %{?_smp_mflags}
%install
%{__make} install DESTDIR=%{buildroot}
%{__ln_s} iperf3 %{buildroot}%{_bindir}/iperf
MAN=`find %{buildroot}%{_mandir}/man1/ -name "iperf3.1*"`
%{__ln_s} ${MAN##*/} %{buildroot}%{_mandir}/man1/iperf.1${MAN##*.1}
%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
%files
%defattr(-,root,root)
%doc LICENSE README.md RELEASE_NOTES
%{_bindir}/*
%{_libdir}/lib%{realname}.so.%{?so_ver}*
%doc %{_mandir}/man1/*
%files devel
%defattr(-,root,root)
%{_includedir}/iperf_api.h
%{_libdir}/lib%{realname}.so
%exclude %{_libdir}/lib%{realname}.la
%doc %{_mandir}/man3/*
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog