From ead8998668cf5c8465a0229deda1bff4bbe4a3db Mon Sep 17 00:00:00 2001 From: Chris Cannam Date: Fri, 12 Mar 2021 10:37:42 +0000 Subject: [PATCH] Source package build script --- otherbuilds/deploy/source.sh | 59 ++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 otherbuilds/deploy/source.sh diff --git a/otherbuilds/deploy/source.sh b/otherbuilds/deploy/source.sh new file mode 100755 index 0000000..c2ccf48 --- /dev/null +++ b/otherbuilds/deploy/source.sh @@ -0,0 +1,59 @@ +#!/bin/bash +set -eu +version=$(grep '^ *version:' meson.build | head -1 | sed "s/^.*'\([0-9][0-9.]*\)'.*$/\1/") +check() { + text="$1" + echo -n "$text [yN] " + read yn + case "$yn" in [Yy]) ;; *) echo "Exiting"; exit 3 ;; esac +} +echo +echo "Preparing to make source package for Rubber Band v$version..." +echo +grep '^ *version:' meson.build | head -1 +check "Is the above version number (in meson.build) correct?" +echo +echo "The dynamic library version should have a point increment for each" +echo "release, a minor increment for backward-compatible ABI changes, and" +echo "a major increment for incompatible ABI changes." +echo +grep 'rubberband_dynamic_library_version' meson.build | head -1 +check "Is the above library version (from meson.build) correct?" +echo +echo "The API major version should increment for incompatible API changes," +echo "and the minor version should increment for backward-compatible API" +echo "changes." +echo +grep 'RUBBERBAND.*VERSION' rubberband/RubberBandStretcher.h +check "Are the above version and API versions (from the C++ header) correct?" +echo +echo "The C header should contain the same versions as the C++ header." +echo +grep 'RUBBERBAND.*VERSION' rubberband/rubberband-c.h +check "Are the above version and API versions (from the C header) correct?" +echo +grep '^PROJECT_NUMBER' Doxyfile +check "Is the above version (from Doxyfile) correct?" + +echo +echo "Going ahead..." +mkdir -p packages +output="packages/rubberband-$version.tar.bz2" +hg archive "$output" + +echo "Checking that the package compiles..." +tmpdir=$(mktemp -d) +cleanup() { + rm -rf "$tmpdir" +} +trap cleanup 0 +prevdir=$(pwd) +( cd "$tmpdir" + tar xvf "$prevdir/$output" + cd "rubberband-$version" + meson build + ninja -C build +) + +echo +echo "Checked, package is in $output"