summaryrefslogtreecommitdiff
path: root/packaging/net-tools.spec
blob: bcf15235ee63b0aeba452d98620fdd2e4e771a03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Summary: Basic networking tools
Name: net-tools
Version: 2.0_20121208git
Release: 0
License: GPLv2+
Group: System/Base
URL: http://sourceforge.net/projects/net-tools/

# git archive --format=tar --remote=git://net-tools.git.sourceforge.net/gitroot/net-tools/net-tools master | xz > net-tools-%%{version}.%%{checkout}.tar.xz
Source0: net-tools-%{version}.tar.xz
Source1: net-tools-config.h
Source2: net-tools-config.make

%description
The net-tools package contains basic networking tools,
including ifconfig, netstat, route, and others.
Most of them are obsolete. For replacement check iproute package.

%prep
%setup -q 

cp %SOURCE1 ./config.h
cp %SOURCE2 ./config.make

%build
export CFLAGS="$RPM_OPT_FLAGS $CFLAGS -fpie"
export LDFLAGS="$LDFLAGS -pie -Wl,-z,relro -Wl,-z,now"

make

%install
make BASEDIR=%{buildroot} mandir=%{_mandir} install

mkdir -p %{buildroot}/usr/sbin
mkdir -p %{buildroot}/usr/bin
mv %{buildroot}/bin/ifconfig %{buildroot}/usr/sbin
mv %{buildroot}/bin/route %{buildroot}/usr/sbin
mv %{buildroot}/bin/netstat %{buildroot}/usr/bin


rm %{buildroot}/sbin/rarp

# remove hostname (has its own package)
rm %{buildroot}/bin/dnsdomainname
rm %{buildroot}/bin/domainname
rm %{buildroot}/bin/hostname
rm %{buildroot}/bin/nisdomainname
rm %{buildroot}/bin/ypdomainname

%docs_package


%files 
%license COPYING
/usr/bin/netstat
/usr/sbin/ifconfig
/usr/sbin/route
/sbin/arp
/sbin/ipmaddr
/sbin/iptunnel
/sbin/nameif
/sbin/plipconfig
/sbin/slattach
/sbin/mii-tool