mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
adjust Copr package make script to new version logic
Also address some shellcheck issues. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
de8dc87ecf
commit
5075e7f127
1 changed files with 23 additions and 20 deletions
|
@ -25,41 +25,43 @@ TOPDIR=$(pwd)
|
||||||
cd subsurface
|
cd subsurface
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update
|
git submodule update
|
||||||
|
|
||||||
|
GITVERSION=$(bash scripts/get-version 4)
|
||||||
|
GITDATE=$(git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d)
|
||||||
|
LIBDCREVISION=$(cd libdivecomputer ; git rev-parse --verify HEAD)
|
||||||
|
FOLDER="subsurface-$GITVERSION"
|
||||||
|
|
||||||
|
# hardcode to 1 to mark that this is a test build, not a full release
|
||||||
|
GITREVISION=1
|
||||||
|
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
GITVERSION=$(cd subsurface ; git describe --match "v[0-9]*" --abbrev=12 | sed -e 's/-g.*$// ; s/^v//')
|
echo "building Subsurface $GITVERSION with libdivecomputer $LIBDCREVISION"
|
||||||
GITREVISION=$(echo $GITVERSION | sed -e 's/.*-// ; s/.*\..*//')
|
|
||||||
VERSION=$(echo $GITVERSION | sed -e 's/-/./')
|
|
||||||
GITDATE=$(cd subsurface ; git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d)
|
|
||||||
LIBDCREVISION=$(cd subsurface/libdivecomputer ; git rev-parse --verify HEAD)
|
|
||||||
FOLDER="subsurface-$VERSION"
|
|
||||||
|
|
||||||
echo "building Subsurface" $VERSION "with libdivecomputer" $LIBDCREVISION
|
|
||||||
|
|
||||||
# create the file system structure that the rpmbuild tools expect
|
# create the file system structure that the rpmbuild tools expect
|
||||||
rpmdev-setuptree
|
rpmdev-setuptree
|
||||||
|
|
||||||
# in order for the tools to work as expected, let's run this from the HOME directory
|
# in order for the tools to work as expected, let's run this from the HOME directory
|
||||||
cd $HOME
|
cd "$HOME"
|
||||||
|
|
||||||
if [[ ! -d $FOLDER ]]; then
|
if [[ ! -d $FOLDER ]]; then
|
||||||
mkdir $FOLDER
|
mkdir "$FOLDER"
|
||||||
echo "copying sources"
|
echo "copying sources"
|
||||||
|
|
||||||
(cd "$TOPDIR"/subsurface ; tar cf - . ) | (cd $FOLDER ; tar xf - )
|
(cd "$TOPDIR"/subsurface ; tar cf - . ) | (cd "$FOLDER" ; tar xf - )
|
||||||
cd $FOLDER
|
cd "$FOLDER"
|
||||||
cp -a "$TOPDIR"/googlemaps .
|
cp -a "$TOPDIR"/googlemaps .
|
||||||
|
|
||||||
# make sure we only have the files we want (the builds should all be empty when running on GitHub)
|
# make sure we only have the files we want (the builds should all be empty when running on GitHub)
|
||||||
rm -rf .git libdivecomputer/.git googlemaps/.git build build-mobile libdivecomputer/build googlemaps/build
|
rm -rf .git libdivecomputer/.git googlemaps/.git build build-mobile libdivecomputer/build googlemaps/build
|
||||||
echo $GITVERSION > .gitversion
|
echo "$GITVERSION" > .gitversion
|
||||||
echo $GITDATE > .gitdate
|
echo "$GITDATE" > .gitdate
|
||||||
echo $LIBDCREVISION > libdivecomputer/revision
|
echo "$LIBDCREVISION" > libdivecomputer/revision
|
||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f rpmbuild/SOURCES/subsurface-$VERSION.orig.tar.xz ]] ; then
|
if [[ ! -f rpmbuild/SOURCES/subsurface-$GITVERSION.orig.tar.xz ]] ; then
|
||||||
tar ch $FOLDER | xz > rpmbuild/SOURCES/subsurface-$VERSION.orig.tar.xz
|
tar ch "$FOLDER" | xz > "rpmbuild/SOURCES/subsurface-$GITVERSION.orig.tar.xz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if the user wanted to post this automatically, do so
|
# if the user wanted to post this automatically, do so
|
||||||
|
@ -82,7 +84,8 @@ if [[ "$1" = "post" ]] ; then
|
||||||
DESCRIPTION="This is a 'daily' build of Subsurface, provided by the Subsurface team, based on the latest sources. The builds aren't always well tested."
|
DESCRIPTION="This is a 'daily' build of Subsurface, provided by the Subsurface team, based on the latest sources. The builds aren't always well tested."
|
||||||
fi
|
fi
|
||||||
cd "$HOME"/rpmbuild
|
cd "$HOME"/rpmbuild
|
||||||
cat "$TOPDIR"/subsurface/packaging/copr/subsurface.spec | sed "s/%define latestVersion.*/%define latestVersion $VERSION/;s/DESCRIPTION/$DESCRIPTION/;s/SUMMARY/$SUMMARY/" > SPECS/subsurface.spec
|
# shellcheck disable=SC2002
|
||||||
rpmbuild --verbose -bs $(pwd)/SPECS/subsurface.spec
|
cat "$TOPDIR"/subsurface/packaging/copr/subsurface.spec | sed "s/%define latestVersion.*/%define latestVersion $GITVERSION/;s/DESCRIPTION/$DESCRIPTION/;s/SUMMARY/$SUMMARY/" > SPECS/subsurface.spec
|
||||||
copr build --nowait $REPO $(pwd)/SRPMS/subsurface-$VERSION-1.fc*.src.rpm
|
rpmbuild --verbose -bs "$(pwd)/SPECS/subsurface.spec"
|
||||||
|
copr build --nowait $REPO "$(pwd)/SRPMS/subsurface-$GITVERSION-1.fc*.src.rpm"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue