2020-08-26 11:04:58 -04:00
|
|
|
#!/bin/sh
|
|
|
|
set -o xtrace
|
|
|
|
exec 3>&1
|
|
|
|
exec 1>&2
|
|
|
|
# Ensure we're up to date
|
|
|
|
git pull --rebase
|
|
|
|
# Update the version to a sensible git revision for easy visualization
|
|
|
|
base_ver="$( head -1 debian/changelog | awk -F'[()-]' '{ print $2 }' )"
|
|
|
|
new_ver="${base_ver}~git-$(git rev-parse --short HEAD)"
|
|
|
|
echo ${new_ver} >&3
|
|
|
|
# Back up the existing changelog and Daemon.py files
|
|
|
|
tmpdir=$( mktemp -d )
|
2021-07-02 01:50:25 -04:00
|
|
|
cp -a debian/changelog client-cli/setup.py ${tmpdir}/
|
|
|
|
cp -a node-daemon/pvcnoded/Daemon.py ${tmpdir}/node-Daemon.py
|
|
|
|
cp -a api-daemon/pvcapid/Daemon.py ${tmpdir}/api-Daemon.py
|
2020-08-26 11:04:58 -04:00
|
|
|
# Replace the "base" version with the git revision version
|
2021-07-01 17:35:11 -04:00
|
|
|
sed -i "s/version = '${base_ver}'/version = '${new_ver}'/" node-daemon/pvcnoded/Daemon.py api-daemon/pvcapid/Daemon.py client-cli/setup.py
|
2020-08-26 11:04:58 -04:00
|
|
|
sed -i "s/${base_ver}-0/${new_ver}/" debian/changelog
|
|
|
|
cat <<EOF > debian/changelog
|
|
|
|
pvc (${new_ver}) unstable; urgency=medium
|
|
|
|
|
|
|
|
* Unstable revision for commit $(git rev-parse --short HEAD)
|
|
|
|
|
|
|
|
-- Joshua Boniface <joshua@boniface.me> $( date -R )
|
|
|
|
EOF
|
|
|
|
# Build source tarball
|
|
|
|
dh_make -p pvc_${new_ver} --createorig --single --yes
|
|
|
|
# Build packages
|
|
|
|
dpkg-buildpackage -us -uc
|
|
|
|
# Restore original changelog and Daemon.py files
|
|
|
|
cp -a ${tmpdir}/changelog debian/changelog
|
2021-07-02 01:50:25 -04:00
|
|
|
cp -a ${tmpdir}/setup.py client-cli/setup.py
|
|
|
|
cp -a ${tmpdir}/node-Daemon.py node-daemon/pvcnoded/Daemon.py
|
|
|
|
cp -a ${tmpdir}/api-Daemon.py api-daemon/pvcapid/Daemon.py
|
|
|
|
|
2020-08-26 11:04:58 -04:00
|
|
|
# Clean up
|
|
|
|
rm -r ${tmpdir}
|
|
|
|
dh_clean
|