[Git][NTPsec/ntpsec][master] 3 commits: Add --doc flag to buildprep

Eric S. Raymond gitlab at mg.gitlab.com
Tue Mar 28 11:26:32 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
571793b4 by Kenneth Finnegan at 2017-03-28T06:42:11-04:00
Add --doc flag to buildprep

- - - - -
8e6812d0 by Kenneth Finnegan at 2017-03-28T06:42:11-04:00
Add -h,--help,-a,-all,--dry-run options to buildprep

- - - - -
14ef45bb by Kenneth Finnegan at 2017-03-28T06:42:11-04:00
Documentation catchup for buildprep

- - - - -


2 changed files:

- INSTALL
- buildprep


Changes:

=====================================
INSTALL
=====================================
--- a/INSTALL
+++ b/INSTALL
@@ -34,11 +34,12 @@ or *BSD, you will have to install the build prerequisites by hand on
 your system.  Read the buildprep script to get an idea what packages
 are required.
 
-buildprep does not attempt to install either asciidoc or psutils (both
-optional). asciidoc has a huge tail of dependencies and you probably
-don't want it unless you're planning to modify the documentation.
-psutils may require different packages depending on whether your base
-Python version is 2 or 3.
+buildprep does not attempt to install dependencies for optional
+components like ntpviz or building documentation unless asked. See
+buildprep --help for details on available options.  asciidoc has a
+huge tail of dependencies and you probably don't want it unless you're
+planning to modify the documentation.  psutils may require different
+packages depending on whether your base Python version is 2 or 3.
 
 === Details ===
 


=====================================
buildprep
=====================================
--- a/buildprep
+++ b/buildprep
@@ -5,39 +5,62 @@
 # Use the -n option to dry-run this command, showing what would be done
 # without actually doing it
 
-cat <<EOF 
-# Preparing your system for ntpsec source build...
-# This script presently knows about:
-#   CentOS, Debian, Fedora, Gentoo, SLES and Ubuntu
-# If you are running something else, such as MacOS or Solaris, please
-# follow the directions for by-hand installation in INSTALL.
-#
-EOF
-
 # Set the defaults
 DRYRUN="no"
 NTPVIZ="no"
+DOC="no"
 
 # Loop through option flags
 for optflag in "$@"
 do
 	case "$optflag" in
-	 -n)
+	 -h|--help)
+		cat <<EOF
+$0 - prepare your system for an NTPsec source build
+
+  Options:
+    -h --help    Show usage information and exit
+    -n --dry-run Only show what would be done instead of doing it
+       --ntpviz  Install dependencies for ntpviz tool
+       --doc     Install dependencies for building documentation
+    -a --all     Install all possible dependencies
+EOF
+		exit 0
+		;;
+	 -n|--dry-run)
 		DRYRUN="yes"
 		;;
 	 --ntpviz)
 		NTPVIZ="yes"
 		;;
+	 --doc)
+		DOC="yes"
+		;;
+	 -a|--all)
+		NTPVIZ="yes"
+		DOC="yes"
+		;;
 	 *)
-		echo "# Unknown argument: $optflag"
+		echo "# WARNING: Unknown argument: $optflag"
+		echo "#"
 		;;
 	esac
 done
 
+cat <<EOF
+# Preparing your system for ntpsec source build...
+# This script presently knows about:
+#   CentOS, Debian, Fedora, Gentoo, SLES and Ubuntu
+# If you are running something else, such as MacOS or Solaris, please
+# read the source for this buildprep script to get an idea of what packages
+# are required.
+#
+EOF
+
 if [ "$DRYRUN" = "yes" ]
 then
 	do=echo
-	echo "# Run this without -n, as root, for actual installation.\n#"
+	echo "# Run this without -n|--dry-run, as root, for actual installation.\n#"
 else
 	do=""
 	if [ "$(id -u)" != 0 ]
@@ -176,6 +199,24 @@ ntpviz () {
     esac
 }
 
+doc () {
+	# prerequisites to build documentation
+	case $installer in
+	 apt)
+		$install asciidoc
+		;;
+	 emerge)
+		$install app-text/asciidoc
+		;;
+	 yum|dnf)
+		$install asciidoc
+		;;
+	 yast|zypper)
+		$install asciidoc
+		;;
+	esac
+}
+
 # Main sequence
 daemon
 tools
@@ -188,5 +229,13 @@ else
 	echo "# Skipping ntpviz dependencies [--ntpviz]"
 fi
 
+if [ "$DOC" = "yes" ]
+then
+	doc
+else
+	echo ""
+	echo "# Skipping documentation dependencies [--doc]"
+fi
+
 echo ""
 echo "# Done."



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/092a20e264255b7db40175235055b18a04588ffd...14ef45bbab370038dc5662b2fd6c6cd5bc92c691
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170328/4b225fa5/attachment.html>


More information about the vc mailing list