2003-06-03 20:28:21 +00:00
|
|
|
|
#!/bin/sh
|
|
|
|
|
#
|
2024-02-27 21:50:25 +00:00
|
|
|
|
# makesrcdist - make a source distribution of Mini-XML.
|
|
|
|
|
#
|
|
|
|
|
# https://www.msweet.org/mxml
|
|
|
|
|
#
|
|
|
|
|
# Copyright © 2003-2024 by Michael R Sweet.
|
|
|
|
|
#
|
|
|
|
|
# Licensed under Apache License v2.0. See the file "LICENSE" for more
|
|
|
|
|
# information.
|
2003-06-03 20:28:21 +00:00
|
|
|
|
#
|
|
|
|
|
|
2017-10-28 16:22:37 +00:00
|
|
|
|
if test $# != 1; then
|
|
|
|
|
echo "Usage: ./makesrcdist version"
|
|
|
|
|
exit 1
|
2003-06-03 20:28:21 +00:00
|
|
|
|
fi
|
|
|
|
|
|
2024-02-27 21:50:25 +00:00
|
|
|
|
|
|
|
|
|
# Check that various files are up-to-date...
|
2017-10-28 16:22:37 +00:00
|
|
|
|
version=$1
|
2003-06-03 20:28:21 +00:00
|
|
|
|
|
2024-02-27 21:50:25 +00:00
|
|
|
|
version_major=$(echo $version | awk -F. '{print $1}')
|
|
|
|
|
version_minor=$(echo $version | awk -F. '{print $2}')
|
|
|
|
|
|
|
|
|
|
status=0
|
|
|
|
|
|
|
|
|
|
if ! grep -q "Changes in Mini-XML $version" CHANGES.md; then
|
|
|
|
|
echo "Update CHANGES.md."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "$(grep AC_INIT configure.ac | awk '{print $2}')" != "[$version],"; then
|
|
|
|
|
echo "Update configure.ac."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "$(grep MXML_MAJOR_VERSION mxml.h | awk '{print $4}')" != "$version_major"; then
|
|
|
|
|
echo "Update MXML_MAJOR_VERSION in mxml.h."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "$(grep MXML_MINOR_VERSION mxml.h | awk '{print $4}')" != "$version_minor"; then
|
|
|
|
|
echo "Update MXML_MINOR_VERSION in mxml.h."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! grep -q "Version: $version" mxml.spec; then
|
|
|
|
|
echo "Update mxml.spec."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! grep -q "<version>$version</version>" vcnet/libmxml2_native.nuspec; then
|
|
|
|
|
echo "Update vcnet/libmxml2_native.nuspec."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
if ! grep -q "version=\"$version\" />" vcnet/libmxml2_native.nuspec; then
|
|
|
|
|
echo "Update vcnet/libmxml2_native.nuspec."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if ! grep -q "<version>$version</version>" vcnet/libmxml2_native.redist.nuspec; then
|
|
|
|
|
echo "Update vcnet/libmxml2_native.redist.nuspec."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test $status = 1; then
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Create tag and archives...
|
2017-10-28 16:22:37 +00:00
|
|
|
|
echo Creating tag for release...
|
|
|
|
|
git tag -m "Tag $version" v$version
|
|
|
|
|
git push origin v$version
|
2003-06-03 20:28:21 +00:00
|
|
|
|
|
2017-10-28 16:22:37 +00:00
|
|
|
|
echo Creating mxml-$version.tar.gz...
|
2019-01-17 15:12:08 +00:00
|
|
|
|
git archive --format tar --prefix=mxml-$version/ HEAD | gzip -v9 >mxml-$version.tar.gz
|
|
|
|
|
gpg --detach-sign mxml-$version.tar.gz
|
|
|
|
|
|
2021-11-06 14:12:49 +00:00
|
|
|
|
echo Creating mxml-$version.zip...
|
|
|
|
|
git archive --format zip --prefix=mxml-$version/ HEAD >mxml-$version.zip
|
|
|
|
|
gpg --detach-sign mxml-$version.zip
|