#!/bin/bash set -e # XZ Utils 5.8.1 source acquisition script # Downloads and extracts the source code from the official repository ARCHIVE_URL="https://sourceforge.net/projects/lzmautils/files/xz-5.8.1.tar.xz/download" ARCHIVE_NAME="xz-5.8.1.tar.xz" EXTRACT_DIR="sources/xz" EXTRACT_SUBDIR="xz" echo "Downloading XZ Utils 5.8.1 source..." wget -O ${ARCHIVE_NAME} ${ARCHIVE_URL} echo "Creating extraction directory..." mkdir -p ${EXTRACT_DIR} echo "Extracting archive..." tar -xf ${ARCHIVE_NAME} -C ${EXTRACT_DIR} # The archive extracts to xz-5.8.1/, we want it to be in sources/xz/ if [ -d "${EXTRACT_DIR}/xz-5.8.1" ]; then mv ${EXTRACT_DIR}/xz-5.8.1 ${EXTRACT_DIR}/${EXTRACT_SUBDIR} fi echo "Cleaning up archive..." rm ${ARCHIVE_NAME} echo "Source acquisition complete."