recipes: Replace 'outdir' with package hash tags
[dragora.git] / recipes / networking / inetutils / recipe
blobbe7d0bbf2e4df2e281cda99c374f579b8c4d30ae
1 # Build recipe for inetutils.
3 # Copyright (c) 2017-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=inetutils
18 version=1.9.4
19 release=3
21 # Define hash tag to categorize the package name output
22 pkghashtag=networking
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=http://ftp.gnu.org/gnu/inetutils/$tarname
29 description="
30 A collection of common network programs.
32 The inetutils package contains programs for basic networking.
35 homepage=http://www.gnu.org/software/inetutils
36 license=GPLv3+
38 # Source documentation
39 docs="AUTHORS COPYING NEWS README THANKS TODO"
40 docsdir="${docdir}/${program}-${version}"
42 build()
44     set -e
46     unpack "${tardir}/$tarname"
48     cd "$srcdir"
50     # Set sane permissions
51     chmod -R u+w,go-w,a+rX-s .
53     # Note about `--disable-logger':
54     # A better version is provided by the util-linux package
56     # Note about `--disable-nls':
57     # GNU Inetutils does not seem to provide locale files
59     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
60      $configure_args \
61      --libdir=/usr/lib${libSuffix} \
62      --infodir=$infodir \
63      --mandir=$mandir \
64      --docdir=$docsdir \
65      --enable-servers \
66      --enable-ncurses \
67      --disable-readline \
68      --disable-syslogd \
69      --disable-logger \
70      --disable-rexec \
71      --disable-rlogin \
72      --disable-rsh \
73      --disable-rcp \
74      --disable-whois \
75      --disable-nls \
76      --with-wrap \
77      --build="$(cc -dumpmachine)"
79     make -j${jobs} V=1
80     make -j${jobs} DESTDIR="$destdir" install
82     # Delete bogus file
83     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
84     rmdir "${destdir}/usr/lib${libSuffix}" || true
86     # Install inetd perp service
88     mkdir -p "${destdir}/etc/perp/inetd"
90     cp -p "${worktree}/archive/inetutils/etc/perp/inetd/rc.log" \
91           "${worktree}/archive/inetutils/etc/perp/inetd/rc.main" \
92           "${destdir}/etc/perp/inetd/"
94     chmod 755 "${destdir}"/etc/perp/inetd/rc.*
96     # THIS SERVICE IS DISABLED BY DEFAULT
97     chmod -t "${destdir}/etc/perp/inetd"
99     # Copy config file for inetd(8)
100     cp -p "${worktree}/archive/inetutils/etc/inetd.conf" "${destdir}/etc/"
101     chmod 644 "${destdir}/etc/inetd.conf"
103     # To handle config file(s)
104     touch "${destdir}/etc/.graft-config" \
105           "${destdir}/etc/perp/inetd/.graft-config"
107     # Compress info documents deleting index file for the package
108     if test -d "${destdir}/$infodir"
109     then
110         rm -f "${destdir}/${infodir}/dir"
111         lzip -9 "${destdir}/${infodir}"/*
112     fi
114     # Compress and link man pages (if needed)
115     if test -d "${destdir}/$mandir"
116     then
117         (
118             cd "${destdir}/$mandir"
119             find . -type f -exec lzip -9 '{}' +
120             find . -type l | while read -r file
121             do
122                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
123                 rm -- "$file"
124             done
125         )
126     fi
128     # Copy documentation
129     mkdir -p "${destdir}${docsdir}"
130     cp -p $docs "${destdir}${docsdir}"