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//')
|
|
|
|
VERSION=$(echo $GITVERSION | sed -e 's/-/./')
|
2014-12-02 00:00:47 +00:00
|
|
|
echo "building Subsurface" $VERSION
|
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-02 18:55:52 +00:00
|
|
|
mkdir subsurface_$VERSION
|
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-03 06:01:07 +00:00
|
|
|
rm -rf .git libdivecomputer/.git libgit2/.git
|
2014-12-02 23:26:43 +00:00
|
|
|
echo $GITVERSION > .gitversion
|
|
|
|
|
2014-12-02 18:55:52 +00:00
|
|
|
dh_make --email dirk@hohndel.org -c gpl2 --createorig --single --yes -p subsurface_$VERSION
|
2014-12-02 00:00:47 +00:00
|
|
|
rm debian/*.ex debian/*.EX debian/README.*
|
2014-12-03 17:38:52 +00:00
|
|
|
cp ../subsurface/packaging/ubuntu/debian/control debian/control
|
|
|
|
cp ../subsurface/packaging/ubuntu/debian/copyright debian/copyright
|
|
|
|
cp ../subsurface/packaging/ubuntu/debian/rules debian/rules
|
|
|
|
cp ../subsurface/packaging/ubuntu/debian/source.lintian-overrides debian/source.lintian-overrides
|
2014-12-02 00:00:47 +00:00
|
|
|
# do something clever with changelog
|
|
|
|
mv debian/changelog debian/autocl
|
2014-12-03 19:58:36 +00:00
|
|
|
head -1 debian/autocl | sed -e 's/)/~trusty)/' -e 's/unstable/trusty/' > debian/changelog
|
2014-12-03 17:38:52 +00:00
|
|
|
cat ../subsurface/packaging/ubuntu/debian/changelog >> debian/changelog
|
2014-12-02 00:00:47 +00:00
|
|
|
tail -1 debian/autocl >> debian/changelog
|
|
|
|
rm -f debian/autocl
|
|
|
|
|
|
|
|
debuild -S
|
|
|
|
|
2014-12-03 19:58:36 +00:00
|
|
|
prev=trusty
|
|
|
|
for rel in utopic precise
|
|
|
|
do
|
|
|
|
sed -i "s/${prev}/${rel}/g" debian/changelog
|
|
|
|
debuild -S
|
|
|
|
prev=${rel}
|
|
|
|
done
|