Update CI scripts

Synced from ndn-tools

Change-Id: I1faf341ab032a2e5ca2a70e2c1142379581fba34
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index 41b93f0..66dafb4 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -7,14 +7,28 @@
 set -x
 
 if has OSX $NODE_LABELS; then
+    FORMULAE=(boost openssl pkg-config)
     brew update
-    brew upgrade
-    brew install boost pkg-config cryptopp openssl
+    if [[ -n $TRAVIS ]]; then
+        # travis images come with a large number of brew packages
+        # pre-installed, don't waste time upgrading all of them
+        for FORMULA in "${FORMULAE[@]}"; do
+            brew outdated $FORMULA || brew upgrade $FORMULA
+        done
+    else
+        brew upgrade
+    fi
+    brew install "${FORMULAE[@]}"
     brew cleanup
 fi
 
 if has Ubuntu $NODE_LABELS; then
     sudo apt-get -qq update
-    sudo apt-get -qq install build-essential pkg-config libboost-all-dev \
-                             libcrypto++-dev libsqlite3-dev libssl-dev
+    sudo apt-get -qy install build-essential pkg-config libboost-all-dev \
+                             libsqlite3-dev libssl-dev
+
+    if [[ $JOB_NAME == *"code-coverage" ]]; then
+        sudo apt-get -qy install lcov libgd-perl python-setuptools
+        sudo easy_install --upgrade gcovr
+    fi
 fi