blob: 4307cefe5e38b592c7e9230c77ab93b8003319c1 [file] [log] [blame]
Alexander Afanasyeva9369b42017-01-11 11:58:00 -08001#!/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=$((cd NFD && git rev-parse HEAD) 2>/dev/null || echo NONE)
12
13sudo rm -Rf NFD-latest
14
15git clone git://github.com/named-data/NFD NFD-latest
16
17LATEST_VERSION=$((cd NFD-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
18
19if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
20 sudo rm -Rf NFD
21 mv NFD-latest NFD
22else
23 sudo rm -Rf NFD-latest
24fi
25
26sudo killall nfd || true
27
28sudo rm -f /usr/local/bin/nfd
29sudo rm -f /usr/local/etc/ndn/nfd.conf
30
31pushd NFD >/dev/null
32
33git submodule init
34git submodule sync
35git submodule update
36
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080037./waf -j1 --color=yes configure
38./waf -j1 --color=yes build
39sudo ./waf -j1 --color=yes install
Alexander Afanasyev1cf5c432017-01-13 23:22:15 -080040
41# Install default config
Alexander Afanasyeva9369b42017-01-11 11:58:00 -080042sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
43
44popd >/dev/null
45popd >/dev/null