blob: 642e469a86ca8a690fe305be8a45af792889c150 [file] [log] [blame]
Varun Patila24bd3e2020-11-24 10:08:33 +05301#!/usr/bin/env bash
2set -ex
3
4PROJ=ChronoSync
5
6pushd "$CACHE_DIR" >/dev/null
7
8INSTALLED_VERSION=
9NDN_CXX=$(ndnsec version)
10OLD_NDN_CXX=$(cat "$PROJ-ndn-cxx.txt" || :)
11if [[ $OLD_NDN_CXX != $NDN_CXX ]]; then
12 echo "$NDN_CXX" > "$PROJ-ndn-cxx.txt"
13 INSTALLED_VERSION=NONE
14fi
15
16if [[ -z $INSTALLED_VERSION ]]; then
17 INSTALLED_VERSION=$(git -C "$PROJ" rev-parse HEAD 2>/dev/null || echo NONE)
18fi
19
20sudo rm -rf "$PROJ-latest"
21git clone --depth 1 "https://github.com/named-data/$PROJ.git" "$PROJ-latest"
22LATEST_VERSION=$(git -C "$PROJ-latest" rev-parse HEAD 2>/dev/null || echo UNKNOWN)
23
24if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
25 sudo rm -rf "$PROJ"
26 mv "$PROJ-latest" "$PROJ"
27else
28 sudo rm -rf "$PROJ-latest"
29fi
30
31sudo rm -fr /usr/local/include/"$PROJ"
32sudo rm -f /usr/local/lib{,64}/lib"$PROJ"*
33sudo rm -f /usr/local/lib{,64}/pkgconfig/"$PROJ".pc
34
35pushd "$PROJ" >/dev/null
36
37./waf --color=yes configure
38./waf --color=yes build -j$WAF_JOBS
39sudo_preserve_env PATH -- ./waf --color=yes install
40
41popd >/dev/null
42popd >/dev/null
43
44if has Linux $NODE_LABELS; then
45 sudo ldconfig
46fi