File net-tools.spec of Package net-tools

# spec file for package net-tools
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# 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

Name:           net-tools
Version:        2.0+git20170221.479bb4a
Release:        0
Summary:        Important Programs for Networking
License:        GPL-2.0-or-later
Group:          Productivity/Networking/Other
# Repacked by the service file from git
Source:         %{name}-%{version}.tar.xz
# PATCH-FEATURE-SUSE: set configure values to our liking as we do not need
# everything here
Patch0:         net-tools-configure.patch
# Git formatted patches described in each patch
Patch1:         0001-Add-ether-wake-binary.patch
Patch2:         0002-Do-not-warn-about-interface-socket-not-binded.patch
Patch3:         0003-Add-support-for-EiB-in-interface.c.patch
Patch4:         0004-By-default-do-not-fopen-anything-in-netrom_gr.patch
Patch5:         0005-Add-support-for-interface-rename-in-nameif.patch
Patch6:         0006-Allow-interface-stacking.patch
Patch7:         0007-Introduce-T-notrim-option-in-netstat.patch
BuildRequires:  help2man
Requires:       hostname
Recommends:     %{name}-lang = %{version}
Recommends:     traceroute >= 2.0.0
Provides:       net_tool = %{version}
Obsoletes:      net_tool < %{version}

This package contains programs for network administration and maintenance.
Most of the utilities formerly contained in this package (netstat, arp,
ifconfig, rarp, route) are obsoleted by the tools from iproute2 package (ip, ss)
and have been moved to net-tools-deprecated.

%package deprecated
Summary:        Deprecated Networking Utilities
Group:          Productivity/Networking/Other
Recommends:     %{name}-lang = %{version}

%description deprecated
This package contains the deprecated network utilities arp, ifconfig, netstat and route,
which have been replaced by tools from the iproute2 package:
  * arp -> ip [-r] neigh
  * ifconfig -> ip a
  * netstat -> ss [-r]
  * route -> ip r


%setup -q
%autopatch -p1

export CFLAGS="%{optflags}"
make %{?_smp_mflags} config
make %{?_smp_mflags}

%make_install BINDIR=%{_bindir} SBINDIR=%{_sbindir}

# remove rarp as it is not usefull with our kernel
rm -fv %{buildroot}/usr/*bin/rarp
rm -fv %{buildroot}/%{_mandir}/man*/rarp.*
rm -fv %{buildroot}/%{_mandir}/*/man*/rarp.*
# Fix manpage locations
mv %{buildroot}/%{_mandir}/de_DE %{buildroot}/%{_mandir}/de
mv %{buildroot}/%{_mandir}/fr_FR %{buildroot}/%{_mandir}/fr
# Generate missing manpages
for tool in iptunnel ipmaddr; do
  help2man -s8 "%{buildroot}%{_sbindir}/${tool}" --no-discard-stderr >"${t}"
# generate bin/sbin compat symlinks
mkdir -p %{buildroot}/sbin
mkdir -p %{buildroot}/bin
for i in ether-wake nameif plipconfig slattach arp ipmaddr iptunnel; do
ln -s %{_sbindir}/$i %{buildroot}/sbin/$i
for i in netstat ifconfig route; do
ln -s %{_bindir}/$i %{buildroot}/bin/$i
%find_lang %{name} --all-name

%license COPYING

%files deprecated

%files lang -f %{name}.lang

openSUSE Build Service is sponsored by