1 # Build recipe for GNU bash.
3 # Copyright (c) 2016-2019, 2021-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
24 # Define a category for the output of the package name
27 tarname=${program}-${version}.tar.gz
30 fetch=https://ftp.gnu.org/gnu/bash/$tarname
33 The Bourne Again SHell (version $version).
35 Bash is an sh-compatible shell that incorporates useful features from
36 the Korn shell (ksh) and C shell (csh). It is intended to conform to
37 the IEEE POSIX P1003.2/ISO 9945.2 shell and tools standard.
39 It offers functional improvements over sh for both programming and
43 homepage=https://www.gnu.org/software/bash
46 # Limit package name to the program name
47 full_pkgname="${program}@${pkgcategory}"
49 # Source documentation
50 docsdir="${docdir}/${program}"
54 unpack "${tardir}/$tarname"
58 # Set sane permissions
59 chmod -R u+w,go-w,a+rX-s .
61 # Apply patches from upstream
62 for file in "${worktree}"/patches/bash/bash51-???*
70 ./configure CPPFLAGS="$QICPPFLAGS" \
71 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
73 --libdir=/usr/lib${libSuffix} \
77 --enable-static-link \
78 --with-installed-readline \
79 --without-bash-malloc \
80 --build="$(gcc -dumpmachine)"
83 make -j${jobs} DESTDIR="$destdir" install
85 # Compress info documents deleting index file for the package
86 if test -d "${destdir}/$infodir"
88 rm -f "${destdir}/${infodir}/dir"
89 lzip -9 "${destdir}/${infodir}"/*
92 # Compress and link man pages (if needed)
93 if test -d "${destdir}/$mandir"
96 cd "${destdir}/$mandir"
97 find . -type f -exec lzip -9 {} +
98 find . -type l | while read -r file
100 ln -sf "$(readlink -- "$file").lz" "${file}.lz"