#!/bin/sh
# Installs a modified coap client with support for dtls for use with IKEA Tradfri

# Stop on errors
set -e

python3 -m pip install cython

cd /usr/src/app/
mkdir -p build && cd build

git clone --depth 1 https://git.fslab.de/jkonra2m/tinydtls
cd tinydtls
autoreconf
./configure --with-ecc --without-debug
cd cython
python3 setup.py install

cd ../..
git clone https://github.com/chrysn/aiocoap
cd aiocoap
git reset --hard 3286f48f0b949901c8b5c04c0719dc54ab63d431
python3 -m pip install .
