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