#!/usr/bin/env bash BUILDDIR=$1 DSC_FILE=$2 apt install -y git-buildpackage equivs 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 FILESTAMP=`date '+%Y-%m-%d-%H-%M'`-`uuidgen -t` BUILD_DIR=${BUILDDIR}/build-${FILESTAMPS} echo "Building in ${BUILD_DIR}" mkdir -p ${BUILD_DIR} cd ${BUILD_DIR} # Download the package to build echo "RUNNING: gbp import-dsc -v --allow-unauthenticated ${DSC_FILE}" gbp import-dsc -v --allow-unauthenticated ${DSC_FILE} cd * # Install the build deps mk-build-deps debian/control --install --root-cmd sudo --remove ## Update to latest via uscan and debian/watch #VERSION=$(uscan --no-download ) #uscan --verbose #uupdate -v 1.11.5 ../*.tar.gz #cd ../*${VERSION} # Build the packages if [ -d debian ]; then dpkg-buildpackage -us -uc -b fi DEPS_DEB=$(ls ../*deb) APT_REMOVE=${DEPS_DEB%%\_*} # Install the built debs INSTALL_DEB=${APT_REMOVE%%_*} echo "LSD: ${INSTALL_DEB}" dpkg -i ${INSTALL_DEB}_*deb apt install -y -f