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