Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 2 | set -e |
| 3 | |
| 4 | JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 5 | source "$JDIR"/util.sh |
| 6 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 7 | set -x |
| 8 | |
| 9 | pushd "${CACHE_DIR:-/tmp}" >/dev/null |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 10 | |
| 11 | INSTALLED_VERSION= |
Ashlesh Gawande | 05cb728 | 2018-08-30 14:39:41 -0500 | [diff] [blame] | 12 | NDN_CXX=$(ndnsec version) |
| 13 | OLD_NDN_CXX=$(cat ndn_cxx_chrono.txt || :) |
| 14 | if [[ $OLD_NDN_CXX != $NDN_CXX ]]; then |
| 15 | echo "$NDN_CXX" > ndn_cxx_chrono.txt |
| 16 | INSTALLED_VERSION=NONE |
| 17 | fi |
| 18 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 19 | if [[ -z $INSTALLED_VERSION ]]; then |
| 20 | INSTALLED_VERSION=$(git -C ChronoSync rev-parse HEAD 2>/dev/null || echo NONE) |
| 21 | fi |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 22 | |
| 23 | sudo rm -Rf ChronoSync-latest |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 24 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 25 | git clone --depth 1 git://github.com/named-data/ChronoSync ChronoSync-latest |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 26 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 27 | LATEST_VERSION=$(git -C ChronoSync-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN) |
| 28 | |
| 29 | if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then |
| 30 | sudo rm -Rf ChronoSync |
| 31 | mv ChronoSync-latest ChronoSync |
| 32 | else |
| 33 | sudo rm -Rf ChronoSync-latest |
| 34 | fi |
Nick Gordon | b9c5cec | 2017-06-08 14:10:27 -0500 | [diff] [blame] | 35 | |
Davide Pesavento | 6a81b77 | 2017-08-20 18:43:46 -0400 | [diff] [blame] | 36 | sudo rm -fr /usr/local/include/ChronoSync |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame] | 37 | sudo rm -f /usr/local/lib{,64}/libChronoSync* |
| 38 | sudo rm -f /usr/local/lib{,64}/pkgconfig/ChronoSync.pc |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 39 | |
Muktadir Chowdhury | f04f989 | 2017-08-20 20:42:56 -0500 | [diff] [blame] | 40 | pushd ChronoSync >/dev/null |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 41 | |
| 42 | if has FreeBSD10 $NODE_LABELS; then |
| 43 | export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ |
| 44 | fi |
| 45 | |
Davide Pesavento | 813df80 | 2017-08-20 20:53:54 -0400 | [diff] [blame] | 46 | ./waf configure --color=yes |
| 47 | ./waf build --color=yes -j${WAF_JOBS:-1} |
Davide Pesavento | 0b0eddd | 2019-03-19 14:42:15 -0400 | [diff] [blame] | 48 | sudo_preserve_env PATH -- ./waf install --color=yes |
Ashlesh Gawande | 415676b | 2016-12-22 00:26:23 -0600 | [diff] [blame] | 49 | |
| 50 | popd >/dev/null |
| 51 | popd >/dev/null |
| 52 | |
| 53 | if has Linux $NODE_LABELS; then |
| 54 | sudo ldconfig |
| 55 | elif has FreeBSD10 $NODE_LABELS; then |
| 56 | sudo ldconfig -m |
| 57 | fi |