forked from mavlink/MAVSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_packages.sh
executable file
·65 lines (56 loc) · 2.06 KB
/
create_packages.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
61
62
63
64
65
#!/bin/bash
set -e
# This creates a version such as "v1.2.3-5-g123abc".
version=`git describe --always --tags`
# We want to extract 1.2.3 from it.
version=`echo $version | sed 's/v\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/'`
make clean
make BUILD_TYPE=Release
common_args="--input-type dir \
--version $version \
--maintainer [email protected] \
--url http://dronecore.io \
--license BSD-3-Clause \
--force"
library_files="\
core/system.h=/usr/include/dronecore/system.h \
core/dronecore.h=/usr/include/dronecore/dronecore.h \
build/default/core/libdronecore.so=/usr/lib/libdronecore.so \
plugins/action/action.h=/usr/include/dronecore/action.h \
plugins/follow_me/follow_me.h=/usr/include/dronecore/follow_me.h \
plugins/gimbal/gimbal.h=/usr/include/dronecore/gimbal.h \
plugins/info/info.h=/usr/include/dronecore/info.h \
plugins/logging/logging.h=/usr/include/dronecore/logging.h \
plugins/mission/mission.h=/usr/include/dronecore/mission.h \
plugins/mission/mission_item.h=/usr/include/dronecore/mission_item.h \
plugins/offboard/offboard.h=/usr/include/dronecore/offboard.h \
plugins/telemetry/telemetry.h=/usr/include/dronecore/telemetry.h"
echo "#!/bin/sh" > run_ldconfig
echo "/sbin/ldconfig" >> run_ldconfig
if cat /etc/os-release | grep -q 'Ubuntu\|Debian'
then
echo "Building DEB package"
fpm $common_args \
--output-type deb \
--depends libtinyxml2-dev \
--depends libcurl4-openssl-dev \
--deb-no-default-config-files \
--name libdronecore-dev \
--provides libdronecore-dev \
--after-install run_ldconfig \
--after-remove run_ldconfig \
$library_files
elif cat /etc/os-release | grep -q 'Fedora\|RedHat'
then
echo "Building RPM package"
fpm $common_args \
--output-type rpm \
--depends tinyxml2-devel \
--depends libcurl-devel \
--name libdronecore-devel \
--provides libdronecore-devel \
--after-install run_ldconfig \
--after-remove run_ldconfig \
$library_files
fi
rm run_ldconfig