Simplify the build dep install.remove.

This commit is contained in:
Cyteen May 2020-03-01 05:26:02 +00:00
parent b8918ab500
commit 8095f299e2
1 changed files with 16 additions and 13 deletions

View File

@ -1,6 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
apt-get install -y git-buildpackage BUILDDIR=$1
DSC_FILE=$2
apt-get install -y git-buildpackage equivs
if [ "$1" == "-h" ]; then if [ "$1" == "-h" ]; then
echo "Usage: `basename $0` Takes a build location and a dsc file echo "Usage: `basename $0` Takes a build location and a dsc file
@ -9,33 +12,33 @@ if [ "$1" == "-h" ]; then
fi fi
BUILD_DIR=$1/build BUILD_DIR=${BUILDDIR}/build
echo "Building in ${BUILD_DIR}"
mkdir -p ${BUILD_DIR} mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR} cd ${BUILD_DIR}
# Download the package to build # Download the package to build
gbp import-dsc -v --allow-unauthenticated $2 echo "RUNNING: gbp import-dsc -v --allow-unauthenticated ${DSC_FILE}"
gbp import-dsc -v --allow-unauthenticated ${DSC_FILE}
cd * cd *
# Install the build deps # Install the build deps
mk-build-deps debian/control mk-build-deps debian/control --install --root-cmd sudo --remove
DEPS_DEB=$(ls *deb)
dpkg -i ${DEPS_DEB}
apt-get -f install -y
rm ${DEPS_DEB}
# Build the packages # Build the packages
dpkg-buildpackage -us -uc -b if [ -d debian ]; then
dpkg-buildpackage -us -uc -b
fi
# Remove the build deps DEPS_DEB=$(ls ../*deb)
APT_REMOVE=${DEPS_DEB%%\_*} APT_REMOVE=${DEPS_DEB%%\_*}
apt-get -y remove --purge ${APT_REMOVE}
apt-get -y autoremove
# Install the built debs # Install the built debs
INSTALL_DEB=${APT_REMOVE%%_*} INSTALL_DEB=${APT_REMOVE%%_*}
dpkg -i ../${INSTALL_DEB}_*deb echo "LSD: ${INSTALL_DEB}"
dpkg -i ${INSTALL_DEB}_*deb
apt-get -f install -y apt-get -f install -y