communication: add SVS support
Change-Id: I74c5a091c8b1c05dd186a0c10849aa5bb4f39e50
Signed-off-by: Varun Patil <varunpatil@ucla.edu>
diff --git a/.jenkins.d/04-ndn-svs.sh b/.jenkins.d/04-ndn-svs.sh
new file mode 100755
index 0000000..5105197
--- /dev/null
+++ b/.jenkins.d/04-ndn-svs.sh
@@ -0,0 +1,49 @@
+#!/usr/bin/env bash
+set -exo pipefail
+
+PROJ=ndn-svs
+
+pushd "$CACHE_DIR" >/dev/null
+
+INSTALLED_VERSION=
+NDN_CXX=$(ndnsec version)
+OLD_NDN_CXX=$(cat "$PROJ-ndn-cxx.txt" || :)
+if [[ $OLD_NDN_CXX != $NDN_CXX ]]; then
+ echo "$NDN_CXX" > "$PROJ-ndn-cxx.txt"
+ INSTALLED_VERSION=NONE
+fi
+
+if [[ -z $INSTALLED_VERSION ]]; then
+ INSTALLED_VERSION=$(git -C "$PROJ" rev-parse HEAD 2>/dev/null || echo NONE)
+fi
+
+sudo rm -rf "$PROJ-latest"
+git clone --depth 1 "https://github.com/named-data/$PROJ.git" "$PROJ-latest"
+LATEST_VERSION=$(git -C "$PROJ-latest" rev-parse HEAD 2>/dev/null || echo UNKNOWN)
+
+if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
+ sudo rm -rf "$PROJ"
+ mv "$PROJ-latest" "$PROJ"
+else
+ sudo rm -rf "$PROJ-latest"
+fi
+
+sudo rm -fr /usr/local/include/"$PROJ"
+sudo rm -f /usr/local/lib{,64}/lib"$PROJ"*
+sudo rm -f /usr/local/lib{,64}/pkgconfig/"$PROJ".pc
+
+pushd "$PROJ" >/dev/null
+
+./waf --color=yes configure
+./waf --color=yes build
+sudo ./waf --color=yes install
+
+popd >/dev/null
+popd >/dev/null
+
+if [[ $ID_LIKE == *fedora* ]]; then
+ sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
+fi
+if [[ $ID_LIKE == *linux* ]]; then
+ sudo ldconfig
+fi