1 # Build recipe for inetutils.
3 # Copyright (c) 2017-2022 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 # Exit immediately on any error
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
30 fetch=https://ftp.gnu.org/gnu/inetutils/$tarname
33 A collection of common network programs.
35 The inetutils package contains programs for basic networking.
38 homepage=https://www.gnu.org/software/inetutils
41 # Source documentation
42 docs="AUTHORS COPYING NEWS README THANKS TODO"
43 docsdir="${docdir}/${program}-${version}"
47 unpack "${tardir}/$tarname"
51 # Set sane permissions
52 chmod -R u+w,go-w,a+rX-s .
54 # Note about `--disable-logger':
55 # A better version is provided by the util-linux package
57 ./configure CPPFLAGS="$QICPPFLAGS" \
58 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
60 --libdir=/usr/lib${libSuffix} \
71 --build="$(gcc -dumpmachine)"
74 make -j${jobs} DESTDIR="$destdir" install
77 rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
78 rmdir "${destdir}/usr/lib${libSuffix}" || true
80 # Install inetd perp service
82 mkdir -p "${destdir}/etc/perp/inetd"
84 cp -p "${worktree}/archive/inetutils/etc/perp/inetd/rc.log" \
85 "${worktree}/archive/inetutils/etc/perp/inetd/rc.main" \
86 "${destdir}/etc/perp/inetd/"
88 chmod 755 "${destdir}"/etc/perp/inetd/rc.*
90 # THIS SERVICE IS DISABLED BY DEFAULT
91 chmod -t "${destdir}/etc/perp/inetd"
93 # Copy config file for inetd(8)
94 cp -p "${worktree}/archive/inetutils/etc/inetd.conf" "${destdir}/etc/"
95 chmod 644 "${destdir}/etc/inetd.conf"
97 # To handle config file(s)
98 touch "${destdir}/etc/.graft-config" \
99 "${destdir}/etc/perp/inetd/.graft-config"
101 # Compress info documents deleting index file for the package
102 if test -d "${destdir}/$infodir"
104 rm -f "${destdir}/${infodir}/dir"
105 lzip -9 "${destdir}/${infodir}"/*
108 # Compress and link man pages (if needed)
109 if test -d "${destdir}/$mandir"
112 cd "${destdir}/$mandir"
113 find . -type f -exec lzip -9 {} +
114 find . -type l | while read -r file
116 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
123 mkdir -p "${destdir}/$docsdir"
124 cp -p $docs "${destdir}/$docsdir"