From 9f154e163451844bfe692ca81b966ab9b963e8f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 22 May 2017 10:53:42 +0200 Subject: Initial commit Some basic usage implemented but parent script is missing. --- scripts/build_tools.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100755 scripts/build_tools.sh (limited to 'scripts/build_tools.sh') 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 -- cgit v1.2.3