Mor changes to build script
This commit is contained in:
parent
df39d319cc
commit
96cd0fd4b8
97
dev/build.sh
97
dev/build.sh
@ -1,47 +1,100 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
mkdir -p /opt/ttn-gateway/dev
|
INSTALL_DIR="/opt/ttn-gateway"
|
||||||
cd /opt/ttn-gateway/dev
|
|
||||||
git clone git://git.drogon.net/wiringPi
|
mkdir -p $INSTALL_DIR/dev
|
||||||
cd wiringPi
|
cd $INSTALL_DIR/dev
|
||||||
|
|
||||||
|
if [ ! -d wiringPi ]; then
|
||||||
|
git clone git://git.drogon.net/wiringPi
|
||||||
|
cd wiringPi
|
||||||
|
else
|
||||||
|
cd wiringPi
|
||||||
|
git reset --hard
|
||||||
|
git pull
|
||||||
|
fi
|
||||||
|
./build
|
||||||
cd ..
|
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
|
if [ ! -d lora_gateway ]; then
|
||||||
apt install protobuf-compiler
|
git clone https://github.com/kersing/lora_gateway.git
|
||||||
apt install libprotobuf-dev
|
else
|
||||||
apt install libprotoc-dev
|
cd lora_gateway
|
||||||
apt install automake
|
git reset --hard
|
||||||
apt install libtool
|
git pull
|
||||||
apt install autoconf
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
cd lora_gateway/libloragw
|
if [ ! -d paho.mqtt.embedded-c ]; then
|
||||||
|
git clone https://github.com/kersing/paho.mqtt.embedded-c.git
|
||||||
|
else
|
||||||
|
cd paho.mqtt.embedded-c
|
||||||
|
git reset --hard
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d ttn-gateway-connector ]; then
|
||||||
|
git clone https://github.com/kersing/ttn-gateway-connector.git
|
||||||
|
else
|
||||||
|
cd ttn-gateway-connector
|
||||||
|
git reset --hard
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d protobuf-c ]; then
|
||||||
|
git clone https://github.com/kersing/protobuf-c.git
|
||||||
|
else
|
||||||
|
cd protobuf-c
|
||||||
|
git reset --hard
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d packet_forwarder ]; then
|
||||||
|
git clone https://github.com/kersing/packet_forwarder.git
|
||||||
|
else
|
||||||
|
cd packet_forwarder
|
||||||
|
git reset --hard
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d protobuf ]; then
|
||||||
|
git clone https://github.com/google/protobuf.git
|
||||||
|
else
|
||||||
|
cd protobuf
|
||||||
|
git reset --hard
|
||||||
|
git pull
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
apt-get update
|
||||||
|
apt-get -y install protobuf-compiler libprotobuf-dev libprotoc-dev automake libtool autoconf
|
||||||
|
|
||||||
|
cd $INSTALL_DIR/dev/lora_gateway/libloragw
|
||||||
sed -i -e 's/PLATFORM= .*$/PLATFORM= imst_rpi/g' library.cfg
|
sed -i -e 's/PLATFORM= .*$/PLATFORM= imst_rpi/g' library.cfg
|
||||||
sed -i -e 's/CFG_SPI= .*$/CFG_SPI= native/g' library.cfg
|
sed -i -e 's/CFG_SPI= .*$/CFG_SPI= native/g' library.cfg
|
||||||
make
|
make
|
||||||
|
|
||||||
cd ../../protobuf-c
|
cd $INSTALL_DIR/dev/protobuf-c
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
./configure
|
./configure
|
||||||
make protobuf-c/libprotobuf-c.la
|
make protobuf-c/libprotobuf-c.la
|
||||||
mkdir bin
|
mkdir bin
|
||||||
./libtool install /usr/bin/install -c protobuf-c/libprotobuf-c.la `pwd`/bin
|
./libtool install /usr/bin/install -c protobuf-c/libprotobuf-c.la `pwd`/bin
|
||||||
|
|
||||||
cd ../paho.mqtt.embedded-c/
|
cd $INSTALL_DIR/dev/paho.mqtt.embedded-c/
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
|
|
||||||
cd ../ttn-gateway-connector
|
cd $INSTALL_DIR/dev/ttn-gateway-connector
|
||||||
cp config.mk.in config.mk
|
cp config.mk.in config.mk
|
||||||
make
|
make
|
||||||
cp bin/libttn-gateway-connector.so /usr/lib/
|
cp bin/libttn-gateway-connector.so /usr/lib/
|
||||||
|
|
||||||
cd ../packet_forwarder/mp_pkt_fwd/
|
cd $INSTALL_DIR/dev/packet_forwarder/mp_pkt_fwd/
|
||||||
make
|
make
|
||||||
|
|
||||||
echo "Build & Installation Completed."
|
echo "Build & Installation Completed."
|
||||||
|
Loading…
Reference in New Issue
Block a user