48 lines
879 B
Bash
Executable File
48 lines
879 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
BUILDDIR=$1
|
|
DSC_FILE=$2
|
|
|
|
apt-get 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
|
|
|
|
|
|
BUILD_DIR=${BUILDDIR}/build
|
|
|
|
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
|
|
|
|
# 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-get -f install -y
|
|
|
|
|
|
|
|
|
|
|