#!/bin/bash set -e build_dir=$1 install_dir=$2 install_type=$3 # With simpleBuildEnvironment flag, we're in build directory # which contains the copied source tree, but built files are in sources/bzip2-1.0.8/ # Change to the source directory with built files cd sources/bzip2-1.0.8/ # Install the programs echo "Installing bzip2 programs..." make PREFIX="${DESTDIR}${PREFIX}" install # Install the shared library echo "Installing shared library..." mkdir -p "${DESTDIR}${LIBDIR}" cp -av libbz2.so.* "${DESTDIR}${LIBDIR}/" ln -sv libbz2.so.1.0.8 "${DESTDIR}${LIBDIR}/libbz2.so" # Install the shared bzip2 binary and create symlinks echo "Installing shared bzip2 binary..." mkdir -p "${DESTDIR}${BINDIR}" cp -v bzip2-shared "${DESTDIR}${BINDIR}/bzip2" for i in "${DESTDIR}${BINDIR}"/{bzcat,bunzip2}; do ln -sfv bzip2 "$i" done # Remove useless static library echo "Removing static library..." rm -fv "${DESTDIR}${LIBDIR}/libbz2.a" echo "Installation complete."