build+ci: switch to python3

Also in this commit:
 * Sync CI scripts with other projects
 * Modernize docs/conf.py
 * Fix typo in docs/doxygen.conf.in
 * Cleanup README.md

Refs: #5095
Change-Id: If95b6f00e4f48a102054b47e14e9c021da069e71
diff --git a/.gitignore b/.gitignore
index e75e96c..b1d7223 100644
--- a/.gitignore
+++ b/.gitignore
@@ -29,4 +29,4 @@
 *.py[cod]
 
 # Other
-/VERSION
\ No newline at end of file
+/VERSION
diff --git a/.jenkins b/.jenkins
index 674d751..bc1c847 100755
--- a/.jenkins
+++ b/.jenkins
@@ -1,10 +1,32 @@
 #!/usr/bin/env bash
 set -e
+source .jenkins.d/util.sh
 
-DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+export CACHE_DIR=${CACHE_DIR:-/tmp}
+export WAF_JOBS=${WAF_JOBS:-1}
+[[ $JOB_NAME == *"code-coverage" ]] && export DISABLE_ASAN=yes
 
-for file in "$DIR"/.jenkins.d/*; do
+nanos() {
+    # Cannot use date(1) because macOS does not support %N format specifier
+    python3 -c 'import time; print(int(time.time() * 1e9))'
+}
+
+for file in .jenkins.d/*; do
     [[ -f $file && -x $file ]] || continue
-    echo "Run: $file"
+
+    if [[ -n $TRAVIS ]]; then
+        label=$(basename "$file" | sed -E 's/[[:digit:]]+-(.*)\..*/\1/')
+        echo -ne "travis_fold:start:${label}\r"
+        echo -ne "travis_time:start:${label}\r"
+        start=$(nanos)
+    fi
+
+    echo "\$ $file"
     "$file"
+
+    if [[ -n $TRAVIS ]]; then
+        finish=$(nanos)
+        echo -ne "travis_time:end:${label}:start=${start},finish=${finish},duration=$((finish-start)),event=${label}\r"
+        echo -ne "travis_fold:end:${label}\r"
+    fi
 done
diff --git a/.jenkins.d/00-deps.sh b/.jenkins.d/00-deps.sh
index 95c2447..b5671bc 100755
--- a/.jenkins.d/00-deps.sh
+++ b/.jenkins.d/00-deps.sh
@@ -1,29 +1,30 @@
 #!/usr/bin/env bash
-set -e
-
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
+set -ex
 
 if has OSX $NODE_LABELS; then
     FORMULAE=(boost openssl pkg-config)
-    brew update
-    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
+    if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then
+        FORMULAE+=(python)
     fi
-    brew install "${FORMULAE[@]}"
-    brew cleanup
-fi
 
-if has Ubuntu $NODE_LABELS; then
+    if [[ -n $TRAVIS ]]; then
+        # Travis images come with a large number of pre-installed
+        # brew packages, don't waste time upgrading all of them
+        brew list --versions "${FORMULAE[@]}" || brew update
+        for FORMULA in "${FORMULAE[@]}"; do
+            brew list --versions "$FORMULA" || brew install "$FORMULA"
+        done
+        # Ensure /usr/local/opt/openssl exists
+        brew reinstall openssl
+    else
+        brew update
+        brew upgrade
+        brew install "${FORMULAE[@]}"
+        brew cleanup
+    fi
+
+elif has Ubuntu $NODE_LABELS; then
     sudo apt-get -qq update
-    sudo apt-get -qy install build-essential pkg-config libboost-all-dev \
-                             libsqlite3-dev libssl-dev
+    sudo apt-get -qy install g++ pkg-config python3-minimal \
+                             libboost-all-dev libssl-dev libsqlite3-dev
 fi
diff --git a/.jenkins.d/01-ndn-cxx.sh b/.jenkins.d/01-ndn-cxx.sh
index e627627..7bf1cfe 100755
--- a/.jenkins.d/01-ndn-cxx.sh
+++ b/.jenkins.d/01-ndn-cxx.sh
@@ -1,12 +1,7 @@
 #!/usr/bin/env bash
-set -e
+set -ex
 
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
-
-pushd "${CACHE_DIR:-/tmp}" >/dev/null
+pushd "$CACHE_DIR" >/dev/null
 
 INSTALLED_VERSION=
 if has OSX $NODE_LABELS; then
@@ -22,17 +17,15 @@
     INSTALLED_VERSION=$(git -C ndn-cxx rev-parse HEAD 2>/dev/null || echo NONE)
 fi
 
-sudo rm -Rf ndn-cxx-latest
-
-git clone --depth 1 git://github.com/named-data/ndn-cxx ndn-cxx-latest
-
+sudo rm -rf ndn-cxx-latest
+git clone --depth 1 https://github.com/named-data/ndn-cxx.git ndn-cxx-latest
 LATEST_VERSION=$(git -C ndn-cxx-latest rev-parse HEAD 2>/dev/null || echo UNKNOWN)
 
 if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
-    sudo rm -Rf ndn-cxx
+    sudo rm -rf ndn-cxx
     mv ndn-cxx-latest ndn-cxx
 else
-    sudo rm -Rf ndn-cxx-latest
+    sudo rm -rf ndn-cxx-latest
 fi
 
 sudo rm -f /usr/local/bin/ndnsec*
@@ -42,15 +35,25 @@
 
 pushd ndn-cxx >/dev/null
 
-./waf configure --color=yes --enable-shared --disable-static --without-osx-keychain
-./waf build --color=yes -j${WAF_JOBS:-1}
-sudo_preserve_env PATH -- ./waf install --color=yes
+if has Linux $NODE_LABELS && [[ $CXX != clang* && -z $DISABLE_ASAN ]]; then
+    # https://stackoverflow.com/a/47022141
+    ASAN="--with-sanitizer=address"
+fi
+if has CentOS-8 $NODE_LABELS; then
+    # https://bugzilla.redhat.com/show_bug.cgi?id=1721553
+    PCH="--without-pch"
+fi
+
+./waf --color=yes configure --disable-static --enable-shared --without-osx-keychain $ASAN $PCH
+./waf --color=yes build -j$WAF_JOBS
+sudo_preserve_env PATH -- ./waf --color=yes install
 
 popd >/dev/null
 popd >/dev/null
 
+if has CentOS-8 $NODE_LABELS; then
+    sudo tee /etc/ld.so.conf.d/ndn.conf >/dev/null <<< /usr/local/lib64
+fi
 if has Linux $NODE_LABELS; then
     sudo ldconfig
-elif has FreeBSD10 $NODE_LABELS; then
-    sudo ldconfig -m
 fi
diff --git a/.jenkins.d/10-build.sh b/.jenkins.d/10-build.sh
index 209e10b..692ad2f 100755
--- a/.jenkins.d/10-build.sh
+++ b/.jenkins.d/10-build.sh
@@ -1,47 +1,41 @@
 #!/usr/bin/env bash
-set -e
+set -ex
 
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
+git submodule sync
+git submodule update --init
 
-set -x
-
-if [[ $JOB_NAME == *"code-coverage" ]]; then
-    COVERAGE="--with-coverage"
-elif [[ -z $DISABLE_ASAN ]]; then
+if [[ -z $DISABLE_ASAN ]]; then
     ASAN="--with-sanitizer=address"
 fi
-
-# Cleanup
-sudo_preserve_env PATH -- ./waf --color=yes distclean
-
-if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
-  # Configure/build in optimized mode with tests
-  ./waf --color=yes configure --with-tests
-  ./waf --color=yes build -j${WAF_JOBS:-1}
-
-  # Cleanup
-  sudo_preserve_env PATH -- ./waf --color=yes distclean
-
-  # Configure/build in optimized mode without tests
-  ./waf --color=yes configure
-  ./waf --color=yes build -j${WAF_JOBS:-1}
-
-  # Cleanup
-  sudo_preserve_env PATH -- ./waf --color=yes distclean
+if [[ $JOB_NAME == *"code-coverage" ]]; then
+    COVERAGE="--with-coverage"
 fi
 
-# Configure/build in debug mode with tests
-./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE
-./waf --color=yes build -j${WAF_JOBS:-1}
+if [[ $JOB_NAME != *"code-coverage" && $JOB_NAME != *"limited-build" ]]; then
+    # Build in release mode with tests
+    ./waf --color=yes configure --with-tests
+    ./waf --color=yes build -j$WAF_JOBS
 
-# (tests will be run against debug version)
+    # Cleanup
+    ./waf --color=yes distclean
+
+    # Build in release mode without tests
+    ./waf --color=yes configure
+    ./waf --color=yes build -j$WAF_JOBS
+
+    # Cleanup
+    ./waf --color=yes distclean
+fi
+
+# Build in debug mode with tests and examples
+./waf --color=yes configure --debug --with-tests --with-examples $ASAN $COVERAGE
+./waf --color=yes build -j$WAF_JOBS
+
+# (tests will be run against the debug version)
 
 # Install
 sudo_preserve_env PATH -- ./waf --color=yes install
 
 if has Linux $NODE_LABELS; then
     sudo ldconfig
-elif has FreeBSD $NODE_LABELS; then
-    sudo ldconfig -a
 fi
diff --git a/.jenkins.d/20-tests.sh b/.jenkins.d/20-tests.sh
index ec4461b..d4b9652 100755
--- a/.jenkins.d/20-tests.sh
+++ b/.jenkins.d/20-tests.sh
@@ -1,13 +1,8 @@
 #!/usr/bin/env bash
-set -e
-
-JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-source "$JDIR"/util.sh
-
-set -x
+set -ex
 
 # Prepare environment
-rm -Rf ~/.ndn
+rm -rf ~/.ndn
 
 if has OSX $NODE_LABELS; then
     security unlock-keychain -p named-data
@@ -15,7 +10,7 @@
 
 ndnsec-keygen "/tmp/jenkins/$NODE_NAME" | ndnsec-install-cert -
 
-BOOST_VERSION=$(python -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
+BOOST_VERSION=$(python3 -c "import sys; sys.path.append('build/c4che'); import _cache; print(_cache.BOOST_VERSION_NUMBER);")
 
 ut_log_args() {
     if (( BOOST_VERSION >= 106200 )); then
@@ -30,13 +25,13 @@
     fi
 }
 
+# https://github.com/google/sanitizers/wiki/AddressSanitizerFlags
 ASAN_OPTIONS="color=always"
-ASAN_OPTIONS+=":detect_stack_use_after_return=true"
-ASAN_OPTIONS+=":check_initialization_order=true"
-ASAN_OPTIONS+=":strict_init_order=true"
-ASAN_OPTIONS+=":detect_invalid_pointer_pairs=1"
-ASAN_OPTIONS+=":detect_container_overflow=false"
-ASAN_OPTIONS+=":strict_string_checks=true"
+ASAN_OPTIONS+=":check_initialization_order=1"
+ASAN_OPTIONS+=":detect_stack_use_after_return=1"
+ASAN_OPTIONS+=":strict_init_order=1"
+ASAN_OPTIONS+=":strict_string_checks=1"
+ASAN_OPTIONS+=":detect_invalid_pointer_pairs=2"
 ASAN_OPTIONS+=":strip_path_prefix=${PWD}/"
 export ASAN_OPTIONS
 
diff --git a/.jenkins.d/README.md b/.jenkins.d/README.md
index 5813349..e8dbf37 100644
--- a/.jenkins.d/README.md
+++ b/.jenkins.d/README.md
@@ -1,36 +1,28 @@
-CONTINUOUS INTEGRATION SCRIPTS
-==============================
+# CONTINUOUS INTEGRATION SCRIPTS
 
-Environment Variables Used in Build Scripts
--------------------------------------------
+## Environment Variables Used in Build Scripts
 
-- `NODE_LABELS`: the variable defines a list of OS properties.  The set values are used by the
-  build scripts to select proper behavior for different OS.
+- `NODE_LABELS`: space-separated list of platform properties. The included values are used by
+  the build scripts to select the proper behavior for different operating systems and versions.
 
-  The list should include at least `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
+  The list should normally contain `[OS_TYPE]`, `[DISTRO_TYPE]`, and `[DISTRO_VERSION]`.
 
-  Possible values for Linux:
+  Example values:
 
-  * `[OS_TYPE]`: `Linux`
-  * `[DISTRO_TYPE]`: `Ubuntu`
-  * `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`
+  - `[OS_TYPE]`: `Linux`, `OSX`
+  - `[DISTRO_TYPE]`: `Ubuntu`, `CentOS`
+  - `[DISTRO_VERSION]`: `Ubuntu-16.04`, `Ubuntu-18.04`, `CentOS-8`, `OSX-10.14`, `OSX-10.15`
 
-  Possible values for OS X / macOS:
-
-  * `[OS_TYPE]`: `OSX`
-  * `[DISTRO_TYPE]`: `OSX` (can be absent)
-  * `[DISTRO_VERSION]`: `OSX-10.11`, `OSX-10.12`, `OSX-10.13`
-
-- `JOB_NAME`: optional variable to define type of the job.  Depending on the defined job type,
+- `JOB_NAME`: optional variable that defines the type of build job. Depending on the job type,
   the build scripts can perform different tasks.
 
   Possible values:
 
-  * empty: default build process
-  * `code-coverage` (Ubuntu Linux is assumed): debug build with tests and code coverage analysis
-  * `limited-build`: only a single debug build with tests
+  - empty: default build task
+  - `code-coverage`: debug build with tests and code coverage analysis (Ubuntu Linux is assumed)
+  - `limited-build`: only a single debug build with tests
 
-- `CACHE_DIR`: the variable defines a path to folder containing cached files from previous builds,
-  e.g., a compiled version of ndn-cxx library.  If not set, `/tmp` is used.
+- `CACHE_DIR`: directory containing cached files from previous builds, e.g., a compiled version
+  of ndn-cxx. If not set, `/tmp` is used.
 
-- `WAF_JOBS`: number of parallel build jobs used by waf, defaults to 1.
+- `WAF_JOBS`: number of parallel build threads used by waf, defaults to 1.
diff --git a/.jenkins.d/util.sh b/.jenkins.d/util.sh
index 8ddc4ba..8077a74 100644
--- a/.jenkins.d/util.sh
+++ b/.jenkins.d/util.sh
@@ -16,6 +16,7 @@
     set ${saved_xtrace}
     return ${ret}
 }
+export -f has
 
 sudo_preserve_env() {
     local saved_xtrace
@@ -35,3 +36,4 @@
     set ${saved_xtrace}
     sudo env "${vars[@]}" "$@"
 }
+export -f sudo_preserve_env
diff --git a/COPYING.md b/COPYING.md
index 9811dd5..c2796db 100644
--- a/COPYING.md
+++ b/COPYING.md
@@ -3,14 +3,11 @@
 
 PSync relies on third-party software, licensed under the following licenses:
 
-- The Boost libraries are licensed under the terms of the
-  [Boost Software License, Version 1.0](https://www.boost.org/users/license.html)
+- The Boost libraries are licensed under the
+  [Boost Software License 1.0](https://www.boost.org/users/license.html)
 
-- ndn-cxx is licensed under the conditions of
-  [LGPL 3.0](https://github.com/named-data/ndn-cxx/blob/master/COPYING.md)
-
-- The waf build system is licensed under the terms of the
-  [BSD license](https://github.com/named-data/ndn-cxx/blob/master/waf)
+- ndn-cxx is licensed under the terms of the
+  [GNU Lesser General Public License version 3](https://github.com/named-data/ndn-cxx/blob/master/COPYING.md)
 
 - IBLT (Invertible Bloom Lookup Table) is licensed under the terms of the
   [MIT license](https://github.com/gavinandresen/IBLT_Cplusplus/blob/master/LICENSE)
@@ -18,6 +15,10 @@
 - Bloom is licensed under the terms of the
   [MIT license](http://www.partow.net/programming/bloomfilter/index.html)
 
+- The waf build system is licensed under the terms of the
+  [BSD license](https://github.com/named-data/PSync/blob/master/waf)
+
+
 The LGPL and GPL licenses are provided below in this file.  For more information
 about these licenses, see https://www.gnu.org/licenses/
 
diff --git a/README.md b/README.md
index 760c0e0..67cbc8e 100644
--- a/README.md
+++ b/README.md
@@ -1,40 +1,28 @@
-PSYNC - Partial and Full Synchronization Library for NDN
-========================================================
+# PSync: Partial and Full Synchronization Library for NDN
 
-If you are new to the NDN community of software generally, read the
-[Contributor's Guide](https://github.com/named-data/NFD/blob/master/CONTRIBUTING.md).
+![Language](https://img.shields.io/badge/C%2B%2B-14-blue.svg)
+[![Build Status](https://travis-ci.org/named-data/PSync.svg?branch=master)](https://travis-ci.org/named-data/PSync)
+![Latest Version](https://img.shields.io/github/tag/named-data/PSync.svg?color=darkkhaki&label=latest%20version)
 
-PSync library implements the [PSync protocol](https://named-data.net/wp-content/uploads/2017/05/scalable_name-based_data_synchronization.pdf). It uses Invertible
-Bloom Lookup Table (IBLT), also known as Invertible Bloom Filter (IBF), to represent the state
-of a producer in partial sync mode and the state of a node in full sync mode. An IBF is a compact data
-structure where difference of two IBFs can be computed efficiently.
-In partial sync, PSync uses a Bloom Filter to represent the subscription of list of the consumer.
-PSync uses [ndn-cxx](https://github.com/named-data/ndn-cxx) library as NDN development
-library.
+The PSync library implements the
+[PSync protocol](https://named-data.net/wp-content/uploads/2017/05/scalable_name-based_data_synchronization.pdf).
+It uses Invertible Bloom Lookup Table (IBLT), also known as Invertible Bloom Filter (IBF),
+to represent the state of a producer in partial sync mode and the state of a node in full
+sync mode. An IBF is a compact data structure where difference of two IBFs can be computed
+efficiently. In partial sync, PSync uses a Bloom Filter to represent the subscription list
+of the consumer.
 
-PSync is an open source project licensed under LGPL 3.0 (see `COPYING.md` for more
-detail).  We highly welcome all contributions to the PSync code base, provided that
-they can be licensed under LGPL 3.0+ or other compatible license.
+PSync uses the [ndn-cxx](https://github.com/named-data/ndn-cxx) library.
 
-Feedback
---------
-
-Please submit any bugs or issues to the **PSync** issue tracker:
-
-* https://redmine.named-data.net/projects/psync
-
-Installation instructions
--------------------------
+## Installation
 
 ### Prerequisites
 
-Required:
-
-* [ndn-cxx and its dependencies](https://named-data.net/doc/ndn-cxx/)
+* [ndn-cxx and its dependencies](https://named-data.net/doc/ndn-cxx/current/INSTALL.html)
 
 ### Build
 
-To build PSync from the source:
+To build PSync from source:
 
     ./waf configure
     ./waf
@@ -43,5 +31,23 @@
 To build on memory constrained platform, please use `./waf -j1` instead of `./waf`. The
 command will disable parallel compilation.
 
-If configured with tests: `./waf configure --with-tests`), the above commands will also
-generate unit tests in `./build/unit-tests`
+If configured with tests (`./waf configure --with-tests`), the above commands will also
+generate unit tests that can be run with `./build/unit-tests`.
+
+## Reporting bugs
+
+Please submit any bug reports or feature requests to the
+[PSync issue tracker](https://redmine.named-data.net/projects/psync/issues).
+
+## Contributing
+
+We greatly appreciate contributions to the PSync code base, provided that they are
+licensed under the LGPL 3.0+ or a compatible license (see below).
+If you are new to the NDN software community, please read the
+[Contributor's Guide](https://github.com/named-data/.github/blob/master/CONTRIBUTING.md)
+to get started.
+
+## License
+
+PSync is an open source project licensed under the LGPL version 3.
+See [`COPYING.md`](COPYING.md) for more information.
diff --git a/docs/conf.py b/docs/conf.py
index 425f489..2ec076b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,36 +1,52 @@
 # -*- coding: utf-8 -*-
 #
-# PSync - Named Data Networking Forwarding Daemon documentation build configuration file, created by
-# sphinx-quickstart on Sun Apr  6 19:58:22 2014.
+# Configuration file for the Sphinx documentation builder.
 #
-# This file is execfile()d with the current directory set to its
-# containing dir.
-#
-# Note that not all possible configuration values are present in this
-# autogenerated file.
-#
-# All configuration values have a default; values that are commented out
-# serve to show the default.
+# This file only contains a selection of the most common options. For a full
+# list see the documentation:
+# http://www.sphinx-doc.org/en/master/config
 
-import sys
-import os
-import re
-import datetime
+# -- Path setup --------------------------------------------------------------
 
 # If extensions (or modules to document with autodoc) are in another directory,
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
-sys.path.insert(0, os.path.abspath('.'))
+#
+# import os
+import sys
+# sys.path.insert(0, os.path.abspath('.'))
 
-# -- General configuration ------------------------------------------------
+
+# -- Project information -----------------------------------------------------
+
+project = u'PSync: Full/Partial Synchronization Protocol for NDN'
+copyright = u'Copyright © 2018-2020 Named Data Networking Project.'
+author = u'Named Data Networking Project'
+
+# The short X.Y version
+#version = ''
+
+# The full version, including alpha/beta/rc tags
+#release = ''
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%Y-%m-%d'
+
+
+# -- General configuration ---------------------------------------------------
 
 # If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
+#
+needs_sphinx = '1.1'
 
 # Add any Sphinx extension module names here, as strings. They can be
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
 extensions = [
+    'sphinx.ext.extlinks',
     'sphinx.ext.todo',
 ]
 
@@ -39,221 +55,85 @@
         __import__(extension)
         extensions.append(extension)
     except ImportError:
-        sys.stderr.write("Extension '%s' in not available. "
+        sys.stderr.write("Extension '%s' not found. "
                          "Some documentation may not build correctly.\n" % extension)
-        sys.stderr.write("To install, use \n"
-                         "  sudo pip install %s\n" % extension.replace('.', '-'))
 
-if sys.version_info[0] >= 3:
-    addExtensionIfExists('sphinxcontrib.doxylink')
-
-# sphinxcontrib.googleanalytics is currently not working with the latest version of sphinx
-# if os.getenv('GOOGLE_ANALYTICS', None):
-#     addExtensionIfExists('sphinxcontrib.googleanalytics')
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['_templates']
-
-# The suffix of source filenames.
-source_suffix = '.rst'
-
-# The encoding of source files.
-#source_encoding = 'utf-8-sig'
+addExtensionIfExists('sphinxcontrib.doxylink')
 
 # The master toctree document.
 master_doc = 'index'
 
-# General information about the project.
-project = u'PSync: A Synchronization Protocol for NDN'
-copyright = u'2018-{}, Named Data Networking Project'.format(datetime.date.today().year)
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#language = None
-
-# There are two options for replacing |today|: either, you set today to some
-# non-false value, then it is used:
-#today = ''
-# Else, today_fmt is used as the format for a strftime call.
-#today_fmt = '%B %d, %Y'
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path.
 exclude_patterns = []
 
-# The reST default role (used for this markup: `text`) to use for all
-# documents.
-#default_role = None
 
-# If true, '()' will be appended to :func: etc. cross-reference text.
-#add_function_parentheses = True
-
-# If true, the current module name will be prepended to all description
-# unit titles (such as .. function::).
-#add_module_names = True
-
-# If true, sectionauthor and moduleauthor directives will be shown in the
-# output. They are ignored by default.
-#show_authors = False
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = 'sphinx'
-
-# A list of ignored prefixes for module index sorting.
-#modindex_common_prefix = []
-
-# If true, keep warnings as "system message" paragraphs in the built documents.
-#keep_warnings = False
-
-
-# -- Options for HTML output ----------------------------------------------
+# -- Options for HTML output -------------------------------------------------
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-# html_theme = 'default'
+#
 html_theme = 'named_data_theme'
 
-# Theme options are theme-specific and customize the look and feel of a theme
-# further.  For a list of options available for each theme, see the
-# documentation.
-#html_theme_options = {}
-
 # Add any paths that contain custom themes here, relative to this directory.
-html_theme_path = ['./']
-
-# The name for this set of Sphinx documents.  If None, it defaults to
-# "<project> v<release> documentation".
-#html_title = None
-
-# A shorter title for the navigation bar.  Default is the same as html_title.
-#html_short_title = None
-
-# The name of an image file (relative to this directory) to place at the top
-# of the sidebar.
-#html_logo = None
-
-# The name of an image file (within the static path) to use as favicon of the
-# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
-# pixels large.
-#html_favicon = None
+html_theme_path = ['.']
 
 # Add any paths that contain custom static files (such as style sheets) here,
 # relative to this directory. They are copied after the builtin static files,
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 
-# Add any extra paths that contain custom files (such as robots.txt or
-# .htaccess) here, relative to this directory. These files are copied
-# directly to the root of the documentation.
-#html_extra_path = []
 
-# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
-# using the given strftime format.
-#html_last_updated_fmt = '%b %d, %Y'
-
-# If true, SmartyPants will be used to convert quotes and dashes to
-# typographically correct entities.
-#html_use_smartypants = True
-
-# Custom sidebar templates, maps document names to template names.
-#html_sidebars = {}
-
-# Additional templates that should be rendered to pages, maps page names to
-# template names.
-#html_additional_pages = {}
-
-# If false, no module index is generated.
-#html_domain_indices = True
-
-# If false, no index is generated.
-#html_use_index = True
-
-# If true, the index is split into individual pages for each letter.
-#html_split_index = False
-
-# If true, links to the reST sources are added to the pages.
-#html_show_sourcelink = True
-
-# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
-#html_show_sphinx = True
-
-# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
-#html_show_copyright = True
-
-# If true, an OpenSearch description file will be output, and all pages will
-# contain a <link> tag referring to it.  The value of this option must be the
-# base URL from which the finished HTML is served.
-#html_use_opensearch = ''
-
-# This is the file name suffix for HTML files (e.g. ".xhtml").
-html_file_suffix = ".html"
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'PSync-docs'
-
-
-# -- Options for LaTeX output ---------------------------------------------
+# -- Options for LaTeX output ------------------------------------------------
 
 latex_elements = {
-# The paper size ('letterpaper' or 'a4paper').
-#'papersize': 'letterpaper',
+    # The paper size ('letterpaper' or 'a4paper').
+    #
+    # 'papersize': 'letterpaper',
 
-# The font size ('10pt', '11pt' or '12pt').
-#'pointsize': '10pt',
+    # The font size ('10pt', '11pt' or '12pt').
+    #
+    # 'pointsize': '10pt',
 
-# Additional stuff for the LaTeX preamble.
-#'preamble': '',
+    # Additional stuff for the LaTeX preamble.
+    #
+    # 'preamble': '',
+
+    # Latex figure (float) alignment
+    #
+    # 'figure_align': 'htbp',
 }
 
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title,
 #  author, documentclass [howto, manual, or own class]).
 latex_documents = [
-  ('index', 'PSync-docs.tex', u'Full/Partial Synchronization Protocol in NDN',
-   u'Named Data Networking Project', 'manual'),
+    ('index', 'PSync-docs.tex', u'Full/Partial Synchronization Protocol for NDN',
+     author, 'manual'),
 ]
 
-# The name of an image file (relative to this directory) to place at the top of
-# the title page.
-#latex_logo = None
 
-# For "manual" documents, if this is true, then toplevel headings are parts,
-# not chapters.
-#latex_use_parts = False
-
-# If true, show page references after internal links.
-#latex_show_pagerefs = False
-
-# If true, show URL addresses after external links.
-#latex_show_urls = False
-
-# Documents to append as an appendix to all manuals.
-#latex_appendices = []
-
-# If false, no module index is generated.
-#latex_domain_indices = True
-
-
-# -- Options for manual page output ---------------------------------------
+# -- Options for manual page output ------------------------------------------
 
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
 ]
 
-
 # If true, show URL addresses after external links.
-man_show_urls = True
+#man_show_urls = True
 
 
-# ---- Custom options --------
+# -- Custom options ----------------------------------------------------------
 
 doxylink = {
-  'PSync' : ('PSync.tag', 'doxygen/'),
+    'PSync': ('PSync.tag', 'doxygen/'),
 }
 
-if os.getenv('GOOGLE_ANALYTICS', None):
-    googleanalytics_id = os.environ['GOOGLE_ANALYTICS']
-    googleanalytics_enabled = True
-
-redmine_project_url = "https://redmine.named-data.net/"
+extlinks = {
+    'issue': ('https://redmine.named-data.net/issues/%s', 'issue #'),
+}
diff --git a/docs/doxygen.conf.in b/docs/doxygen.conf.in
index 1c819d0..409e6a4 100644
--- a/docs/doxygen.conf.in
+++ b/docs/doxygen.conf.in
@@ -2054,7 +2054,7 @@
                          PSYNC_PUBLIC_WITH_TESTS_ELSE_PROTECTED=protected \
                          PSYNC_PUBLIC_WITH_TESTS_ELSE_PRIVATE=private \
                          PSYNC_PROTECTED_WITH_TESTS_ELSE_PRIVATE=private \
-                         PSYNC_VIRTUAL_WITH_TESTS
+                         PSYNC_VIRTUAL_WITH_TESTS=
 
 # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
 # tag can be used to specify a list of macro names that should be expanded. The
diff --git a/waf b/waf
index 7ceee16..a1c5c96 100755
--- a/waf
+++ b/waf
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 # encoding: latin-1
 # Thomas Nagy, 2005-2018
 #