Created
October 9, 2014 21:35
-
-
Save andreasf/3d508a59432476614b71 to your computer and use it in GitHub Desktop.
Download and build GNU Bash 4.2.53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: download clean extract patch build check | |
download: | |
if [ ! -e "bash-4.2.tar.gz" ]; \ | |
then \ | |
wget -nv https://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz; \ | |
fi; \ | |
if [ ! -e "patches-4.2" ]; then \ | |
mkdir patches-4.2; \ | |
cd patches-4.2; \ | |
for i in `seq 1 53`; \ | |
do \ | |
num=`printf "%03d" $$i`; \ | |
wget -nv https://ftp.gnu.org/gnu/bash/bash-4.2-patches/bash42-$$num; \ | |
done; \ | |
cd ..; \ | |
fi | |
clean: | |
rm -rf bash-4.2 bash-4.2-patched bash-20120427 bash-4.2.47 bash-4.2.48 \ | |
bash-4.2.49 bash-4.2.50 bash-4.2.51 bash-4.2.52 | |
extract: | |
tar zxf bash-4.2.tar.gz | |
patch: | |
cp -R bash-4.2 bash-4.2-patched; \ | |
ln -s bash-4.2-patched bash-20120427; \ | |
ln -s bash-4.2-patched bash-4.2.47; \ | |
ln -s bash-4.2-patched bash-4.2.48; \ | |
ln -s bash-4.2-patched bash-4.2.49; \ | |
ln -s bash-4.2-patched bash-4.2.50; \ | |
ln -s bash-4.2-patched bash-4.2.51; \ | |
ln -s bash-4.2-patched bash-4.2.52; \ | |
cd patches-4.2; \ | |
for file in $$(ls); \ | |
do \ | |
echo "applying $$file..."; \ | |
cat $$file|patch -p0; \ | |
done | |
cd .. | |
build: | |
cd bash-4.2-patched; \ | |
./configure; \ | |
make; \ | |
cd .. | |
check: | |
if [ ! -e "bashcheck" ]; \ | |
then \ | |
wget -nv https://github.com/hannob/bashcheck/raw/master/bashcheck --no-check-certificate; \ | |
chmod a+x bashcheck; \ | |
fi; \ | |
./bashcheck `pwd`/bash-4.2-patched/bash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment