recipes: Set package category for blacklisted packages
[dragora.git] / recipes / tools / coreutils / recipe
blobbdf2211730f08f5f91bf29097b8f2bc7d8608fc3
1 # Build recipe for coreutils.
3 # Copyright (c) 2016-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=coreutils
21 version=8.32
22 release=2
24 # Define a category for the output of the package name
25 pkgcategory=tools
27 tarname=${program}-${version}.tar.gz
29 # Remote source(s)
30 fetch=https://ftpmirror.gnu.org/coreutils/$tarname
32 description="
33 The GNU core utilities.
35 The GNU core utilities are the basic file, shell and text manipulation
36 utilities of the GNU operating system.  These are the core utilities
37 which are expected to exist on every operating system.
40 homepage=https://www.gnu.org/software/coreutils
41 license=GPLv3+
43 # Source documentation
44 docs="AUTHORS COPYING ChangeLog NEWS README THANKS THANKS-to-translators TODO"
45 docsdir="${docdir}/${program}"
47 # Limit package name to the program name
48 full_pkgname="${program}@${pkgcategory}"
50 build()
52     unpack "${tardir}/$tarname"
54     cd "$srcdir"
56     # Set sane permissions
57     chmod -R u+w,go-w,a+rX-s .
59     ./configure FORCE_UNSAFE_CONFIGURE="1" DEFAULT_POSIX2_VERSION="199209" \
60     CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS -static" \
61      $configure_args \
62      --libdir=/usr/lib${libSuffix} \
63      --infodir=$infodir \
64      --mandir=$mandir \
65      --docdir=$docsdir \
66      --enable-install-program=arch \
67      --enable-no-install-program=kill,uptime,hostname \
68      --with-tty-group=tty \
69      --without-gmp \
70      --build="$(gcc -dumpmachine)"
72     make -j${jobs} V=1
73     make -j${jobs} DESTDIR="$destdir" install
75     # Create link to "ginstall", since many sources relies on it
76     ( cd "${destdir}/usr/bin" && ln -sf install ginstall )
78     # Remove generated charset.alias
79     rm -f "${destdir}/usr/lib${libSuffix}/charset.alias"
80     rmdir "${destdir}/usr/lib${libSuffix}" || true
82     # Add "DIR_COLORS" file
83     mkdir -p "${destdir}/etc/profile.d"
84     cat src/dircolors.hin > "${destdir}/etc/DIR_COLORS"
86     # Include our custom dircolors file for profile.d
87     cat "${worktree}/archive/coreutils/etc/profile.d/dircolors.sh" \
88       > "${destdir}/etc/profile.d/dircolors.sh"
90     # To handle config file(s)
91     touch "${destdir}/etc/profile.d/.graft-config" \
92           "${destdir}/etc/.graft-config"
94     # Compress info documents deleting index file for the package
95     if test -d "${destdir}/$infodir"
96     then
97         rm -f "${destdir}/${infodir}/dir"
98         lzip -9 "${destdir}/${infodir}"/*
99     fi
101     # Compress and link man pages (if needed)
102     if test -d "${destdir}/$mandir"
103     then
104         (
105             cd "${destdir}/$mandir"
106             find . -type f -exec lzip -9 {} +
107             find . -type l | while read -r file
108             do
109                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
110                 rm -- "$file"
111             done
112         )
113     fi
115     # Copy documentation
116     mkdir -p "${destdir}${docsdir}"
117     cp -p $docs "${destdir}${docsdir}"