install: rewrite install script

* set dependency versions: PPA, git repository & commit
* separate download and build+install steps
* don't reinstall package if it's already installed

refs #4630

Change-Id: I966fac5e1633cbabf78ce20cd151a35618efc345
diff --git a/docs/build.sh b/docs/build.sh
new file mode 100755
index 0000000..1b1594a
--- /dev/null
+++ b/docs/build.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+# -*- Mode:bash; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+#
+# Copyright (C) 2015-2021, The University of Memphis,
+#                          Arizona Board of Regents,
+#                          Regents of the University of California.
+#
+# This file is part of Mini-NDN.
+# See AUTHORS.md for a complete list of Mini-NDN authors and contributors.
+#
+# Mini-NDN is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# Mini-NDN is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Mini-NDN, e.g., in COPYING.md file.
+# If not, see <http://www.gnu.org/licenses/>.
+
+set -eo pipefail
+cd "$(dirname "${BASH_SOURCE[0]}")"
+
+PIP='python3 -m pip'
+
+for PIPPKG in sphinx sphinx_rtd_theme; do
+  if ! $PIP show $PIPPKG >/dev/null; then
+    sudo $PIP install $PIPPKG
+  fi
+done
+
+make clean html