blob: 256218ade6dbcf897c3388dd41a58ed53e392ac8 [file] [log] [blame]
Chengyu Fan27887552015-03-26 17:12:00 -06001#!/usr/bin/env bash
2set -x
3set -e
4
Chengyu Fan46398212015-08-11 11:23:13 -06005JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
6source "$JDIR"/util.sh
7
Chengyu Fan27887552015-03-26 17:12:00 -06008pushd /tmp >/dev/null
9
10INSTALLED_VERSION=$((cd ChronoSync && git rev-parse HEAD) 2>/dev/null || echo NONE)
11
12sudo rm -Rf ChronoSync-latest
13git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest
14LATEST_VERSION=$((cd ChronoSync-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
15
16if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
17 sudo rm -Rf ChronoSync
18 mv ChronoSync-latest ChronoSync
19else
20 sudo rm -Rf ChronoSync-latest
21fi
22
23sudo rm -Rf /usr/local/include/ChronoSync
24sudo rm -f /usr/local/lib/libChronoSync*
25sudo rm -f /usr/local/lib/pkgconfig/ChronoSync*
26
27pushd ChronoSync >/dev/null
28
29export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:\
30/usr/local/lib32/pkgconfig:\
31/usr/local/lib64/pkgconfig
32
Chengyu Fan46398212015-08-11 11:23:13 -060033sudo ./waf distclean -j1 --color=yes
34
Chengyu Fan27887552015-03-26 17:12:00 -060035./waf configure -j1 --color=yes
36./waf -j1 --color=yes
37sudo ./waf install -j1 --color=yes
38
39popd >/dev/null
40popd >/dev/null
Chengyu Fan46398212015-08-11 11:23:13 -060041
42if has Linux $NODE_LABELS; then
43 sudo ldconfig
44elif has FreeBSD $NODE_LABELS; then
45 sudo ldconfig -a
46fi