2014-12-02 00:00:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# start from the directory above the combined subsurface & subsurface/libdivecomputer directory
|
2014-12-02 19:04:37 +00:00
|
|
|
if [[ $(pwd | grep "subsurface$") || ! -d subsurface || ! -d subsurface/libdivecomputer || ! -d subsurface/libgit2 ]] ; then
|
|
|
|
echo "Please start this script from the folder ABOVE the subsurface source directory"
|
|
|
|
echo "which includes libdivecomputer and libgit2 as subdirectories)."
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2014-12-02 23:26:43 +00:00
|
|
|
GITVERSION=$(cd subsurface ; git describe | sed -e 's/-g.*$// ; s/^v//')
|
2014-12-23 04:26:09 +00:00
|
|
|
GITREVISION=$(echo $GITVERSION | sed -e 's/.*-// ; s/.*\..*//')
|
2014-12-02 23:26:43 +00:00
|
|
|
VERSION=$(echo $GITVERSION | sed -e 's/-/./')
|
2014-12-12 18:58:20 +00:00
|
|
|
LIBDCREVISION=$(cd subsurface/libdivecomputer ; git rev-parse --verify HEAD)
|
2014-12-23 04:26:09 +00:00
|
|
|
|
2014-12-15 16:24:51 +00:00
|
|
|
#
|
|
|
|
#
|
2014-12-12 18:58:20 +00:00
|
|
|
echo "building Subsurface" $VERSION "with libdivecomputer" $LIBDCREVISION
|
2014-12-15 16:24:51 +00:00
|
|
|
#
|
2014-12-02 18:55:52 +00:00
|
|
|
if [[ -d subsurface_$VERSION ]]; then
|
|
|
|
rm -rf subsurface_$VERSION.bak.prev
|
|
|
|
mv subsurface_$VERSION.bak subsurface_$VERSION.bak.prev
|
|
|
|
mv subsurface_$VERSION subsurface_$VERSION.bak
|
2014-12-02 00:00:47 +00:00
|
|
|
fi
|
2014-12-23 04:26:09 +00:00
|
|
|
rm -f subsurface-$VERSION
|
|
|
|
|
2014-12-02 18:55:52 +00:00
|
|
|
mkdir subsurface_$VERSION
|
2014-12-31 17:19:06 +00:00
|
|
|
ln -s subsurface_$VERSION subsurfacedaily-$VERSION
|
2014-12-15 16:24:51 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
echo "copying sources"
|
|
|
|
#
|
2014-12-02 23:26:43 +00:00
|
|
|
(cd subsurface ; tar cf - . ) | (cd subsurface_$VERSION ; tar xf - )
|
2014-12-02 18:55:52 +00:00
|
|
|
cd subsurface_$VERSION
|
2014-12-10 20:39:27 +00:00
|
|
|
rm -rf .git libdivecomputer/.git libgit2/.git marble-source/.git
|
2014-12-02 23:26:43 +00:00
|
|
|
echo $GITVERSION > .gitversion
|
2014-12-12 18:58:20 +00:00
|
|
|
echo $LIBDCREVISION > libdivecomputer/revision
|
2014-12-15 16:24:51 +00:00
|
|
|
# dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION
|
|
|
|
# rm debian/*.ex debian/*.EX debian/README.*
|
|
|
|
#
|
|
|
|
#
|
2014-12-23 04:26:09 +00:00
|
|
|
echo "creating source tar file for OBS and Ununtu PPA"
|
2014-12-15 16:24:51 +00:00
|
|
|
#
|
2014-12-31 17:19:06 +00:00
|
|
|
(cd .. ; tar ch subsurfacedaily-$VERSION | xz > home:Subsurface-Divelog/Subsurface-daily/subsurfacedaily-$VERSION.orig.tar.xz) &
|
2014-12-15 16:24:51 +00:00
|
|
|
tar cf - . | xz > ../subsurface_$VERSION.orig.tar.xz
|
|
|
|
#
|
|
|
|
#
|
|
|
|
echo "preparint the debian directory"
|
|
|
|
#
|
|
|
|
export DEBEMAIL=dirk@hohndel.org
|
|
|
|
mkdir -p debian
|
|
|
|
cp -a packaging/ubuntu/debian .
|
|
|
|
cp ../debian.changelog debian/changelog
|
2014-12-02 00:00:47 +00:00
|
|
|
# do something clever with changelog
|
2014-12-15 16:24:51 +00:00
|
|
|
#mv debian/changelog debian/autocl
|
|
|
|
#head -1 debian/autocl | sed -e 's/)/~trusty)/' -e 's/unstable/trusty/' > debian/changelog
|
|
|
|
#cat ../subsurface/packaging/ubuntu/debian/changelog >> debian/changelog
|
|
|
|
#tail -1 debian/autocl >> debian/changelog
|
|
|
|
#rm -f debian/autocl
|
|
|
|
|
2014-12-23 04:26:09 +00:00
|
|
|
dch -v $VERSION-1~trusty -D trusty -M -m "next daily build"
|
2014-12-15 16:24:51 +00:00
|
|
|
mv ~/src/debian.changelog ~/src/debian.changelog.previous
|
|
|
|
cp debian/changelog ~/src/debian.changelog
|
2014-12-02 00:00:47 +00:00
|
|
|
|
|
|
|
debuild -S
|
|
|
|
|
2014-12-10 16:45:53 +00:00
|
|
|
# and now for utopic (precise can't build Qt5 based packages)
|
2014-12-03 19:58:36 +00:00
|
|
|
prev=trusty
|
2014-12-10 16:45:53 +00:00
|
|
|
rel=utopic
|
|
|
|
sed -i "s/${prev}/${rel}/g" debian/changelog
|
|
|
|
debuild -S
|
2014-12-23 04:26:09 +00:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
if [[ "$1x" = "postx" ]] ; then
|
|
|
|
dput ppa:subsurface/subsurface-daily subsurface_$VERSION*.changes
|
|
|
|
cd home:Subsurface-Divelog/Subsurface-daily
|
|
|
|
osc rm $(ls subsurface*.tar.xz | grep -v $VERSION)
|
2014-12-31 17:19:06 +00:00
|
|
|
osc add subsurfacedaily-$VERSION.orig.tar.xz
|
|
|
|
sed -i "s/%define gitVersion .*/%define gitVersion $GITREVISION/" subsurfacedaily.spec
|
2014-12-23 04:26:09 +00:00
|
|
|
osc commit -m "next daily build"
|
|
|
|
fi
|