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
|
|
|
|
|
|
2024-11-18 14:48:30 +00:00
|
|
|
|
if test "$(grep MXML_VERSION linux/config.h | awk '${print $5}')" != "v$version\""; then
|
|
|
|
|
echo "Update MXML_VERSION in linux/config.h."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if test "$(grep MXML_VERSION vcnet/config.h | awk '${print $5}')" != "v$version\""; then
|
|
|
|
|
echo "Update MXML_VERSION in vcnet/config.h."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
2024-03-20 16:14:01 +00:00
|
|
|
|
if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.nuspec; then
|
|
|
|
|
echo "Update vcnet/libmxml4_native.nuspec."
|
2024-02-27 21:50:25 +00:00
|
|
|
|
status=1
|
|
|
|
|
fi
|
2024-03-20 16:14:01 +00:00
|
|
|
|
if ! grep -q "version=\"$version\" />" vcnet/libmxml4_native.nuspec; then
|
|
|
|
|
echo "Update vcnet/libmxml4_native.nuspec."
|
2024-02-27 21:50:25 +00:00
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
2024-03-20 16:14:01 +00:00
|
|
|
|
if ! grep -q "<version>$version</version>" vcnet/libmxml4_native.redist.nuspec; then
|
|
|
|
|
echo "Update vcnet/libmxml4_native.redist.nuspec."
|
2024-02-27 21:50:25 +00:00
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
2024-11-18 14:48:30 +00:00
|
|
|
|
if test "$(grep MXML_VERSION xcode/config.h | awk '${print $5}')" != "v$version\""; then
|
|
|
|
|
echo "Update MXML_VERSION in xcode/config.h."
|
|
|
|
|
status=1
|
|
|
|
|
fi
|
|
|
|
|
|
2024-02-27 21:50:25 +00:00
|
|
|
|
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
|