blob: 2af7d6a1ba441f4631c1560f533d47ca3efcd418 [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
2set -x
3set -e
4
5pushd /tmp >/dev/null
6
7INSTALLED_VERSION=$((cd ndn-cxx && git rev-parse HEAD) 2>/dev/null || echo NONE)
8
9sudo rm -Rf ndn-cxx-latest
10git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
11LATEST_VERSION=$((cd ndn-cxx-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
12
13if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
14 sudo rm -Rf ndn-cxx
15 mv ndn-cxx-latest ndn-cxx
16else
17 sudo rm -Rf ndn-cxx-latest
18fi
19
20sudo rm -Rf /usr/local/include/ndn-cxx
21sudo rm -f /usr/local/lib/libndn-cxx*
22sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
23
24pushd ndn-cxx >/dev/null
25
26./waf configure -j1 --color=yes --without-osx-keychain
27./waf -j1 --color=yes
28sudo ./waf install -j1 --color=yes
29
30popd >/dev/null
31popd >/dev/null