Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 43 lines (32 sloc) 1.112 kb
# Run with no arguments from any directory, with no special setup required.
# Abort if any command returns an error exit status, or if an undefined
# variable is used.
set -e
set -u
base_dir=$(realpath $(dirname $0))
# Extract the latest version from the web page.
new_version=$(wget -O - --no-verbose -q | \
grep '[0-9].*.tar.gz' | \
sed 's/.*zlib-\(.*\)\.tar\.gz.*/\1/')
echo "Upgrading zlib to version $new_version..."
echo "-------------------------------------------------------------------"
echo "Downloading $tgz_file..."
wget -O /tmp/$tgz_file --no-verbose "$tgz_file"
echo "Cleaning out old version..."
rm -rf $src_dir
echo "Unpacking new version..."
cd $base_dir
tar zxf /tmp/$tgz_file
mv zlib-$new_version src
echo "Configuring new version..."
cd src
rm Makefile configure.log
cd ..
echo "Fixing NOTICE file..."
grep -A21 'Copyright notice:' src/README | tail -20 > NOTICE
md5_sum=$(md5sum /tmp/$tgz_file)
echo "MD5: $md5_sum"
Jump to Line
Something went wrong with that request. Please try again.