recipes: Rename 'pkghashtag' variable to 'pkgcategory'
[dragora.git] / recipes / networking / net-tools / recipe
blob990c0b3172adbbade924f4186277d1514922a052
1 # Build recipe for net-tools.
3 # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 program=net-tools
18 version=20181103_0eebece
19 release=2
21 # Define a category for the output of the package name
22 pkgcategory=networking
24 tarname=${program}-${version}.tar.lz
26 # Remote source(s)
27 fetch="
28  http://rsync.dragora.org/current/sources/$tarname
29  http://mirror.cedia.org.ec/dragora/current/sources/$tarname
32 description="
33 Collection of basic networking programs.
35 A collection of programs that form the base set of the NET-3 networking
36 distribution for the GNU/Linux operating system.
38 This package includes the important tools for controlling the network
39 subsystem of the Linux kernel.  This includes arp, netstat, rarp and
40 route.  Additionally, this package contains utilities relating to
41 particular network hardware types (plipconfig, slattach, mii-tool)
42 and advanced aspects of IP configuration (iptunnel, ipmaddr).
45 homepage=http://net-tools.sourceforge.net/
46 license=GPLv2+
48 # Source documentation
49 docs="COPYING README THANKS TODO"
50 docsdir="${docdir}/${program}-${version}"
52 # The build system does not support parallel jobs
53 jobs=1
55 build()
57     set -e
59     unpack "${tardir}/$tarname"
61     cd "$srcdir"
63     # Set sane permissions
64     chmod -R u+w,go-w,a+rX-s .
66     yes "" | make config
67     make -j${jobs} V=1 \
68      BINDIR=/usr/bin SBINDIR=/usr/sbin \
69      DESTDIR="$destdir" install
71     # Delete included programs on the inetutils packages
72     for program in hostname dnsdomainname ifconfig \
73                    domainname nisdomainname ypdomainname
74     do
75         rm "${destdir}/usr/bin/${program}"
76         rm "${destdir}/${mandir}/man1/${program}.1" \
77            "${destdir}/${mandir}/man8/${program}.8" || true;
78     done
79     unset program
81     strip --strip-unneeded "${destdir}"/usr/bin/* \
82      "${destdir}"/usr/sbin/* 2> /dev/null || true;
84     rmdir "${destdir}/${mandir}/man1" || true;
86     # Compress and link man pages (if needed)
87     if test -d "${destdir}/$mandir"
88     then
89         (
90             cd "${destdir}/$mandir"
91             find . -type f -exec lzip -9 '{}' +
92             find . -type l | while read -r file
93             do
94                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
95                 rm -- "$file"
96             done
97         )
98     fi
100     # Copy documentation
101     mkdir -p "${destdir}${docsdir}"
102     cp -p $docs "${destdir}${docsdir}"