Add VERSION in the tarball

This commit is contained in:
angt
2016-01-01 12:32:20 +01:00
parent 8982f27220
commit 8fa2322314
2 changed files with 11 additions and 8 deletions

View File

@@ -20,5 +20,6 @@ glorytun_SOURCES = \
EXTRA_DIST = \
LICENSE \
README.md \
VERSION \
autogen.sh \
version.sh

View File

@@ -3,9 +3,11 @@
[ -z "${VERSION}" ] && VERSION=`git describe --tags --always 2>/dev/null` \
&& VERSION=${VERSION#v}
[ -z "${VERSION}" ] && VERSION=`basename \`pwd\`` \
&& VERSION=${VERSION#*-}
[ -z "${VERSION}" ] && VERSION=`cat VERSION 2>/dev/null`
[ "$1" = "major" ] && VERSION=${VERSION%%.*}
[ -z "${VERSION}" ] && VERSION=0.0.0
printf ${VERSION}
[ "$1" = "major" ] && printf ${VERSION%%.*} \
&& exit 0
printf ${VERSION} | tee VERSION