blob: 1835a6ce38208e8861a7123f7d7fcf3d8c7bd1e2 [file] [log] [blame]
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +00001#!/usr/bin/env bash
2set -x
3set -e
4
Alexander Afanasyev15db7722015-01-19 17:27:26 -08005if [[ $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
11fi
12
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000013cd /tmp
14BUILD="no"
15if [ ! -d ndn-cxx ]; then
16 git clone git://github.com/named-data/ndn-cxx
17 cd ndn-cxx
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000018 BUILD="yes"
19else
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 Afanasyev8e60bcd2015-01-15 20:55:40 +000025 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
35fi
36
37sudo rm -Rf /usr/local/include/ndn-cxx
38sudo rm -f /usr/local/lib/libndn-cxx*
39sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
40
41if [ "$BUILD" = "yes" ]; then
42 sudo ./waf distclean -j1 --color=yes
43fi
44
Alexander Afanasyevdf26b5a2015-01-15 23:30:56 -080045IS_UBUNTU_12_04=$( python -c "print 'yes' if 'Ubuntu-12.04' in '$NODE_LABELS'.strip().split(' ') else 'no'" )
46if [[ $IS_UBUNTU_12_04 == "yes" ]]; then
47 EXTRA_FLAGS=" --boost-libs=/usr/lib/x86_64-linux-gnu"
48fi
49
50./waf configure -j1 --color=yes --without-osx-keychain $EXTRA_FLAGS
Alexander Afanasyev8e60bcd2015-01-15 20:55:40 +000051./waf -j1 --color=yes
52sudo ./waf install -j1 --color=yes