2024-09-13 21:36:26 +02:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
. ./pika-build-config.sh
|
|
|
|
|
|
|
|
echo "$PIKA_BUILD_ARCH" > pika-build-arch
|
|
|
|
|
2024-11-13 19:46:29 +01:00
|
|
|
VERSION="0.16"
|
2024-09-13 21:36:26 +02:00
|
|
|
|
|
|
|
# Clone Upstream
|
2024-09-13 22:36:05 +02:00
|
|
|
UPSTREAM_NAME="sbctl"
|
|
|
|
|
|
|
|
# Checkout and munch
|
2024-11-13 20:09:01 +01:00
|
|
|
git clone https://github.com/Foxboron/sbctl.git "${UPSTREAM_NAME}" -b "${VERSION}"
|
2024-09-13 22:36:05 +02:00
|
|
|
cp -rvf ./debian ./${UPSTREAM_NAME}/
|
|
|
|
|
|
|
|
# easier than figuring out the right way to override the prefix in the makefile
|
|
|
|
sed -i "s/usr\/local/usr/" "${UPSTREAM_NAME}/Makefile"
|
2024-09-14 00:53:18 +02:00
|
|
|
sed -i "s/\$(PREFIX)\/bin/\$(PREFIX)\/sbin/" "${UPSTREAM_NAME}/Makefile"
|
2024-09-13 22:36:05 +02:00
|
|
|
|
|
|
|
# Get in there.
|
|
|
|
pushd "./${UPSTREAM_NAME}/" || exit 1
|
2024-09-13 21:36:26 +02:00
|
|
|
|
2024-11-13 20:09:01 +01:00
|
|
|
# Clever way to auto-add a .0 if the upstream version is not semver
|
|
|
|
VER_PER_COUNT="${VERSION//[^\.]}"
|
|
|
|
if (( ${#VER_PER_COUNT} < 2 )); then
|
|
|
|
TRUE_VERSION="${VERSION}.0"
|
|
|
|
else
|
|
|
|
TRUE_VERSION="${VERSION}"
|
|
|
|
fi
|
|
|
|
|
2024-09-13 21:36:26 +02:00
|
|
|
# Get build deps
|
2024-11-13 20:15:47 +01:00
|
|
|
LOGNAME=root dh_make --createorig -y -l -p "${UPSTREAM_NAME}_$TRUE_VERSION" || echo "dh-make: Ignoring Last Error"
|
2024-09-13 21:36:26 +02:00
|
|
|
apt-get build-dep ./ -y
|
|
|
|
|
|
|
|
# Build package
|
|
|
|
dpkg-buildpackage --no-sign
|
|
|
|
|
2024-09-13 22:36:05 +02:00
|
|
|
popd || exit 2
|
|
|
|
|
2024-09-13 21:36:26 +02:00
|
|
|
# Move the debs to output
|
|
|
|
mkdir -p ./output
|
|
|
|
mv ./*.deb ./output/
|