#!/usr/bin/env bash if [ "$1" == "-h" ]; then echo "Usage: `basename $0` Takes a build location and a dsc file or a url to one and builds and installs the result." exit 0 fi BUILD_DIR=$1/build mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} # Download the package to build gbp import-dsc -v --allow-unauthenticated $2 cd * # Install the build deps mk-build-deps debian/control DEPS_DEB=$(ls *deb) dpkg -i ${DEPS_DEB} apt-get -f install -y rm ${DEPS_DEB} # Build the packages dpkg-buildpackage -us -uc -b # Remove the build deps APT_REMOVE=${DEPS_DEB%%\_*} apt-get -y remove --purge ${APT_REMOVE} apt-get -y autoremove # Install the built debs INSTALL_DEB=${APT_REMOVE%%-*} dpkg -i ../${INSTALL_DEB}_*deb apt-get -f install -y