linux-libre upgraded to version 4.19.26
[dragora.git] / recipes / shells / bash / recipe
blobe2c33e18b8e51efb38a005d49dec33d01a5c45d3
1 # Build recipe for GNU bash.
3 # Copyright (c) 2016-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=bash
18 version=5.0
19 release=1
21 # Set 'outdir' for a nice and well-organized output directory
22 outdir="${outdir}/${arch}/shells"
24 tarname=${program}-${version}.tar.gz
26 # Remote source(s)
27 fetch=ftp://ftp.gnu.org/gnu/bash/$tarname
29 description="
30 The Bourne Again SHell.
32 Bash is an sh-compatible shell that incorporates useful features from
33 the Korn shell (ksh) and C shell (csh).  It is intended to conform to
34 the IEEE POSIX P1003.2/ISO 9945.2 shell and tools standard.
36 It offers functional improvements over sh for both programming and
37 interactive use.
40 homepage=http://www.gnu.org/software/bash
41 license=GPLv3+
43 # Source documentation
44 docsdir="${docdir}/${program}-${version}"
46 build()
48     set -e
50     unpack "${tardir}/$tarname"
52     cd "$srcdir"
54     # Set sane permissions
55     chmod -R u+w,go-w,a+rX-s .
57     # Apply patches from upstream
58     for file in "${worktree}"/patches/bash/bash50-???*
59     do
60         if test -f "$file"
61         then
62             patch -Np0 -i "$file"
63         fi
64     done
66     ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
67      LIBS="-lncursesw" \
68      $configure_args \
69      --libdir=/usr/lib${libSuffix} \
70      --infodir=$infodir \
71      --mandir=$mandir \
72      --docdir=$docsdir \
73      --enable-static-link \
74      --enable-multibyte \
75      --with-curses \
76      --with-installed-readline \
77      --without-bash-malloc \
78      --build="$(cc -dumpmachine)"
80     make -j${jobs} V=1
81     make -j${jobs} DESTDIR="$destdir" install
83     # Compress info documents deleting index file for the package
84     if test -d "${destdir}/$infodir"
85     then
86         rm -f "${destdir}/${infodir}/dir"
87         lzip -9 "${destdir}/${infodir}"/*
88     fi
90     # Compress and link man pages (if needed)
91     if test -d "${destdir}/$mandir"
92     then
93         (
94             cd "${destdir}/$mandir"
95             find . -type f -exec lzip -9 '{}' +
96             find . -type l | while read -r file
97             do
98                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
99                 rm -- "$file"
100             done
101         )
102     fi