Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
| 5 | cd /tmp |
| 6 | BUILD="no" |
| 7 | if [ ! -d ndn-cxx ]; then |
| 8 | git clone git://github.com/named-data/ndn-cxx |
| 9 | cd ndn-cxx |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 10 | BUILD="yes" |
| 11 | else |
| 12 | cd ndn-cxx |
| 13 | INSTALLED_VERSION=`git rev-parse HEAD || echo NONE` |
| 14 | sudo rm -Rf latest-version |
| 15 | git clone git://github.com/named-data/ndn-cxx latest-version |
| 16 | cd latest-version |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 17 | LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN` |
| 18 | cd .. |
| 19 | rm -Rf latest-version |
| 20 | if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then |
| 21 | cd .. |
| 22 | sudo rm -Rf ndn-cxx |
| 23 | git clone --depth 1 git://github.com/named-data/ndn-cxx |
| 24 | cd ndn-cxx |
| 25 | BUILD="yes" |
| 26 | fi |
| 27 | fi |
| 28 | |
| 29 | sudo rm -Rf /usr/local/include/ndn-cxx |
| 30 | sudo rm -f /usr/local/lib/libndn-cxx* |
| 31 | sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx* |
| 32 | |
| 33 | if [ "$BUILD" = "yes" ]; then |
| 34 | sudo ./waf distclean -j1 --color=yes |
| 35 | fi |
| 36 | |
Alexander Afanasyev | df26b5a | 2015-01-15 23:30:56 -0800 | [diff] [blame^] | 37 | IS_UBUNTU_12_04=$( python -c "print 'yes' if 'Ubuntu-12.04' in '$NODE_LABELS'.strip().split(' ') else 'no'" ) |
| 38 | if [[ $IS_UBUNTU_12_04 == "yes" ]]; then |
| 39 | EXTRA_FLAGS=" --boost-libs=/usr/lib/x86_64-linux-gnu" |
| 40 | fi |
| 41 | |
| 42 | ./waf configure -j1 --color=yes --without-osx-keychain $EXTRA_FLAGS |
Alexander Afanasyev | 8e60bcd | 2015-01-15 20:55:40 +0000 | [diff] [blame] | 43 | ./waf -j1 --color=yes |
| 44 | sudo ./waf install -j1 --color=yes |