SHA256
1
0
forked from pool/iputils
iputils/iputils.spec

135 lines
4.1 KiB
RPMSpec
Raw Normal View History

#
# spec file for package iputils
#
# Copyright (c) 2012 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: iputils
BuildRequires: docbook_3
BuildRequires: iso_ent
BuildRequires: libopenssl-devel
BuildRequires: opensp
BuildRequires: perl-SGMLS
%if 0%{?suse_version} > 1130
BuildRequires: sysfsutils-devel
%else
BuildRequires: sysfsutils
%endif
BuildRequires: libcap-devel
Summary: IPv4 and IPv6 Networking Utilities
License: BSD-3-Clause ; GPL-2.0+
Group: Productivity/Networking/Other
Version: s20101006
Release: 0
Url: http://www.skbuff.net/iputils
Source: http://www.skbuff.net/iputils/iputils-%{version}.tar.bz2
# XXX: from linux/Documentation/networking/ifenslave.c
Source1: ifenslave.c
Patch1: iputils-pingnamelookuponce.diff
Patch2: iputils-traceroute6-stdint.diff
Patch3: iputils-ifenslave.diff
Patch6: iputils-s20101006-capabilities.diff
Patch7: iputils-pingtypo.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: permissions
%description
This package contains some small network tools for IPv4 and IPv6 like
rdisc, ping6, traceroute6, tracepath, and tracepath6.
%prep
%setup -q
cp -a %SOURCE1 .
%patch1
%patch2
%patch3
#patch4
#patch5
%patch6 -p1
%patch7
mkdir linux
touch linux/autoconf.h
%build
make %{?_smp_mflags} KERNEL_INCLUDE=$PWD \
CCOPT='%optflags -fno-strict-aliasing -fpie -D_GNU_SOURCE' \
LDLIBS='-pie -lcap -lresolv' \
CAPABILITIES=1
gcc $RPM_OPT_FLAGS -o ifenslave ifenslave.c
make man
%install
mkdir -p $RPM_BUILD_ROOT/%_sbindir
mkdir -p $RPM_BUILD_ROOT/%_bindir
install arping $RPM_BUILD_ROOT/%{_sbindir}
install ifenslave $RPM_BUILD_ROOT/%{_sbindir}
install clockdiff $RPM_BUILD_ROOT/%{_sbindir}
install rdisc $RPM_BUILD_ROOT/%{_sbindir}/in.rdisc
install tracepath $RPM_BUILD_ROOT/%{_sbindir}
install tracepath6 $RPM_BUILD_ROOT/%{_sbindir}
install ping $RPM_BUILD_ROOT/%{_bindir}
install ping6 $RPM_BUILD_ROOT/%{_bindir}
install ipg $RPM_BUILD_ROOT/%{_bindir}
#UsrMerge
mkdir -p $RPM_BUILD_ROOT/{bin,sbin}
ln -sf %{_sbindir}/arping $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/ifenslave $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/clockdiff $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/in.rdisc $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/tracepath $RPM_BUILD_ROOT/sbin
ln -sf %{_sbindir}/tracepath6 $RPM_BUILD_ROOT/sbin
ln -sf %{_bindir}/ping $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/ping6 $RPM_BUILD_ROOT/bin
ln -sf %{_bindir}/ipg $RPM_BUILD_ROOT/bin
#EndUsrMerge
mkdir -p $RPM_BUILD_ROOT%_mandir/man8
install -m 644 doc/arping.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/clockdiff.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/tracepath.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/ping.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/ping.8 $RPM_BUILD_ROOT%_mandir/man8/ping6.8
install -m 644 doc/pg3.8 $RPM_BUILD_ROOT%_mandir/man8/
install -m 644 doc/rdisc.8 $RPM_BUILD_ROOT%_mandir/man8/
%clean
rm -rf $RPM_BUILD_ROOT
%post
%set_permissions /bin/ping /bin/ping6
%verifyscript
%verify_permissions /bin/ping /bin/ping6
%files
%defattr(-,root,root)
%doc RELNOTES
%{_sbindir}/arping
%{_sbindir}/ifenslave
%{_sbindir}/clockdiff
%verify(not mode caps) %attr(4755,root,root) %{_bindir}/ping
%verify(not mode caps) %attr(4755,root,root) %{_bindir}/ping6
%{_bindir}/ipg
%{_sbindir}/tracepath
%{_sbindir}/tracepath6
%{_sbindir}/in.rdisc
#UsrMerge
/bin/*
/sbin/*
#EndUsrMerge
%attr(644,root,root) %_mandir/man8/*
%changelog