iperf3-tls/make_release

70 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

2010-07-23 23:50:02 +00:00
#!/bin/sh
proj="iperf"
if [ "x$2" != "x" ]; then
tag=$2
else
2013-03-28 17:09:34 +00:00
tag=`awk '/IPERF_VERSION / {
2010-07-23 23:50:02 +00:00
gsub(/"/, "", $3);
print $3 }' src/version.h`
fi
2010-07-23 23:50:02 +00:00
2021-09-03 13:48:55 +00:00
dirname=`echo "$tag $proj" | awk '{
2010-07-23 23:50:02 +00:00
gsub(/-ALPHA/, "a", $1);
gsub(/-BETA/, "b", $1);
gsub(/-RELEASE/, "", $1);
print $2"-"$1 }'`
echo tag $tag
echo dirname $dirname
2010-07-23 23:50:02 +00:00
do_tag ()
{
2021-09-03 13:48:55 +00:00
git tag -s -m "tagging $tag" "$tag"
2010-07-23 23:50:02 +00:00
}
do_tar ()
{
2013-03-28 17:51:08 +00:00
tarball=${dirname}.tar.gz
2021-09-03 13:48:55 +00:00
rm -f "${tarball}"
git archive --format=tar --prefix "${dirname}/" "${tag}" | gzip -9 > "${tarball}"
# Compute SHA256 hash
case `uname -s` in
FreeBSD) sha=sha256 ;;
Linux) sha=sha256sum ;;
Darwin) sha="shasum -a 256" ;;
*) sha=echo ;;
esac
2021-09-03 13:48:55 +00:00
${sha} "${tarball}" | tee "${tarball}.sha256"
2013-03-28 17:51:08 +00:00
}
usage ()
{
cat <<EOF
$0: tag|tar
tag -- create a tag
tar -- create a tarball from a tag
2013-03-28 17:51:08 +00:00
General use is to do:
./$0 tag
./$0 tar
An optional argument may be specified to both the tag and tar
subcommands to explicitly specify a tag string. If not specified, the
contents of src/version.h are used.
2013-03-28 17:51:08 +00:00
EOF
2010-07-23 23:50:02 +00:00
}
case $1 in
tag) do_tag ;;
tar) do_tar ;;
2013-03-28 17:51:08 +00:00
*) echo "unknown command: $1"; usage ;;
2010-07-23 23:50:02 +00:00
esac
exit