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