diff options
author | Karel Kočí <karel.koci@nic.cz> | 2017-05-22 10:53:42 +0200 |
---|---|---|
committer | Karel Kočí <karel.koci@nic.cz> | 2017-05-22 11:01:41 +0200 |
commit | 9f154e163451844bfe692ca81b966ab9b963e8f4 (patch) | |
tree | 590a01da60ecbeab8841ffb762b3a0d3a69afe83 /scripts/build_tools.sh | |
download | turris-mymedkit-9f154e163451844bfe692ca81b966ab9b963e8f4.tar.gz turris-mymedkit-9f154e163451844bfe692ca81b966ab9b963e8f4.tar.bz2 turris-mymedkit-9f154e163451844bfe692ca81b966ab9b963e8f4.zip |
Initial commit
Some basic usage implemented but parent script is missing.
Diffstat (limited to 'scripts/build_tools.sh')
-rwxr-xr-x | scripts/build_tools.sh | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/scripts/build_tools.sh b/scripts/build_tools.sh new file mode 100755 index 0000000..2adb27b --- /dev/null +++ b/scripts/build_tools.sh @@ -0,0 +1,53 @@ +#!/bin/sh +# This tool pulls down and builds updater-ng and usign +# It expects to be executed in root directory of this project +set -e + +git_pull() { + if [ ! -d $1 ]; then + git clone $2 $1 + pushd $1 >/dev/null + git submodule update --init --recursive + popd >/dev/null + else + pushd $1 >/dev/null + git fetch + if ! git diff --quiet HEAD origin/master; then + git clean -Xdf + git reset --hard origin/master + git submodule update --init --recursive + fi + popd >/dev/null + fi +} + +wget_pull() { + if [ ! -e $1 ] || [ $(expr $(date -u +%s) - $(stat -c %Z $1)) -gt 86400 ]; then + wget $2 -O $1 + fi +} + +## Usign ## +git_pull .usign git://git.openwrt.org/project/usign.git + +if [ ! -x .usign/usign ]; then + pushd .usign >/dev/null + cmake . + make + popd >/dev/null +fi + +## Updater-ng ## +git_pull .updater https://kkoci@gitlab.labs.nic.cz/turris/updater.git + +if [ ! -x .updater/bin/pkgupdate ]; then + make -C .updater NO_DOC=1 LUA_COMPILE:=no +fi + +## get-api-crl ## +wget_pull .get-api-crl https://gitlab.labs.nic.cz/turris/misc/raw/master/cacerts/get-api-crl + +## Get certificates ## +for K in release standby test; do + wget_pull .$K.pub https://gitlab.labs.nic.cz/turris/turris-os-packages/raw/test/cznic/cznic-repo-keys/files/$K.pub +done |