install.sh 968 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. set -e
  3. build_dir=$1
  4. install_dir=$2
  5. install_type=$3
  6. # With simpleBuildEnvironment flag, we're in build directory
  7. # which contains the copied source tree, but built files are in sources/bzip2-1.0.8/
  8. # Change to the source directory with built files
  9. cd sources/bzip2-1.0.8/
  10. # Install the programs
  11. echo "Installing bzip2 programs..."
  12. make PREFIX="${DESTDIR}${PREFIX}" install
  13. # Install the shared library
  14. echo "Installing shared library..."
  15. mkdir -p "${DESTDIR}${LIBDIR}"
  16. cp -av libbz2.so.* "${DESTDIR}${LIBDIR}/"
  17. ln -sv libbz2.so.1.0.8 "${DESTDIR}${LIBDIR}/libbz2.so"
  18. # Install the shared bzip2 binary and create symlinks
  19. echo "Installing shared bzip2 binary..."
  20. mkdir -p "${DESTDIR}${BINDIR}"
  21. cp -v bzip2-shared "${DESTDIR}${BINDIR}/bzip2"
  22. for i in "${DESTDIR}${BINDIR}"/{bzcat,bunzip2}; do
  23. ln -sfv bzip2 "$i"
  24. done
  25. # Remove useless static library
  26. echo "Removing static library..."
  27. rm -fv "${DESTDIR}${LIBDIR}/libbz2.a"
  28. echo "Installation complete."