iproute2/iproute2.spec

145 lines
4.5 KiB
RPMSpec

#
# spec file for package iproute2
#
# Copyright (c) 2011 SUSE LINUX Products 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 http://bugs.opensuse.org/
#
Name: iproute2
Group: Productivity/Networking/Routing
Provides: iproute = %version
Version: 3.1.0
Release: 0
Summary: Linux network configuration utilities
Url: http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2
# Using GPL-2.0 instead of GPL-2.0+ because of tc_skbedit.h and tc/q_multiq.c
License: GPL-2.0
#Git-Clone: git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2
Source0: %name-%version.tar.xz
# PATCH-FIX-UPSTREAM iproute2-libdir-1.diff status=unknown
Patch0: iproute2-libdir-1.diff
# PATCH-??-OPENSUSE iproute2-HZ.diff status=noidea
Patch1: iproute2-HZ.diff
# iproute2-xt.diff status=sent,waiting
Patch4: iproute2-xt.diff
# iproute2-xt-detect.diff status=sent,waiting
Patch6: iproute2-xt-detect.diff
# iproute2-implicit-definition-of-memcpy.diff status=sent,waiting
Patch7: iproute2-implicit-definition-of-memcpy.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: bison db-devel flex
BuildRequires: libpng-devel libtiff-devel pkgconfig >= 0.23
BuildRequires: xorg-x11-devel xz
%if 0%{?suse_version}
BuildRequires: ghostscript-x11 sgmltool texlive-latex
%endif
%if 0%{?fedora} || 0%{?rhel}
BuildRequires: ghostscript linuxdoc-tools sgml-common tetex-dvips tetex-latex
%endif
%define with_xt 1
%if 0%{?with_xt}
BuildRequires: pkgconfig(libnl-1) pkgconfig(xtables) >= 1.4.11
%endif
%description
This package provides the tools ip, tc, and rtmon needed to use the new
and advanced routing options of the Linux kernel. The SUSE Linux
distribution has used this package for network setup since SuSE Linux
8.0.
%package -n libnetlink-devel
Summary: A Higher Level Interface to the Netlink Service
Group: Development/Libraries/C and C++
Provides: libnetlink = %version-%release
License: GPL-2.0+
%description -n libnetlink-devel
libnetlink provides a higher level interface to rtnetlink(7).
%package doc
Summary: Documentation to iproute2
Group: Documentation
%if 0%{?suse_version} >= 1130
BuildArch: noarch
%endif
License: GPL-2.0+
%description doc
This package contains the PDF documentation from iproute2,
as well as examples and other outdated files.
%prep
%if 0%{?__xz:1}
%setup -q
%else
tar -xf "%{S:0}" --use=xz;
%setup -DTq
%endif
%patch0
%patch1
%patch -P 4 -P 6 -P 7 -p1
find . -name *.orig -print0 | xargs -r0 rm -v
%build
# build with -fPIC. For details see
# https://bugzilla.novell.com/show_bug.cgi?id=388021
xtlibdir="$(pkg-config xtables --variable=xtlibdir)";
make %{?_smp_mflags} LIBDIR=%_libdir CCOPTS="-D_GNU_SOURCE %optflags -Wstrict-prototypes -fPIC -DXT_LIB_DIR=\\\"$xtlibdir\\\""
cd doc
make pdf
%install
install -d %buildroot/{etc/,sbin/,usr/{sbin,share/man/man{3,8}}}
install -d %buildroot/{/usr/include,%_libdir,/usr/share}
make install DESTDIR=%buildroot LIBDIR=%_libdir \
MODDESTDIR="%buildroot/%_libdir/tc"
# We have m_xt
rm -f "%buildroot/%_libdir/tc/m_ipt.so"
install lib/libnetlink.a %buildroot/%_libdir
install include/libnetlink.h %buildroot%_includedir
mv %buildroot%_sbindir/ip %buildroot/sbin
mkdir -p %buildroot/bin
ln -sf /sbin/ip %buildroot/bin/ip
rm %buildroot%_sbindir/ifcfg
%files
%defattr(-,root,root)
%doc README* RELNOTES
%_sbindir/*
/sbin/*
/bin/ip
%_mandir/man7/*
%_mandir/man8/*
%dir %_sysconfdir/iproute2
%config(noreplace) %_sysconfdir/iproute2/*
%_libdir/tc
%dir %_datadir/tc
%attr(644,root,root)%_datadir/tc/*
%files doc
%defattr(-,root,root)
%doc doc/api-ip6-flowlabels.pdf doc/arpd.pdf doc/ip-cref.pdf
%doc doc/ip-tunnels.pdf doc/nstat.pdf doc/rtstat.pdf doc/ss.pdf
%doc examples/ ip/ifcfg ip/routef ip/routel
%files -n libnetlink-devel
%defattr(-,root,root)
%_includedir/*
%_mandir/man3/libnetlink*
%_libdir/lib*
%changelog