mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Ubuntu packaging: get git version without including the full git tree
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a1cd230625
commit
eba18ff5e9
2 changed files with 11 additions and 4 deletions
|
@ -6,7 +6,8 @@ if [[ $(pwd | grep "subsurface$") || ! -d subsurface || ! -d subsurface/libdivec
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
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
|
echo "building Subsurface" $VERSION
|
||||||
if [[ -d subsurface_$VERSION ]]; then
|
if [[ -d subsurface_$VERSION ]]; then
|
||||||
rm -rf subsurface_$VERSION.bak.prev
|
rm -rf subsurface_$VERSION.bak.prev
|
||||||
|
@ -14,8 +15,10 @@ if [[ -d subsurface_$VERSION ]]; then
|
||||||
mv subsurface_$VERSION subsurface_$VERSION.bak
|
mv subsurface_$VERSION subsurface_$VERSION.bak
|
||||||
fi
|
fi
|
||||||
mkdir subsurface_$VERSION
|
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
|
cd subsurface_$VERSION
|
||||||
|
echo $GITVERSION > .gitversion
|
||||||
|
|
||||||
dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION
|
dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION
|
||||||
rm debian/*.ex debian/*.EX debian/README.*
|
rm debian/*.ex debian/*.EX debian/README.*
|
||||||
cp ../subsurface/packaging/ubuntu/control debian/control
|
cp ../subsurface/packaging/ubuntu/control debian/control
|
||||||
|
|
|
@ -22,7 +22,11 @@ exists(.git/HEAD): {
|
||||||
QMAKE_EXTRA_COMPILERS += version_h
|
QMAKE_EXTRA_COMPILERS += version_h
|
||||||
} else {
|
} else {
|
||||||
# This is probably a package
|
# This is probably a package
|
||||||
|
exists(.gitversion): {
|
||||||
|
FULL_VERSION = $$system("cat .gitversion")
|
||||||
|
} else {
|
||||||
FULL_VERSION = $$VERSION
|
FULL_VERSION = $$VERSION
|
||||||
system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$VERSION\\\" > $$VERSION_FILE)
|
}
|
||||||
|
system(echo \\$${LITERAL_HASH}define VERSION_STRING \\\"$$FULL_VERSION\\\" > $$VERSION_FILE)
|
||||||
QMAKE_CLEAN += $$VERSION_FILE
|
QMAKE_CLEAN += $$VERSION_FILE
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue