Clever way to fix version string, and checkout upstream at intended version

This commit is contained in:
R L 2024-11-13 11:09:01 -08:00
parent dcca463d51
commit d986554833
Signed by: cybik
GPG Key ID: A6DD1646CC69863E
3 changed files with 16 additions and 2 deletions

View File

@ -1 +1 @@
22 23

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
sbctl (0.16.0-101pika2) pika; urgency=low
* Build proper version sources
-- cybik <root@cybik.moe> Wed, 13 Nov 2024 11:15:00 -0800
sbctl (0.16.0-101pika1) pika; urgency=low sbctl (0.16.0-101pika1) pika; urgency=low
* Upstream release * Upstream release

10
main.sh
View File

@ -12,7 +12,7 @@ VERSION="0.16"
UPSTREAM_NAME="sbctl" UPSTREAM_NAME="sbctl"
# Checkout and munch # Checkout and munch
git clone https://github.com/Foxboron/sbctl.git "${UPSTREAM_NAME}" git clone https://github.com/Foxboron/sbctl.git "${UPSTREAM_NAME}" -b "${VERSION}"
cp -rvf ./debian ./${UPSTREAM_NAME}/ cp -rvf ./debian ./${UPSTREAM_NAME}/
# easier than figuring out the right way to override the prefix in the makefile # easier than figuring out the right way to override the prefix in the makefile
@ -22,6 +22,14 @@ sed -i "s/\$(PREFIX)\/bin/\$(PREFIX)\/sbin/" "${UPSTREAM_NAME}/Makefile"
# Get in there. # Get in there.
pushd "./${UPSTREAM_NAME}/" || exit 1 pushd "./${UPSTREAM_NAME}/" || exit 1
# 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
# Get build deps # Get build deps
LOGNAME=root dh_make --createorig -y -l -p ${UPSTREAM_NAME}_"$VERSION".0 || echo "dh-make: Ignoring Last Error" LOGNAME=root dh_make --createorig -y -l -p ${UPSTREAM_NAME}_"$VERSION".0 || echo "dh-make: Ignoring Last Error"
apt-get build-dep ./ -y apt-get build-dep ./ -y