pdfio/makesrcdist

67 lines
1.7 KiB
Plaintext
Raw Permalink Normal View History

2021-08-30 22:31:00 +02:00
#!/bin/sh
#
# makesrcdist - make a source distribution of pdfio.
#
# Usage:
#
# ./makesrcdist [--snapshot] VERSION
#
# Support "--snapshot" option...
if test "$1" == "--snapshot"; then
shift
snapshot=1
else
snapshot=0
fi
2021-08-30 22:31:00 +02:00
# Get version...
2021-08-30 22:31:00 +02:00
if test $# != 1; then
echo "Usage: ./makesrcdist [--snapshot] VERSION"
exit 1
2021-08-30 22:31:00 +02:00
fi
version=$1
# Check that version number has been updated everywhere...
if test $(grep AC_INIT configure.ac | awk '{print $2}') != "[$version],"; then
echo "Still need to update AC_INIT version in 'configure.ac'."
exit 1
fi
if test $(grep PDFIO_VERSION= configure | awk -F \" '{print $2}') != "$version"; then
echo "Still need to run 'autoconf -f'."
exit 1
fi
if test $(grep '<version>' pdfio_native.nuspec | sed -E -e '1,$s/^.*<version>([0-9.]+).*$/\1/') != "$version"; then
echo "Still need to update version in 'pdfio_native.nuspec'."
exit 1
fi
if test $(grep '<version>' pdfio_native.redist.nuspec | sed -E -e '1,$s/^.*<version>([0-9.]+).*$/\1/') != "$version"; then
echo "Still need to update version in 'pdfio_native.redist.nuspec'."
exit 1
fi
if test $(grep PDFIO_VERSION pdfio.h | awk -F \" '{print $2}') != "$version"; then
echo "Still need to update PDFIO_VERSION in 'pdfio.h'."
exit 1
fi
# Tag release...
if test $snapshot = 0; then
echo Creating tag for release...
git tag -m "Tag $version" v$version
git push origin v$version
fi
2021-08-30 22:31:00 +02:00
# Make source archives...
2021-08-30 22:31:00 +02:00
echo Creating pdfio-$version.tar.gz...
git archive --format tar --prefix=pdfio-$version/ HEAD | gzip -v9 >pdfio-$version.tar.gz
gpg --detach-sign pdfio-$version.tar.gz
2021-08-30 22:44:48 +02:00
echo Creating pdfio-$version.zip...
git archive --format zip --prefix=pdfio-$version/ HEAD >pdfio-$version.zip
gpg --detach-sign pdfio-$version.zip