stages: 2/04-iso: Do not include kernel build/source tree in the LiveCD
[dragora.git] / recipes / tools / util-linux / recipe
blobf31dffc8f6379c642aa933ac421195c50550f18e
1 # Build recipe for util-linux (final).
3 # Copyright (c) 2016-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=util-linux
21 version=2.38.1
22 release=1
24 # Define a category for the output of the package name
25 pkgcategory=tools
27 # The installation of this package replaces to
28 replace=util-linux-pass1
30 tarname=${program}-${version}.tar.gz
32 # Remote source(s)
33 fetch="https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v${version%.*}/$tarname"
35 description="
36 Suite of essential utilities.
38 The util-linux package contains miscellaneous utility programs for
39 handling file systems, consoles, partitions, and messages.
42 homepage=https://github.com/karelzak/util-linux
43 license="GPLv2+, LGPLv2.1 | Public domain, BSD with advertising"
45 # Source documentation
46 docs="AUTHORS COPYING ChangeLog NEWS README*"
47 docsdir="${docdir}/${program}-${version}"
49 build()
51     unpack "${tardir}/$tarname"
53     cd "$srcdir"
55     # Set sane permissions
56     chmod -R u+w,go-w,a+rX-s .
58     ./configure CPPFLAGS="$QICPPFLAGS" \
59     CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
60      $configure_args \
61      --libdir=/usr/lib${libSuffix} \
62      --infodir=$infodir \
63      --mandir=$mandir \
64      --docdir=$docsdir \
65      --enable-usrdir-path \
66      --enable-static=no \
67      --enable-shared=yes \
68      --enable-sulogin-emergency-mount \
69      --enable-use-tty-group \
70      --enable-wall \
71      --enable-write \
72      --enable-libblkid \
73      --enable-libmount \
74      --enable-libuuid \
75      --disable-raw \
76      --with-btrfs \
77      --with-python=3 \
78      --with-readline \
79      --without-systemd \
80      --build="$(gcc -dumpmachine)"
82     make -j${jobs} V=1
83     make -j${jobs} DESTDIR="$destdir" install-strip
85     # Make `hwclock' available for the user
86     chmod 755 "${destdir}/usr/sbin/hwclock"
87     ( cd "${destdir}/usr/bin" && ln -s ../sbin/hwclock clock )
89     # Compress info documents deleting index file for the package
90     if test -d "${destdir}/$infodir"
91     then
92         rm -f "${destdir}/${infodir}/dir"
93         lzip -9 "${destdir}/${infodir}"/*
94     fi
96     # Compress and link man pages (if needed)
97     if test -d "${destdir}/$mandir"
98     then
99         (
100             cd "${destdir}/$mandir"
101             find . -type f -exec lzip -9 {} +
102             find . -type l | while read -r file
103             do
104                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
105                 rm -- "$file"
106             done
107         )
108     fi
110     # Copy documentation
111     mkdir -p "${destdir}/$docsdir"
112     cp -p $docs "${destdir}/$docsdir"