Chengyu Fan | 2788755 | 2015-03-26 17:12:00 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | set -x |
| 3 | set -e |
| 4 | |
Chengyu Fan | 4639821 | 2015-08-11 11:23:13 -0600 | [diff] [blame] | 5 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 6 | source "$JDIR"/util.sh |
| 7 | |
Chengyu Fan | 2788755 | 2015-03-26 17:12:00 -0600 | [diff] [blame] | 8 | pushd /tmp >/dev/null |
| 9 | |
| 10 | INSTALLED_VERSION=$((cd ChronoSync && git rev-parse HEAD) 2>/dev/null || echo NONE) |
| 11 | |
| 12 | sudo rm -Rf ChronoSync-latest |
| 13 | git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest |
| 14 | LATEST_VERSION=$((cd ChronoSync-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN) |
| 15 | |
| 16 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 17 | sudo rm -Rf ChronoSync |
| 18 | mv ChronoSync-latest ChronoSync |
| 19 | else |
| 20 | sudo rm -Rf ChronoSync-latest |
| 21 | fi |
| 22 | |
| 23 | sudo rm -Rf /usr/local/include/ChronoSync |
| 24 | sudo rm -f /usr/local/lib/libChronoSync* |
| 25 | sudo rm -f /usr/local/lib/pkgconfig/ChronoSync* |
| 26 | |
| 27 | pushd ChronoSync >/dev/null |
| 28 | |
| 29 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:\ |
| 30 | /usr/local/lib32/pkgconfig:\ |
| 31 | /usr/local/lib64/pkgconfig |
| 32 | |
Chengyu Fan | 4639821 | 2015-08-11 11:23:13 -0600 | [diff] [blame] | 33 | sudo ./waf distclean -j1 --color=yes |
| 34 | |
Chengyu Fan | 2788755 | 2015-03-26 17:12:00 -0600 | [diff] [blame] | 35 | ./waf configure -j1 --color=yes |
| 36 | ./waf -j1 --color=yes |
| 37 | sudo ./waf install -j1 --color=yes |
| 38 | |
| 39 | popd >/dev/null |
| 40 | popd >/dev/null |
Chengyu Fan | 4639821 | 2015-08-11 11:23:13 -0600 | [diff] [blame] | 41 | |
| 42 | if has Linux $NODE_LABELS; then |
| 43 | sudo ldconfig |
| 44 | elif has FreeBSD $NODE_LABELS; then |
| 45 | sudo ldconfig -a |
| 46 | fi |