blob: 6fb1d9fe5b90d96f1344133f319e620a339a05c9 [file] [log] [blame]
Ashlesh Gawande415676b2016-12-22 00:26:23 -06001#!/usr/bin/env bash
2set -x
3set -e
4
5JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
7
8pushd /tmp >/dev/null
9
10INSTALLED_VERSION=
11if has OSX $NODE_LABELS; then
12 BOOST=$(brew ls --versions boost)
13 OLD_BOOST=$(cat boost_chrono.txt || :)
14 if [[ $OLD_BOOST != $BOOST ]]; then
15 echo "$BOOST" > boost_chrono.txt
16 INSTALLED_VERSION=NONE
17 fi
18fi
19
20if [[ -z $INSTALLED_VERSION ]]; then
21 INSTALLED_VERSION=$((cd ChronoSync && git rev-parse HEAD) 2>/dev/null || echo NONE)
22fi
23
24sudo rm -Rf ChronoSync-latest
25
26git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest
27
28LATEST_VERSION=$((cd ChronoSync-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
29
30if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
31 sudo rm -Rf ChronoSync
32 mv ChronoSync-latest ChronoSync
33else
34 sudo rm -Rf ChronoSync-latest
35fi
36
37sudo rm -Rf /usr/local/include/ChronoSync
38sudo rm -f /usr/local/lib/libChronoSync*
39sudo rm -f /usr/local/lib/pkgconfig/ChronoSync*
40
41pushd ChronoSync >/dev/null
42
43if has FreeBSD10 $NODE_LABELS; then
44 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/
45fi
46
47./waf -j1 --color=yes configure
48./waf -j1 --color=yes build
49sudo ./waf install -j1 --color=yes
50
51popd >/dev/null
52popd >/dev/null
53
54if has Linux $NODE_LABELS; then
55 sudo ldconfig
56elif has FreeBSD10 $NODE_LABELS; then
57 sudo ldconfig -m
58fi