mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 02:53:24 +00:00
build-system: simplify and clean up OBS make-package script
The previous version wasn't quite ready for prime time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2f8c968ff9
commit
195d43d186
1 changed files with 13 additions and 17 deletions
|
@ -26,10 +26,12 @@ VERSION=$(echo $GITVERSION | sed -e 's/-/./')
|
||||||
GITDATE=$(cd subsurface ; git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d)
|
GITDATE=$(cd subsurface ; git log -1 --format="%at" | xargs -I{} date -d @{} +%Y-%m-%d)
|
||||||
LIBDCREVISION=$(cd subsurface/libdivecomputer ; git rev-parse --verify HEAD)
|
LIBDCREVISION=$(cd subsurface/libdivecomputer ; git rev-parse --verify HEAD)
|
||||||
|
|
||||||
if [[ "$GITVERSION" = "" ]] ; then
|
if [[ "$GITREVISION" = "" ]] ; then
|
||||||
SUFFIX=".release"
|
SUFFIX=".release"
|
||||||
|
FOLDER="subsurface-$VERSION"
|
||||||
else
|
else
|
||||||
SUFFIX=".daily"
|
SUFFIX=".daily"
|
||||||
|
FOLDER="subsurfacedaily-$VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "building Subsurface" $VERSION "with libdivecomputer" $LIBDCREVISION
|
echo "building Subsurface" $VERSION "with libdivecomputer" $LIBDCREVISION
|
||||||
|
@ -38,20 +40,12 @@ echo "building Subsurface" $VERSION "with libdivecomputer" $LIBDCREVISION
|
||||||
mkdir -p distrobuilds
|
mkdir -p distrobuilds
|
||||||
cd distrobuilds
|
cd distrobuilds
|
||||||
|
|
||||||
if [[ ! -d subsurface_$VERSION ]]; then
|
if [[ ! -d $FOLDER ]]; then
|
||||||
mkdir subsurface_$VERSION
|
mkdir $FOLDER
|
||||||
if [[ "$GITREVISION" != "" ]] ; then
|
|
||||||
rm -f subsurfacedaily-$VERSION
|
|
||||||
ln -s subsurface_$VERSION subsurfacedaily-$VERSION
|
|
||||||
else
|
|
||||||
rm -f subsurface-$VERSION
|
|
||||||
ln -s subsurface_$VERSION subsurface-$VERSION
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "copying sources"
|
echo "copying sources"
|
||||||
|
|
||||||
(cd ../subsurface ; tar cf - . ) | (cd subsurface_$VERSION ; tar xf - )
|
(cd ../subsurface ; tar cf - . ) | (cd $FOLDER ; tar xf - )
|
||||||
cd subsurface_$VERSION;
|
cd $FOLDER
|
||||||
cp -a ../../googlemaps .
|
cp -a ../../googlemaps .
|
||||||
|
|
||||||
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
|
||||||
|
@ -60,27 +54,29 @@ if [[ ! -d subsurface_$VERSION ]]; then
|
||||||
echo $LIBDCREVISION > libdivecomputer/revision
|
echo $LIBDCREVISION > libdivecomputer/revision
|
||||||
|
|
||||||
if [[ "$GITREVISION" != "" ]] ; then
|
if [[ "$GITREVISION" != "" ]] ; then
|
||||||
(cd .. ; tar ch subsurfacedaily-$VERSION | xz > home:Subsurface-Divelog/Subsurface-daily/subsurface-$VERSION.orig.tar.xz) &
|
(cd .. ; tar ch $FOLDER | xz > home:Subsurface-Divelog/Subsurface-daily/subsurface-$VERSION.orig.tar.xz) &
|
||||||
else
|
else
|
||||||
(cd .. ; tar ch subsurface-$VERSION | xz > home:Subsurface-Divelog/Subsurface/subsurface-$VERSION.orig.tar.xz) &
|
(cd .. ; tar ch $FOLDER | xz > home:Subsurface-Divelog/Subsurface/subsurface-$VERSION.orig.tar.xz) &
|
||||||
fi
|
fi
|
||||||
|
cd ..
|
||||||
else
|
else
|
||||||
echo "using existing source tree"
|
echo "using existing source tree"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# if the user wanted to post this automatically, do so
|
||||||
if [[ "$1" = "post" ]] ; then
|
if [[ "$1" = "post" ]] ; then
|
||||||
# daily vs. release
|
# daily vs. release
|
||||||
if [[ "$GITREVISION" == "" ]] ; then
|
if [[ "$GITREVISION" == "" ]] ; then
|
||||||
# this is a release
|
# this is a release
|
||||||
cd home:Subsurface-Divelog/Subsurface
|
cd home:Subsurface-Divelog/Subsurface
|
||||||
osc rm $(ls subsurface*.tar.xz | grep -v $VERSION)
|
ls subsurface*.tar.xz | grep -v $VERSION 2>/dev/null && osc rm $(ls subsurface*.tar.xz | grep -v $VERSION)
|
||||||
osc add subsurface-$VERSION.orig.tar.xz
|
osc add subsurface-$VERSION.orig.tar.xz
|
||||||
sed -i "s/%define latestVersion.*/%define latestVersion $VERSION/" subsurface.spec
|
sed -i "s/%define latestVersion.*/%define latestVersion $VERSION/" subsurface.spec
|
||||||
sed -i "s/%define gitVersion .*/%define gitVersion 0/" subsurface.spec
|
sed -i "s/%define gitVersion .*/%define gitVersion 0/" subsurface.spec
|
||||||
osc commit -m "next release build"
|
osc commit -m "next release build"
|
||||||
else
|
else
|
||||||
cd home:Subsurface-Divelog/Subsurface-daily
|
cd home:Subsurface-Divelog/Subsurface-daily
|
||||||
osc rm $(ls subsurface*.tar.xz | grep -v $VERSION)
|
ls subsurface*.tar.xz | grep -v $VERSION 2>/dev/null && osc rm $(ls subsurface*.tar.xz | grep -v $VERSION)
|
||||||
osc add subsurface-$VERSION.orig.tar.xz
|
osc add subsurface-$VERSION.orig.tar.xz
|
||||||
sed -i "s/%define latestVersion.*/%define latestVersion $VERSION/" subsurfacedaily.spec
|
sed -i "s/%define latestVersion.*/%define latestVersion $VERSION/" subsurfacedaily.spec
|
||||||
sed -i "s/%define gitVersion .*/%define gitVersion $GITREVISION/" subsurfacedaily.spec
|
sed -i "s/%define gitVersion .*/%define gitVersion $GITREVISION/" subsurfacedaily.spec
|
||||||
|
|
Loading…
Add table
Reference in a new issue