forked from alfredoFBW/PprzGCS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_deb.sh
executable file
·62 lines (40 loc) · 1.53 KB
/
build_deb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
if [ -z ${1} ];
then
echo "Usage: ./build_deb.sh <version>"
exit 1
fi
version=$(echo $1 | sed 's/.*v\(.*\)/\1/g')
WD="${WD:-$(pwd)}"
install_prefix=$WD/build/install
debian=$WD/misc/debian/pprzgcs
deb_install_prefix=$debian/usr/local
echo "install_prefix set to $install_prefix."
# exit on error
set -e
ivyqt_src=$WD/ext/IvyQt
ivyqt_build=$WD/build/IvyQt
pprzlinkqt_src=$WD/ext/pprzlinkQt/
pprzlinkqt_build=$WD/build/ext/pprzlinkQt
cmake -S $ivyqt_src -B $ivyqt_build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$install_prefix
cmake --build $ivyqt_build
cmake --install $ivyqt_build
cmake -S $pprzlinkqt_src -B $pprzlinkqt_build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$install_prefix
cmake --build $pprzlinkqt_build
cmake --install $pprzlinkqt_build
cmake -S . -B $WD/build/pprzgcs -DCMAKE_INSTALL_PREFIX=$deb_install_prefix -DCMAKE_PREFIX_PATH=$install_prefix -DCMAKE_BUILD_TYPE=Release -DPPRZGCS_VERSION=$(git describe --tags)
cmake --build $WD/build/pprzgcs
cmake --install $WD/build/pprzgcs
strip --strip-unneeded $deb_install_prefix/bin/pprzgcs
# Add changelog
cp $WD/CHANGELOG.md changelog.Debian
gzip changelog.Debian
mv changelog.Debian.gz $deb_install_prefix/share/doc/pprzgcs/
# set correct version
echo "Setting version to $version"
sed -i "s/__VERSION__/$version/g" $debian/DEBIAN/control
# set correct size
size=$(du -s $debian/usr/ | cut -f 1)
echo "Setting installed size to $size"
sed -i "s/__SIZE__/$size/g" $debian/DEBIAN/control
dpkg-deb --root-owner-group --build misc/debian/pprzgcs