diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-12-02 15:26:43 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-02 18:31:42 -0800 |
commit | eba18ff5e9096f09db54ef348c54e671a7094c72 (patch) | |
tree | db1d191e91144d1f5f419074581cac6060bc56c8 | |
parent | a1cd2306255a3a3bdcd47ffd11af884df7ed331c (diff) | |
download | subsurface-eba18ff5e9096f09db54ef348c54e671a7094c72.tar.gz |
Ubuntu packaging: get git version without including the full git tree
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | packaging/ubuntu/make-package.sh | 7 | ||||
-rw-r--r-- | subsurface-gen-version.pri | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/packaging/ubuntu/make-package.sh b/packaging/ubuntu/make-package.sh index 46f39cc9f..fa569d5ed 100644 --- a/packaging/ubuntu/make-package.sh +++ b/packaging/ubuntu/make-package.sh @@ -6,7 +6,8 @@ if [[ $(pwd | grep "subsurface$") || ! -d subsurface || ! -d subsurface/libdivec exit 1; fi -VERSION=$(cd subsurface ; git describe | sed -e 's/-g.*$// ; s/^v// ; s/-/./') +GITVERSION=$(cd subsurface ; git describe | sed -e 's/-g.*$// ; s/^v//') +VERSION=$(echo $GITVERSION | sed -e 's/-/./') echo "building Subsurface" $VERSION if [[ -d subsurface_$VERSION ]]; then rm -rf subsurface_$VERSION.bak.prev @@ -14,8 +15,10 @@ if [[ -d subsurface_$VERSION ]]; then mv subsurface_$VERSION subsurface_$VERSION.bak fi mkdir subsurface_$VERSION -(cd subsurface ; tar cf - . .git ) | (cd subsurface_$VERSION ; tar xf - ) +(cd subsurface ; tar cf - . ) | (cd subsurface_$VERSION ; tar xf - ) cd subsurface_$VERSION +echo $GITVERSION > .gitversion + dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION rm debian/*.ex debian/*.EX debian/README.* cp ../subsurface/packaging/ubuntu/control debian/control diff --git a/subsurface-gen-version.pri b/subsurface-gen-version.pri index 67bcdd761..23d86570a 100644 --- a/subsurface-gen-version.pri +++ b/subsurface-gen-version.pri @@ -22,7 +22,11 @@ exists(.git/HEAD): { QMAKE_EXTRA_COMPILERS += version_h } else { # This is probably a package - FULL_VERSION = $$VERSION - system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$VERSION\\\" > $$VERSION_FILE) + exists(.gitversion): { + FULL_VERSION = $$system("cat .gitversion") + } else { + FULL_VERSION = $$VERSION + } + system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$FULL_VERSION\\\" > $$VERSION_FILE) QMAKE_CLEAN += $$VERSION_FILE } |