recipes: Honor CPPFLAGS (through QICPPFLAGS) whenever is possible
[dragora.git] / recipes / networking / inetutils / recipe
blob9d55e67b6eccd3d51e1f5ed099c6dd3ce378c5b6
1 # Build recipe for inetutils.
3 # Copyright (c) 2017-2021 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.0
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=http://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=http://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" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
58      $configure_args \
59      --libdir=/usr/lib${libSuffix} \
60      --infodir=$infodir \
61      --mandir=$mandir \
62      --docdir=$docsdir \
63      --enable-servers \
64      --enable-ncurses \
65      --disable-syslogd \
66      --disable-logger \
67      --disable-rexec \
68      --disable-rlogin \
69      --disable-rsh \
70      --disable-rcp \
71      --disable-whois \
72      --with-wrap \
73      --build="$(gcc -dumpmachine)"
75     make -j${jobs} V=1
76     make -j${jobs} DESTDIR="$destdir" install
78     # Delete bogus file
79     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
80     rmdir "${destdir}/usr/lib${libSuffix}" || true
82     # Install inetd perp service
84     mkdir -p "${destdir}/etc/perp/inetd"
86     cp -p "${worktree}/archive/inetutils/etc/perp/inetd/rc.log" \
87           "${worktree}/archive/inetutils/etc/perp/inetd/rc.main" \
88           "${destdir}/etc/perp/inetd/"
90     chmod 755 "${destdir}"/etc/perp/inetd/rc.*
92     # THIS SERVICE IS DISABLED BY DEFAULT
93     chmod -t "${destdir}/etc/perp/inetd"
95     # Copy config file for inetd(8)
96     cp -p "${worktree}/archive/inetutils/etc/inetd.conf" "${destdir}/etc/"
97     chmod 644 "${destdir}/etc/inetd.conf"
99     # To handle config file(s)
100     touch "${destdir}/etc/.graft-config" \
101           "${destdir}/etc/perp/inetd/.graft-config"
103     # Compress info documents deleting index file for the package
104     if test -d "${destdir}/$infodir"
105     then
106         rm -f "${destdir}/${infodir}/dir"
107         lzip -9 "${destdir}/${infodir}"/*
108     fi
110     # Compress and link man pages (if needed)
111     if test -d "${destdir}/$mandir"
112     then
113         (
114             cd "${destdir}/$mandir"
115             find . -type f -exec lzip -9 {} +
116             find . -type l | while read -r file
117             do
118                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
119                 rm -- "$file"
120             done
121         )
122     fi
124     # Copy documentation
125     mkdir -p "${destdir}${docsdir}"
126     cp -p $docs "${destdir}${docsdir}"