Alexander Afanasyev | 21034bf | 2014-09-02 18:31:53 -0700 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | |
| 4 | cd /tmp |
| 5 | BUILD="no" |
| 6 | if [ ! -d ndn-cxx ]; then |
| 7 | git clone --depth 1 git://github.com/named-data/ndn-cxx |
| 8 | cd ndn-cxx |
| 9 | BUILD="yes" |
| 10 | else |
| 11 | cd ndn-cxx |
| 12 | INSTALLED_VERSION=`git rev-parse HEAD || echo NONE` |
| 13 | sudo rm -Rf latest-version |
| 14 | git clone --depth 1 git://github.com/named-data/ndn-cxx latest-version |
| 15 | cd latest-version |
| 16 | LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN` |
| 17 | cd .. |
| 18 | rm -Rf latest-version |
| 19 | if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then |
| 20 | cd .. |
| 21 | sudo rm -Rf ndn-cxx |
| 22 | git clone --depth 1 git://github.com/named-data/ndn-cxx |
| 23 | cd ndn-cxx |
| 24 | BUILD="yes" |
| 25 | fi |
| 26 | fi |
| 27 | |
| 28 | sudo rm -Rf /usr/local/include/ndn-cxx |
| 29 | sudo rm -f /usr/local/lib/libndn-cxx* |
| 30 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx* |
| 31 | |
| 32 | if [ "$BUILD" = "yes" ]; then |
| 33 | ./waf distclean --color=yes |
| 34 | fi |
| 35 | |
| 36 | ./waf configure --color=yes --without-osx-keychain |
| 37 | ./waf -j1 --color=yes |
| 38 | sudo ./waf install --color=yes |