vinaigrette/scripts/rebuildd/build-binaries
2020-06-04 19:35:28 +00:00

43 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
codename=$1
package=$2
version=$3
arch=$4
sendxmpppy "⏳ Starting build for ${package}/${version} for arch=$arch ..."
source /home/vinaigrette/config/config
source /home/vinaigrette/scripts/package_helpers.sh
if [[ $arch == all ]]; then arch=$DEFAULT_ARCH; fi
if [[ $arch == $DEFAULT_ARCH ]]; then
# Build architecture independent packages too
DEBBUILDOPTS="-b"
else
# Build only binary-only limited to architecture dependent packages
DEBBUILDOPTS="-B"
fi
# Format needed pbuilder arguments
DSC_FILE="${package}_${version}.dsc"
BASE_TGZ="${PBUILDER_CHROOTS}/${codename}-${arch}.tgz"
echo "######################"
echo " Starting build ... "
echo "######################"
echo "Running 'pbuilder build --basetgz $BASE_TGZ --debbuildopts $DEBBUILDOPTS $DSC_FILE"
pbuilder build \
--basetgz "$BASE_TGZ" \
--architecture $arch \
--debbuildopts "$DEBBUILDOPTS" \
$DSC_FILE
exit_code=$?
[[ $exit_code == 0 ]] || sendxmpppy "❌ Failed build for ${package}/${version} for arch=$arch ?!"
exit $exit_code