etc: Enable a tty for a serial port by default.
[dragora.git] / recipes / networking / inetutils / recipe
blobd3b01e93904296f11bb447b81bc06b73fd0bd475
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
18 set -e
20 program=inetutils
21 version=2.4
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=networking
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://ftp.gnu.org/gnu/inetutils/$tarname
32 description="
33 A collection of common network programs.
35 The inetutils package contains programs for basic networking.
38 homepage=https://www.gnu.org/software/inetutils
39 license=GPLv3+
41 # Source documentation
42 docs="AUTHORS COPYING NEWS README THANKS TODO"
43 docsdir="${docdir}/${program}-${version}"
45 build()
47     unpack "${tardir}/$tarname"
49     cd "$srcdir"
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" \
59      $configure_args \
60      --libdir=/usr/lib${libSuffix} \
61      --infodir=$infodir \
62      --mandir=$mandir \
63      --docdir=$docsdir \
64      --enable-servers \
65      --enable-ncurses \
66      --enable-whois \
67      --disable-syslogd \
68      --disable-logger \
69      --disable-rexec \
70      --with-wrap \
71      --build="$(gcc -dumpmachine)"
73     make -j${jobs} V=1
74     make -j${jobs} DESTDIR="$destdir" install
76     # Delete bogus file
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"
103     then
104         rm -f "${destdir}/${infodir}/dir"
105         lzip -9 "${destdir}/${infodir}"/*
106     fi
108     # Compress and link man pages (if needed)
109     if test -d "${destdir}/$mandir"
110     then
111         (
112             cd "${destdir}/$mandir"
113             find . -type f -exec lzip -9 {} +
114             find . -type l | while read -r file
115             do
116                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
117                 rm -- "$file"
118             done
119         )
120     fi
122     # Copy documentation
123     mkdir -p "${destdir}/$docsdir"
124     cp -p $docs "${destdir}/$docsdir"