Chengyu Fan | 2788755 | 2015-03-26 17:12:00 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
| 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 |
| 16 | else |
| 17 | sudo rm -Rf ndn-cxx-latest |
| 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 | |
| 24 | pushd ndn-cxx >/dev/null |
| 25 | |
Chengyu Fan | c7b87ad | 2015-07-09 16:44:37 -0600 | [diff] [blame^] | 26 | ./waf configure -j1 --color=yes --without-osx-keychain |
Chengyu Fan | 2788755 | 2015-03-26 17:12:00 -0600 | [diff] [blame] | 27 | ./waf -j1 --color=yes |
| 28 | sudo ./waf install -j1 --color=yes |
Chengyu Fan | c7b87ad | 2015-07-09 16:44:37 -0600 | [diff] [blame^] | 29 | (echo -e '/usr/local/lib\n/usr/local/lib64' | sudo tee /etc/ld.so.conf.d/ndn-cxx.conf) || true |
| 30 | sudo ldconfig || true |
Chengyu Fan | 2788755 | 2015-03-26 17:12:00 -0600 | [diff] [blame] | 31 | |
| 32 | popd >/dev/null |
| 33 | popd >/dev/null |