forked from emqx/neuron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package-sdk.sh
executable file
·77 lines (63 loc) · 1.91 KB
/
package-sdk.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
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
arch=x86_64-linux-gnu
package_name=neuron-sdk
function usage() {
echo "Usage: $0 "
echo "-n package name [default: ${package_name}]"
echo "-p target platform compiler prefix (opts: x86_64-linux-gnu, arm-linux-gnueabihf, aarch64-linux-gnu, ...)[default: x86_64-linux-gnu]"
}
while getopts "p:n:h-:" OPT; do
case ${OPT} in
p)
arch=$OPTARG
;;
n)
package_name=$OPTARG
;;
h)
usage
exit 0
;;
\?)
usage
exit 1
;;
esac
done
rm -rf ${package_name}/*
mkdir -p $package_name/include/neuron/
mkdir -p $package_name/lib
mkdir -p $package_name/config
mkdir -p $package_name/plugins/schema
cp sdk-install.sh ${package_name}/
cp neuron.conf ${package_name}/
cp cmake/neuron-config.cmake ${package_name}/
cp -r include/* ${package_name}/include/
cp -r build/dist ${package_name}/
cp build/neuron ${package_name}
cp build/libneuron-base.so ${package_name}/lib
cp /usr/local/lib/libzlog.so.1.2 ${package_name}/lib
cp persistence/*.sql ${package_name}/config/
cp sdk-zlog.conf ${package_name}/config/
cp zlog.conf ${package_name}/config/
cp dev.conf ${package_name}/config/
cp neuron.key ${package_name}/config/
cp neuron.pem ${package_name}/config/
cp default_plugins.json ${package_name}/config/
cp neuron.json ${package_name}/config/
cp build/plugins/schema/ekuiper.json \
build/plugins/schema/monitor.json \
build/plugins/schema/mqtt.json \
build/plugins/schema/modbus-tcp.json \
build/plugins/schema/file.json \
${package_name}/plugins/schema/
cp build/plugins/libplugin-ekuiper.so \
build/plugins/libplugin-monitor.so \
build/plugins/libplugin-mqtt.so \
build/plugins/libplugin-modbus-tcp.so \
build/plugins/libplugin-file.so \
${package_name}/plugins/
tar czf ${package_name}-${arch}.tar.gz ${package_name}/
ls ${package_name}
rm -rf ${package_name}
echo "${package_name}-${arch}.tar.gz"