stages: 2/02-squashfs: apply some patches from Debian to make the ISO more reliable
[dragora.git] / recipes / networking / net-tools / recipe
blobccf74e7c7b08239e98f988cbc354c009b187774f
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-code
18 version=0eebece8c964e3cfa8a018f42b2e7e751a7009a0
19 release=1
21 pkgname=net-tools
22 pkgversion=0eebece
24 # Set 'outdir' for a nice and well-organized output directory
25 outdir="${outdir}/${arch}/networking"
27 tarname=${program}-${version}.zip
29 # Remote source(s)
30 fetch=http://rsync.dragora.org/current/sources/$tarname
31 #fetch=http://sourceforge.net/code-snapshots/git/n/ne/net-tools/code.git/$tarname
33 description="
34 Collection of basic networking programs.
36 A collection of programs that form the base set of the NET-3 networking
37 distribution for the GNU/Linux operating system.
39 This package includes the important tools for controlling the network
40 subsystem of the Linux kernel.  This includes arp, netstat, rarp and
41 route.  Additionally, this package contains utilities relating to
42 particular network hardware types (plipconfig, slattach, mii-tool)
43 and advanced aspects of IP configuration (iptunnel, ipmaddr).
46 homepage=http://net-tools.sourceforge.net/
47 license=GPLv2+
49 # Source documentation
50 docs="COPYING README THANKS TODO"
51 docsdir="${docdir}/${pkgname}-${pkgversion}"
53 # The build system does not support parallel jobs
54 jobs=1
56 build()
58     set -e
60     unpack "${tardir}/$tarname"
62     cd "$srcdir"
64     # Set sane permissions
65     chmod -R u+w,go-w,a+rX-s .
67     yes "" | make config
68     make -j${jobs} V=1 \
69      BINDIR=/usr/bin SBINDIR=/usr/sbin \
70      DESTDIR="$destdir" install
72     # Delete included programs on the inetutils packages
73     for program in hostname dnsdomainname ifconfig \
74                    domainname nisdomainname ypdomainname
75     do
76         rm "${destdir}/usr/bin/${program}"
77         rm "${destdir}/${mandir}/man1/${program}.1" \
78            "${destdir}/${mandir}/man8/${program}.8" || true;
79     done
80     unset program
82     strip --strip-unneeded "${destdir}"/usr/bin/* \
83      "${destdir}"/usr/sbin/* 2> /dev/null || true;
85     rmdir "${destdir}/${mandir}/man1" || true;
87     # Compress and link man pages (if needed)
88     if test -d "${destdir}/$mandir"
89     then
90         (
91             cd "${destdir}/$mandir"
92             find . -type f -exec lzip -9 '{}' +
93             find . -type l | while read -r file
94             do
95                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
96                 rm -- "$file"
97             done
98         )
99     fi
101     # Copy documentation
102     mkdir -p "${destdir}${docsdir}"
103     cp -p $docs "${destdir}${docsdir}"