forked from pool/iproute2
Jan Engelhardt
067408d5f9
First of all, I would like to apologize for this submit request, if it was up to me, I would never send it. I strongly believe it's package maintainer's job to decide how a package should be organized, what should the specfile look like, how should patches be named and what format to use etc. That's why I really dislike the idea of pushing package maintainer to accept someone else's preferences. I've been forced to submit it but you shouldn't feel obliged to accept it unless you really like it. Except for some minor differences, this is a cleanup I did for SLE15 iproute2 package submission. In order to effectively maintain the package throughout the SLE15 lifetime (planned to be 13+ years), I'm using a git repository to prepare, handle and track patches and prefer to have them in uniform format with annotations similar to ones we use in openSUSE/SLE kernel packages. While this workflow proved beneficial for SLE11 and SLE12 maintenance in last few years, I don't think it's worth the extra work for Factory package with only has few patches which are either permanent or only stay there for relatively short time. Also, with random one-time contributors to Factory package, it would be even more difficult to keep the package cleaned up. The problem is that we have so-called "Factory first" policy. In theory, this should mean no features or bugfixes should be added to SLE packages unless they are also in the respective Factory package (and preferrably also upstream) or at least submitted there. This idea sounds reasonable but the SLE15 review team interprets the policy in rather different way: they want even the contents Factory and SLE15 packages in OBS to look (almost) the same and enforce that by declining submissions that differ from Factory in non-trivial way. For six weeks I tried to appeal to common sense and explain that those two packages only differ in "metadata coding style" and that if SLE and openSUSE packages are maintained by different people, there is no need for one of them to adopt the other's preferences (and that the packages will start to differ soon anyway). They were adamant and in the end, they made it absolutely clear that there is no way the SLE15 submission can be accepted unless I at least submit my cleanup to Factory devel project. They didn't say it has to be accepted, though, so here it is but it's completely up to you if you want it or not. Once again, I'm sorry about dragging you into this, I wanted to avoid it but I ran out of options. Summary of the changes: - patches are regenerated using git - patches are annotated the way we use in kernel packages (the annotations make more sense for upstream backports but we currently don't have any in Factory) - one patch (iproute2-HZ.diff) is split into two - Patch* lines are moved out of the rest of tags for easier orientation - conditionally applied patches are moved to the end of the series - all patches are applied in both specfiles so that both builds use the same source tree OBS-URL: https://build.opensuse.org/request/show/518382 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iproute2?expand=0&rev=144
171 lines
5.3 KiB
RPMSpec
171 lines
5.3 KiB
RPMSpec
#
|
|
# spec file for package iproute2
|
|
#
|
|
# Copyright (c) 2017 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 http://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
Name: iproute2
|
|
Version: 4.12
|
|
Release: 0
|
|
%define rversion 4.12.0
|
|
Summary: Linux network configuration utilities
|
|
License: GPL-2.0
|
|
Group: Productivity/Networking/Routing
|
|
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
|
|
|
|
#DL-URL: http://kernel.org/pub/linux/utils/net/iproute2/
|
|
#Git-Clone: git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2
|
|
Source: http://kernel.org/pub/linux/utils/net/iproute2/%name-%rversion.tar.xz
|
|
Source2: http://kernel.org/pub/linux/utils/net/iproute2/%name-%rversion.tar.sign
|
|
Source666: pre_checkin.sh
|
|
Source667: %name.keyring
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
BuildRequires: bison
|
|
BuildRequires: db-devel
|
|
BuildRequires: flex
|
|
BuildRequires: libelf-devel
|
|
BuildRequires: pkgconfig >= 0.21
|
|
BuildRequires: xz
|
|
%define with_xt 1
|
|
%if 0%{?with_xt}
|
|
BuildRequires: pkgconfig(libmnl)
|
|
BuildRequires: pkgconfig(libselinux)
|
|
BuildRequires: pkgconfig(xtables) >= 1.4.11
|
|
%endif
|
|
Provides: iproute = %version-%release
|
|
Provides: %name(xfrm6_raw) = %version-%release
|
|
|
|
Patch1: adjust-installation-directories-for-openSUSE-SLE.patch
|
|
Patch2: use-sysconf-_SC_CLK_TCK-if-HZ-undefined.patch
|
|
Patch3: add-explicit-typecast-to-avoid-gcc-warning.patch
|
|
Patch4: xfrm-support-displaying-transformations-used-for-Mob.patch
|
|
Patch5: man-fix-documentation-references-in-manual-pages.patch
|
|
Patch6: split-link-and-compile-steps-for-binaries.patch
|
|
Patch7: examples-fix-bashisms-in-example-script.patch
|
|
Patch101: doc-revert-PDF-creation.patch
|
|
Patch102: Revert-emp-fix-warning-on-deprecated-bison-directive.patch
|
|
|
|
%description
|
|
iproute2 is a collection of user-space utilities to set up networking
|
|
under Linux from the command-line. It can inspect and configure,
|
|
among other things: interface paramters, IP addresses, routing,
|
|
tunnels, bridges, packet transformations (IPsec, etc.), and Quality
|
|
of Service.
|
|
|
|
%package -n libnetlink-devel
|
|
Summary: A Higher Level Interface to the Netlink Service
|
|
License: GPL-2.0+
|
|
Group: Development/Libraries/C and C++
|
|
Provides: libnetlink = %version-%release
|
|
|
|
%description -n libnetlink-devel
|
|
libnetlink provides a higher-level interface to rtnetlink(7).
|
|
New programs should use libmnl-devel instead.
|
|
|
|
%package bash-completion
|
|
Summary: Bash completion for iproute
|
|
License: GPL-2.0+
|
|
Group: System/Shells
|
|
Requires: bash-completion
|
|
|
|
%description bash-completion
|
|
bash command line completion support for iproute.
|
|
|
|
%prep
|
|
%setup -qn %name-%rversion
|
|
%patch1 -p1
|
|
%patch2 -p1
|
|
%patch3 -p1
|
|
%patch4 -p1
|
|
%patch5 -p1
|
|
%patch6 -p1
|
|
%patch7 -p1
|
|
%if 0%{?sles_version} == 11 || (0%{?suse_version} && 0%{?suse_version} <= 1220)
|
|
%patch101 -p1
|
|
%endif
|
|
%if 0%{?sles_version} == 11
|
|
%patch102 -p1
|
|
%endif
|
|
find . -name *.orig -delete
|
|
|
|
%build
|
|
# build with -fPIC. For details see
|
|
# https://bugzilla.novell.com/show_bug.cgi?id=388021
|
|
xt_libdir="$(pkg-config xtables --variable=xtlibdir)"
|
|
xt_cflags="$(pkg-config xtables --cflags)"
|
|
make %{?_smp_mflags} LIBDIR="%_libdir" CCOPTS="-D_GNU_SOURCE %optflags -Wstrict-prototypes -Wno-error -fPIC -DXT_LIB_DIR=\\\"$xt_libdir\\\" $xt_cflags"
|
|
|
|
%install
|
|
b="%buildroot"
|
|
install -d "$b"/{etc/,sbin/,usr/{bin,sbin,share/man/man{3,8}}}
|
|
install -d "$b"/{/usr/include,%_libdir,/usr/share}
|
|
make install DESTDIR="$b" LIBDIR="%_libdir" \
|
|
MODDESTDIR="$b/%_libdir/tc" DOCDIR="%_docdir/%name"
|
|
# We have m_xt
|
|
rm -f "$b/%_libdir/tc/m_ipt.so"
|
|
install -pm0644 "lib/libnetlink.a" "$b/%_libdir/"
|
|
chmod -x "$b/%_libdir/libnetlink.a"
|
|
install -pm0644 "include/libnetlink.h" "$b/%_includedir/"
|
|
chmod -x "$b/%_includedir/libnetlink.h"
|
|
#UsrMerge
|
|
ln -s "%_sbindir/ip" "$b/sbin"
|
|
mkdir -p "$b/bin"
|
|
ln -sf "%_sbindir/ip" "$b/bin/ip"
|
|
#EndUsrMerge
|
|
for BIN in lnstat nstat routef routel ss; do
|
|
ln -sf "%{_sbindir}/$BIN" "$b%{_bindir}/$BIN"
|
|
done
|
|
rm "$b/%_sbindir/ifcfg"
|
|
|
|
mkdir -p "$b/%_docdir/%name"
|
|
# packaged in iproute2-doc:
|
|
rm -rf $b/%_docdir/%name/*
|
|
cp -an README* COPYING "$b/%_docdir/%name/"
|
|
|
|
%files
|
|
%defattr(-,root,root)
|
|
%dir %_docdir/%name
|
|
%_docdir/%name/README*
|
|
%_docdir/%name/COPYING
|
|
%_bindir/lnstat
|
|
%_bindir/nstat
|
|
%_bindir/routef
|
|
%_bindir/routel
|
|
%_bindir/ss
|
|
%_sbindir/*
|
|
#UsrMerge
|
|
/sbin/*
|
|
/bin/ip
|
|
#EndUsrMerge
|
|
%_mandir/man7/*
|
|
%_mandir/man8/*
|
|
%dir %_sysconfdir/iproute2
|
|
%config(noreplace) %_sysconfdir/iproute2/*
|
|
%_libdir/tc/
|
|
%_datadir/tc/
|
|
|
|
%files -n libnetlink-devel
|
|
%defattr(-,root,root)
|
|
%_includedir/*
|
|
%_mandir/man3/libnetlink*
|
|
%_libdir/lib*
|
|
|
|
%files bash-completion
|
|
%defattr(-,root,root)
|
|
%_datadir/bash-completion/
|
|
|
|
%changelog
|