Sisyphus repository
Last update: 20 october 2017 | SRPMs: 17933 | Visits: 10202071
en ru br
ALT Linux repos
S:20161105-alt2
5.0: 20071127-alt4
4.1: 20071127-alt0.M41.1
4.0: 20020927-alt4.2
3.0: 20020927-alt2

Group :: Networking/Other
RPM: iputils

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Name: iputils
%define timestamp 20161105
Version: %timestamp
Release: alt2

Summary: Utilities for IPv4/IPv6 networking
License: %bsdstyle, %gpl2plus
Group: Networking/Other
Url: http://www.skbuff.net/iputils

Source0: %name-%version.tar
Source1: ping.control
Patch: %name-%version-%release.patch

Conflicts: netkit-base

PreReq: shadow-utils, control
Requires: /var/resolv

BuildRequires(pre): rpm-build-licenses

BuildRequires: OpenSP docbook-style-dsssl libcap-devel perl-SGMLSpm
BuildRequires: libsysfs-devel libssl-devel
BuildRequires: libidn-devel

%define _unpackaged_files_terminate_build 1

%define sysctl_conf_file %_sysctldir/70-iputils.conf
%define ping_real_dir %_usr/libexec/ping

%description
The iputils package contains basic utilities for monitoring a network:
+ clockdiff - measures clock difference;
+ ping/ping6 - sends ICMP ECHO_REQUEST packets to network hosts;
+ arping - ping by ARP packets;
+ rdisc - classic router discovery daemon;
+ tracepath/tracepath6 - traces path to destination discovering MTU
along this path.

%package -n ninfod
Group: Networking/Other
Summary: Node Information Query Daemon
License: %bsd

%description -n ninfod
Node Information Query (RFC4620) daemon. Responds to IPv6 Node Information
Queries.

%prep
%setup -n %name-%version
%patch -p1

%build
CFLAGS="%optflags -D_GNU_SOURCE -fno-strict-aliasing -Wstrict-prototypes"
%ifarch s390 s390x
 CFLAGS="$CFLAGS -fPIE"
%else
 CFLAGS="$CFLAGS -fpie"
%endif

%make_build \
CFLAGS="$CFLAGS" \
CCOPT="$CFLAGS" \
arping clockdiff ping rdisc tracepath ninfod
%make_build man -C doc

%install
mkdir -p %buildroot{%_bindir,%_sbindir,%_man8dir}
mkdir -p %buildroot%ping_real_dir
install -p arping clockdiff %buildroot%_sbindir/

install -p -m755 tracepath %buildroot%_bindir/
ln -s tracepath %buildroot%_bindir/tracepath6

install -p -m700 ping %buildroot%ping_real_dir/ping
ln -s %ping_real_dir/ping %buildroot%_bindir/ping
ln -s %ping_real_dir/ping %buildroot%_bindir/ping6

install -p rdisc %buildroot%_sbindir/rdisc
install -p ninfod/ninfod %buildroot%_sbindir/
pushd doc
install -pm644 arping.8 clockdiff.8 rdisc.8 ninfod.8 \
%buildroot%_man8dir/
install -pD -m644 ping.1 %buildroot%_man1dir/ping.1
install -pD -m644 tracepath.1 %buildroot%_man1dir/tracepath.1
ln -s ping.1 %buildroot%_man1dir/ping6.1
ln -s tracepath.1 %buildroot%_man1dir/tracepath6.1
popd

install -pD -m755 %SOURCE1 %buildroot%_controldir/ping

mkdir -p %buildroot%_sysctldir/
touch %buildroot%sysctl_conf_file

# for backward compatibility

mkdir -p %buildroot/bin/
for p in ping ping6 tracepath tracepath6; do
ln -s %_bindir/"$p"  %buildroot/bin/"$p"
done

%pre
groupadd -r -f iputils ||:
useradd -r -g iputils -d /dev/null -s /dev/null -n iputils >/dev/null 2>&1 ||:
groupadd -r -f netadmin ||:

%pre_control ping

%post
if [ ! -e %sysctl_conf_file ]; then
ALLOW_GID="$(getent group iputils | cut -f3 -d:)" ||:
if [ -n "$ALLOW_GID" ]; then
cat >%_sysctldir/70-iputils.conf <<EOF
# Allow ping socket creation for group iputils
net.ipv4.ping_group_range = $ALLOW_GID $ALLOW_GID
EOF
sysctl -p %sysctl_conf_file ||:
fi
fi

%post_control ping

%files
%config %_controldir/ping
%attr(700,root,netadmin) %verify(not mode) %dir %ping_real_dir/
%attr(2711,root,iputils) %ping_real_dir/ping
%ghost %config %sysctl_conf_file
/bin/*
%_bindir/*
%_sbindir/*
%_mandir/man?/*
%doc RELNOTES
%exclude %_sbindir/ninfod
%exclude %_man8dir/ninfod.*

%files -n ninfod
%doc ninfod/COPYING
%_sbindir/ninfod
%_man8dir/ninfod.*

%changelog

Full changelog you can see here

 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin