2017-06-25 14:41:48 +02:00
|
|
|
#!/usr/bin/env bash
|
2019-05-13 20:38:41 +02:00
|
|
|
VERSION=$(grep setApplicationVersion ../src/main.cpp | head -n1 | cut -d \" -f2)
|
|
|
|
echo "Make Debian package for v$VERSION" >&2
|
|
|
|
|
2017-11-16 20:37:46 +01:00
|
|
|
cp deb work -r
|
2019-05-13 20:38:41 +02:00
|
|
|
sed "s/%ver/$VERSION/g" deb/DEBIAN/control > work/DEBIAN/control
|
2017-06-25 14:41:48 +02:00
|
|
|
mkdir -p work/usr/bin
|
2019-05-13 20:38:41 +02:00
|
|
|
|
|
|
|
if [[ "$1" == "" ]]
|
2017-06-25 14:41:48 +02:00
|
|
|
then
|
2019-05-13 20:38:41 +02:00
|
|
|
echo "Fresh Compile Binary" >&2
|
|
|
|
mkdir compiling
|
|
|
|
cd compiling
|
|
|
|
qmake ../../KShare.pro
|
|
|
|
if make
|
|
|
|
then
|
|
|
|
cd ..
|
|
|
|
cp compiling/src/kshare work/usr/bin/kshare
|
|
|
|
else
|
|
|
|
rm -rf compiling
|
|
|
|
echo "Failed to make!"
|
|
|
|
exit 2
|
|
|
|
fi
|
2017-06-25 14:41:48 +02:00
|
|
|
else
|
2019-05-13 20:38:41 +02:00
|
|
|
echo "Using pre-compiled binary (please only use in circleci)" >&2
|
|
|
|
pwd
|
|
|
|
|
|
|
|
cp ../build/src/kshare work/usr/bin/kshare
|
2017-06-25 14:41:48 +02:00
|
|
|
fi
|
2019-05-13 20:38:41 +02:00
|
|
|
|
2017-06-25 14:41:48 +02:00
|
|
|
cd work
|
2017-11-16 20:37:46 +01:00
|
|
|
md5sum usr/bin/kshare usr/share/applications/KShare.desktop > DEBIAN/md5sums
|
2017-06-25 14:41:48 +02:00
|
|
|
cd ..
|
2017-06-25 23:20:57 +02:00
|
|
|
dpkg-deb -b work/
|
2019-05-13 20:38:41 +02:00
|
|
|
mv work.deb kshare_v${VERSION}.deb
|
2017-06-26 17:07:03 +02:00
|
|
|
rm -rf work
|