ci: auto-detect the OS instead of relying on NODE_LABELS

And remove WAF_JOBS: waf already defaults to the number of available
CPUs, which is appropriate in most cases, and we can always use the
built-in JOBS variable to override it where necessary.

Change-Id: Ic5bfc2133b39407db3a075bb406eb288f01e0f2d
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index f703092..82ec98e 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -1,8 +1,5 @@
 #!/usr/bin/env bash
-set -ex
-
-git submodule sync
-git submodule update --init
+set -eo pipefail
 
 if [[ -z $DISABLE_ASAN ]]; then
     ASAN="--with-sanitizer=address"
@@ -10,24 +7,26 @@
 if [[ $JOB_NAME == *"code-coverage" ]]; then
     COVERAGE="--with-coverage"
 fi
-if has macos-12 $NODE_LABELS; then
+if [[ $ID == macos && ${VERSION_ID%%.*} -ge 12 ]]; then
     KEYCHAIN="--without-osx-keychain"
 fi
 if [[ -n $DISABLE_PCH ]]; then
     PCH="--without-pch"
 fi
 
+set -x
+
 if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
     # Build static library in release mode with tests and without precompiled headers
     ./waf --color=yes configure --enable-static --disable-shared --with-tests --without-pch
-    ./waf --color=yes build -j$WAF_JOBS
+    ./waf --color=yes build
 
     # Cleanup
     ./waf --color=yes distclean
 
     # Build static and shared library in release mode without tests
     ./waf --color=yes configure --enable-static --enable-shared $PCH
-    ./waf --color=yes build -j$WAF_JOBS
+    ./waf --color=yes build
 
     # Cleanup
     ./waf --color=yes distclean
@@ -35,16 +34,16 @@
 
 # Build shared library in debug mode with tests and examples
 ./waf --color=yes configure --disable-static --enable-shared --debug --with-tests --with-examples $ASAN $COVERAGE $KEYCHAIN $PCH
-./waf --color=yes build -j$WAF_JOBS
+./waf --color=yes build
 
 # (tests will be run against the debug version)
 
 # Install
-sudo_preserve_env PATH -- ./waf --color=yes install
+sudo ./waf --color=yes install
 
-if has CentOS $NODE_LABELS; then
+if [[ $ID_LIKE == *fedora* ]]; then
     sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
 fi
-if has Linux $NODE_LABELS; then
+if [[ $ID_LIKE == *linux* ]]; then
     sudo ldconfig
 fi