blob: 2af7d6a1ba441f4631c1560f533d47ca3efcd418 [file] [log] [blame]
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07001#!/usr/bin/env bash
2set -x
Vince Lehman0a7da612014-10-29 14:39:29 -05003set -e
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -07004
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -07005pushd /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
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070016else
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070017 sudo rm -Rf ndn-cxx-latest
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070018fi
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
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070024pushd ndn-cxx >/dev/null
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070025
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070026./waf configure -j1 --color=yes --without-osx-keychain
Alexander Afanasyevbc98fcf2014-08-16 23:18:50 -070027./waf -j1 --color=yes
Alexander Afanasyev24ed83a2015-03-30 11:06:50 -070028sudo ./waf install -j1 --color=yes
29
30popd >/dev/null
31popd >/dev/null