ci: preserve PATH when running waf under sudo

Change-Id: I090dd49d1d8f78007b1b7684af7563fbedac770a
Refs: #4186
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
index e25dd2a..0225e2d 100755
--- a/.jenkins.d/01-ndn-cxx.sh
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -35,15 +35,16 @@
     sudo rm -Rf ndn-cxx-latest
 fi
 
-sudo rm -Rf /usr/local/include/ndn-cxx
+sudo rm -f /usr/local/bin/ndnsec*
+sudo rm -fr /usr/local/include/ndn-cxx
 sudo rm -f /usr/local/lib/libndn-cxx*
-sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx*
+sudo rm -f /usr/local/lib/pkgconfig/libndn-cxx.pc
 
 pushd ndn-cxx >/dev/null
 
 ./waf configure -j1 --color=yes --enable-shared --disable-static --without-osx-keychain
 ./waf -j1 --color=yes
-sudo ./waf install -j1 --color=yes
+sudo env "PATH=$PATH" ./waf install --color=yes
 
 popd >/dev/null
 popd >/dev/null
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index 6e42480..58bf6de 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -7,7 +7,7 @@
 set -x
 
 # Cleanup
-sudo ./waf -j1 --color=yes distclean
+sudo env "PATH=$PATH" ./waf --color=yes distclean
 
 if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
   # Configure/build in optimized mode with tests
@@ -15,14 +15,14 @@
   ./waf -j1 --color=yes build
 
   # Cleanup
-  sudo ./waf -j1 --color=yes distclean
+  sudo env "PATH=$PATH" ./waf --color=yes distclean
 
   # Configure/build in optimized mode without tests
   ./waf -j1 --color=yes configure
   ./waf -j1 --color=yes build
 
   # Cleanup
-  sudo ./waf -j1 --color=yes distclean
+  sudo env "PATH=$PATH" ./waf --color=yes distclean
 fi
 
 # Configure/build in debug mode with tests
@@ -37,4 +37,4 @@
 # (tests will be run against debug version)
 
 # Install
-sudo ./waf -j1 --color=yes install
+sudo env "PATH=$PATH" ./waf --color=yes install