Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
| 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
| 7 | |
| 8 | pushd /tmp >/dev/null |
| 9 | |
| 10 | INSTALLED_VERSION= |
| 11 | if has OSX $NODE_LABELS; then |
| 12 | BOOST=$(brew ls --versions boost) |
| 13 | OLD_BOOST=$(cat boost_chrono.txt || :) |
| 14 | if [[ $OLD_BOOST != $BOOST ]]; then |
| 15 | echo "$BOOST" > boost_chrono.txt |
| 16 | INSTALLED_VERSION=NONE |
| 17 | fi |
| 18 | fi |
| 19 | |
| 20 | if [[ -z $INSTALLED_VERSION ]]; then |
| 21 | INSTALLED_VERSION=$((cd ChronoSync && git rev-parse HEAD) 2>/dev/null || echo NONE) |
| 22 | fi |
| 23 | |
| 24 | sudo rm -Rf ChronoSync-latest |
| 25 | |
| 26 | git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest |
| 27 | |
| 28 | LATEST_VERSION=$((cd ChronoSync-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN) |
| 29 | |
| 30 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 31 | sudo rm -Rf ChronoSync |
| 32 | mv ChronoSync-latest ChronoSync |
| 33 | else |
| 34 | sudo rm -Rf ChronoSync-latest |
| 35 | fi |
| 36 | |
| 37 | sudo rm -Rf /usr/local/include/ChronoSync |
| 38 | sudo rm -f /usr/local/lib/libChronoSync* |
| 39 | sudo rm -f /usr/local/lib/pkgconfig/ChronoSync* |
| 40 | |
| 41 | pushd ChronoSync >/dev/null |
| 42 | |
| 43 | if has FreeBSD10 $NODE_LABELS; then |
| 44 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ |
| 45 | fi |
| 46 | |
| 47 | ./waf -j1 --color=yes configure |
| 48 | ./waf -j1 --color=yes build |
| 49 | sudo ./waf install -j1 --color=yes |
| 50 | |
| 51 | popd >/dev/null |
| 52 | popd >/dev/null |
| 53 | |
| 54 | if has Linux $NODE_LABELS; then |
| 55 | sudo ldconfig |
| 56 | elif has FreeBSD10 $NODE_LABELS; then |
| 57 | sudo ldconfig -m |
| 58 | fi |