ci: Add Jenkins build and testing scripts

Change-Id: Ifaa9dc8ba7c5185c0d20ea3a3784638cbb9efbaa
diff --git a/.jenkins.d/10-ndn-cxx.sh b/.jenkins.d/10-ndn-cxx.sh
new file mode 100755
index 0000000..465e291
--- /dev/null
+++ b/.jenkins.d/10-ndn-cxx.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+set -x
+
+cd /tmp
+BUILD="no"
+if [ ! -d ndn-cxx ]; then
+    git clone --depth 1 git://github.com/named-data/ndn-cxx
+    cd ndn-cxx
+    BUILD="yes"
+else
+    cd ndn-cxx
+    INSTALLED_VERSION=`git rev-parse HEAD || echo NONE`
+    sudo rm -Rf latest-version
+    git clone --depth 1 git://github.com/named-data/ndn-cxx latest-version
+    cd latest-version
+    LATEST_VERSION=`git rev-parse HEAD || echo UNKNOWN`
+    cd ..
+    rm -Rf latest-version
+    if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
+        cd ..
+        sudo rm -Rf ndn-cxx
+        git clone --depth 1 git://github.com/named-data/ndn-cxx
+        cd ndn-cxx
+        BUILD="yes"
+    fi
+fi
+
+sudo rm -Rf /usr/local/include/ndn-cxx
+sudo rm -f /usr/local/lib/libndn-cxx*
+sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
+
+if [ "$BUILD" = "yes" ]; then
+    ./waf distclean --color=yes
+fi
+
+./waf configure --color=yes --without-osx-keychain
+./waf -j1 --color=yes
+sudo ./waf install --color=yes