ttn-resin-gateway-rpi/dev/build.sh

48 lines
1.1 KiB
Bash
Raw Normal View History

2016-03-22 04:38:11 +00:00
#! /bin/bash
2016-03-21 19:36:55 +00:00
mkdir -p /opt/ttn-gateway/dev
cd /opt/ttn-gateway/dev
git clone git://git.drogon.net/wiringPi
cd wiringPi
cd ..
git clone https://github.com/kersing/lora_gateway.git
git clone https://github.com/kersing/paho.mqtt.embedded-c.git
git clone https://github.com/kersing/ttn-gateway-connector.git
git clone https://github.com/kersing/protobuf-c.git
git clone https://github.com/kersing/packet_forwarder.git
git clone https://github.com/google/protobuf.git
apt update
apt install protobuf-compiler
apt install libprotobuf-dev
apt install libprotoc-dev
apt install automake
apt install libtool
apt install autoconf
cd lora_gateway/libloragw
sed -i -e 's/PLATFORM= .*$/PLATFORM= imst_rpi/g' library.cfg
sed -i -e 's/CFG_SPI= .*$/CFG_SPI= native/g' library.cfg
make
2016-03-21 19:36:55 +00:00
cd ../../protobuf-c
./autogen.sh
./configure
make protobuf-c/libprotobuf-c.la
mkdir bin
./libtool install /usr/bin/install -c protobuf-c/libprotobuf-c.la `pwd`/bin
2016-03-21 19:36:55 +00:00
cd ../paho.mqtt.embedded-c/
2016-03-21 19:36:55 +00:00
make
make install
2016-03-21 19:36:55 +00:00
cd ../ttn-gateway-connector
cp config.mk.in config.mk
2016-03-21 19:36:55 +00:00
make
cp bin/libttn-gateway-connector.so /usr/lib/
2016-03-21 19:36:55 +00:00
cd ../packet_forwarder/mp_pkt_fwd/
make
2016-03-25 14:06:47 +00:00
2016-03-25 14:29:49 +00:00
echo "Build & Installation Completed."