2017-08-29 17:17:25 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
codename=$1
|
|
|
|
package=$2
|
|
|
|
version=$3
|
|
|
|
arch=$4
|
|
|
|
|
2020-06-04 21:35:28 +02:00
|
|
|
sendxmpppy "⏳ Starting build for ${package}/${version} for arch=$arch ..."
|
2018-06-30 20:29:10 +02:00
|
|
|
|
2017-08-30 05:51:28 +02:00
|
|
|
source /home/vinaigrette/config/config
|
2017-08-31 00:35:22 +02:00
|
|
|
source /home/vinaigrette/scripts/package_helpers.sh
|
2017-08-29 17:17:25 +02:00
|
|
|
|
2020-05-11 03:33:27 +02:00
|
|
|
if [[ $arch == all ]]; then arch=$DEFAULT_ARCH; fi
|
2017-08-29 17:17:25 +02:00
|
|
|
|
|
|
|
if [[ $arch == $DEFAULT_ARCH ]]; then
|
|
|
|
# Build architecture independent packages too
|
|
|
|
DEBBUILDOPTS="-b"
|
2020-05-11 03:33:27 +02:00
|
|
|
else
|
|
|
|
# Build only binary-only limited to architecture dependent packages
|
|
|
|
DEBBUILDOPTS="-B"
|
2017-08-29 17:17:25 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Format needed pbuilder arguments
|
|
|
|
DSC_FILE="${package}_${version}.dsc"
|
2020-05-07 17:11:46 +02:00
|
|
|
BASE_TGZ="${PBUILDER_CHROOTS}/${codename}-${arch}.tgz"
|
2018-04-26 04:23:20 +02:00
|
|
|
|
2020-05-11 03:33:27 +02:00
|
|
|
echo "######################"
|
|
|
|
echo " Starting build ... "
|
|
|
|
echo "######################"
|
2018-04-23 19:24:59 +02:00
|
|
|
|
2020-05-11 03:33:27 +02:00
|
|
|
echo "Running 'pbuilder build --basetgz $BASE_TGZ --debbuildopts $DEBBUILDOPTS $DSC_FILE"
|
2020-02-12 18:57:41 +01:00
|
|
|
|
2020-05-11 03:33:27 +02:00
|
|
|
pbuilder build \
|
|
|
|
--basetgz "$BASE_TGZ" \
|
|
|
|
--architecture $arch \
|
|
|
|
--debbuildopts "$DEBBUILDOPTS" \
|
|
|
|
$DSC_FILE
|
2017-08-29 17:17:25 +02:00
|
|
|
|
2017-09-04 19:13:28 +02:00
|
|
|
exit_code=$?
|
2017-08-29 17:17:25 +02:00
|
|
|
|
2020-06-04 21:35:28 +02:00
|
|
|
[[ $exit_code == 0 ]] || sendxmpppy "❌ Failed build for ${package}/${version} for arch=$arch ?!"
|
2018-06-30 20:29:10 +02:00
|
|
|
|
2017-08-29 17:17:25 +02:00
|
|
|
exit $exit_code
|