mirror of
https://github.com/Pmodules/Pmodules.git
synced 2026-06-21 15:27:57 +02:00
55 lines
1.2 KiB
Bash
Executable File
55 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# https://www.gnu.org/software/bash/
|
|
#
|
|
P=bash
|
|
V=${BASH5_VERSION:-5.3}
|
|
FNAME="$P-$V.tar.gz"
|
|
DOWNLOAD_URL="https://ftp.gnu.org/gnu/$P/${FNAME}"
|
|
|
|
source "$(dirname "$0")/librecipes.bash"
|
|
|
|
if [[ "$V" == '5.3' ]]; then
|
|
cd "${SRC_DIR}"
|
|
for ((i=1; i<=9; i++)); do
|
|
patch_name="bash53-00$i"
|
|
src_file="${DOWNLOADS_DIR}/${patch_name}"
|
|
url="https://ftp.gnu.org/gnu/$P/$P-$V-patches/${patch_name}"
|
|
test -r "${src_file}" || curl -L --output "$_" "${url}" \
|
|
|| exit ${PB_ERR_DOWNLOAD}
|
|
patch -p0 < "${src_file}"
|
|
done
|
|
fi
|
|
|
|
#---
|
|
# configure
|
|
mkdir -p "${BUILD_DIR}" && cd "$_" || exit ${PB_ERR_SYSTEM}
|
|
loadablesdir="${PREFIX}/${UTILBIN_DIR}/builtins" \
|
|
"${SRC_DIR}/configure" \
|
|
--prefix="${PREFIX}" \
|
|
--bindir="${PREFIX}/${UTILBIN_DIR}" \
|
|
|| exit ${PB_ERR_CONFIGURE}
|
|
|
|
#---
|
|
# compile
|
|
make -j ${NJOBS} || exit ${PB_ERR_MAKE}
|
|
make -C examples/loadables -j ${NJOBS} || exit ${PB_ERR_MAKE}
|
|
|
|
#---
|
|
# install
|
|
make install || exit ${PB_ERR_INSTALL}
|
|
|
|
#---
|
|
# post-install
|
|
rm -rf "${PREFIX}/include/bash"
|
|
rm -rf "${PREFIX}/share/locale"
|
|
rm -rf "${PREFIX}/share/doc"
|
|
rm -rf "${PREFIX}/share/info"
|
|
rm -rf "${PREFIX}/share/man/man1/bash"*
|
|
|
|
#---
|
|
# Local Variables:
|
|
# mode: shell-script-mode
|
|
# sh-basic-offset: 8
|
|
# End:
|