[Git][NTPsec/ntpsec][master] 3 commits: Begin functional factoring of buildprep logic.
Eric S. Raymond
gitlab at mg.gitlab.com
Wed Mar 15 14:13:14 UTC 2017
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
57ce9359 by Eric S. Raymond at 2017-03-15T10:12:36-04:00
Begin functional factoring of buildprep logic.
- - - - -
0932fbe3 by Eric S. Raymond at 2017-03-15T10:12:36-04:00
More buildprep refactoring.
- - - - -
3cb9fbe1 by Eric S. Raymond at 2017-03-15T10:12:36-04:00
Yet more buildprep refactoring.
- - - - -
2 changed files:
- INSTALL
- buildprep
Changes:
=====================================
INSTALL
=====================================
--- a/INSTALL
+++ b/INSTALL
@@ -21,14 +21,18 @@ to run and in addition, the development headers installed to build.
If you are on a Debian or Ubuntu distribution that uses apt-get, or on
a Fedora or RedHat distribution that uses yum or dnf, or a Suse
distribution that uses yast or zypper, or Gentoo, you can use the
-./buildprep script. If you are using other distributions or OSes,
-such as MacOS, Solaris, or BSD, you will have to install the build
-prerequisites by hand on your system.
+./buildprep script.
-Run ./buildprep -n to see what needs to be installed as prerequisites
-on your system. In order that we have a single point of truth about
-package requirements, much information about installable-package names
-that used to live in this file has moved to that script.
+In that case, run ./buildprep -n to see what needs to be installed as
+prerequisites on your system. In order that we have a single point of
+truth about package requirements, much information about
+installable-package names that used to live in this file has moved to
+that script.
+
+If you are using other distributions or OSes, such as MacOS, Solaris,
+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
@@ -46,29 +50,13 @@ Python 2.x, x >= 6, or Python 3.x, x >= 3::
installation and Python dev tools, if your OS makes such a
distinction.
- Some/many OS distros won't find our installed python libraries.
- Your shell will need something like this:
+ Some OS distros won't find our installed python libraries.
+ Your shell may need something like this:
export PYTHONPATH=/usr/local/lib/python2.7/site-packages
CentOS 6 is using python 2.6
export PYTHONPATH=/usr/local/lib/python2.6/site-packages
(I put it in my .bashrc)
-bison::
- Required to build.
- Gentoo package: sys-devel/bison
-
-OpenSSL::
- Required to run and build.
- Enables encryption and authentication.
- Gentoo: dev-libs/openssl
-
-libcap::
- Required on Linux to support dropping root.
- Gentoo package: sys-libs/libcap
-
-gnuplot::
- Required for ntpviz.
-
argparse::
Required for ntpviz when using Python version 2.6
Install with pip: pip install argparse
@@ -82,14 +70,6 @@ psutils::
Gentoo: dev-python/psutil
SLES: python-psutil
-seccomp::
- Optional on Linux to support restricting syscalls
- Gentoo: sys-libs/libseccomp
-
-libdnssd::
- Optional for ntpd. Support for mDNS Service Discovery registration
- Debian: libavahi-compat-libdnssd-dev
-
sys/timepps.h::
If you are building to supply Stratum 1 time service (that is, with
refclocks linked in) you may find that you need the sys/timepps.h
@@ -97,9 +77,6 @@ sys/timepps.h::
This won't be necessary for pure client (Stratum 2 or higher)
installations.
-liberation::
- Optional, improves font quality in ntpviz renderings.
-
asciidoc, a2x::
You will need asciidoc to make HTML and a2x to make manual pages from the
documentation masters. Only required if you configured with --enable-doc.
=====================================
buildprep
=====================================
--- a/buildprep
+++ b/buildprep
@@ -28,26 +28,32 @@ then
exit 1
fi
-installer=""
+inst=""
if emerge --version 2>/dev/null
then
installer=emerge
+ install="$installer -q y"
elif yum version 2>/dev/null
then
installer=yum
+ install="$installer install"
elif dnf --version >/dev/null 2>&1
then
installer=dnf
+ install="$installer install"
elif apt-get --version >/dev/null 2>&1
then
installer=apt
+ install="apt-get install -y"
elif zypper -h >/dev/null 2>&1
then
# OpenSUSE prefers zypper over yast
installer=zypper
+ install="$installer install -y"
elif yast -h >/dev/null 2>&1
then
installer=yast
+ install="$installer --install"
else
installer=unknown
fi
@@ -55,56 +61,108 @@ echo "# Your package installer is ${installer}."
# In order to have a single point of truth about prerequisite package names,
# these package name lists have been *removed* from INSTALL.
-case $installer in
- apt)
- $do apt-get install bison libcap-dev libcap2 libseccomp-dev
- $do apt-get install libssl-dev libssl1.0.0 python-dev
- $do apt-get install libavahi-compat-libdnssd-dev
- $do apt-get install pps-tools
- $do apt-get install fonts-liberation
- distro=`lsb_release -i -s`
- if [ "$distro" = "Ubuntu" ]
- then
- echo "# Looks like an Ubuntu system"
- $do apt-get install gnuplot5
- else
- echo "# Looks like a generic Debian system"
- $do apt-get install gnuplot
- fi
- ;;
- emerge)
- $do emerge -q y media-fonts/liberation-fonts
- $do emerge -q y sci-visualization/gnuplot
- $do emerge -q y net-misc/pps-tools
- ;;
- yum|dnf)
- $do $installer install bison gnuplot libcap libcap-devel
- $do $installer install liberation-fonts-common.noarch
- $do $installer install liberation-mono-fonts.noarch
- $do $installer install liberation-narrow-fonts.noarch
- $do $installer install liberation-sans-fonts.noarch
- $do $installer install liberation-serif-fonts.noarch
- $do $installer install libseccomp-devel openssl-devel openssl-libs
- $do $installer install pps-tools pps-tools-devel python python-devel
- $do $installer install avahi-compat-libdns_sd-devel
- ;;
- yast)
- echo "# SLES versions 12 and earlier do not have pps-tools"
- $do $installer --install basis-devel gnuplot libcap-devel libcap2
- $do $installer --install liberation-fonts libseccomp-devel
- $do $installer --install openssl-libs openssl-devel
- $do $installer --install python-devel
- ;;
- zypper)
- $do zypper install -y gnuplot libcap-devel libcap2
- $do zypper install -y liberation-fonts libseccomp-devel
- $do zypper install -y openssl-devel
- $do zypper install -y python-devel bison
- $do zypper install -y gcc6 gcc6-info gcc6-locale
- echo "# SLES versions 12 and earlier do not have pps-tools"
- $do zypper install -y pps-tools pps-tools-devel
- ;;
-esac
+
+# Build time vs. run time:
+# Build dependencies are marked. You'll need them all when building from a
+# repository copy; the unmarked (run-time) dependencies are information for
+# packagers. Under Gentoo, all dependencies are build dependencies.
+
+# Notes on optional packages:
+# libdnssd is optional for ntpd. Support for mDNS Service Discovery registration
+# libcap (under Linux) enables dropping root and is not strictly required.
+
+daemon () {
+ # Prerequisites to build the daemon: bison, pps-tools, service libraries
+ case $installer in
+ apt)
+ $do $install bison libssl-dev # build
+ $do $install libcap-dev libseccomp-dev # build
+ $do $install libavahi-compat-libdnssd-dev # optional build
+ $do $install libssl1.0.0 libcap2 pps-tools
+ ;;
+ emerge)
+ $do $install sys-libs/libcap sys-libs/libseccomp
+ $do $install sys-devel/bison net-misc/pps-tools
+ ;;
+ yum|dnf)
+ $do $install bison openssl-devel # build
+ $do $install libcap-devel libseccomp-devel # build
+ $do $install pps-tools-devel # build
+ $do $install avahi-compat-libdns_sd-devel # optional build
+ $do $install libcap openssl-libs pps-tools
+ ;;
+ yast)
+ echo "# SLES versions 12 and earlier do not have pps-tools"
+ $do $install basis-devel # build
+ $do $install libcap-devel libseccomp-devel # build
+ $do $install openssl-devel # build
+ $do $install libcap2 openssl-libs
+ ;;
+ zypper)
+ $do $install gcc6 gcc6-info gcc6-locale # build
+ $do $install bison # build
+ $do $install libcap-devel libseccomp-devel # build
+ $do $install openssl-devel # build
+ echo "# SLES versions 12 and earlier do not have pps-tools"
+ $do $install pps-tools-devel # build
+ $do $install pps-tools
+ $do $install libcap2 openssl-libs
+ ;;
+ esac
+}
+
+tools () {
+ # Prerequisites for the client Python tools: python extensions
+ case $installer in
+ apt)
+ $do $install python-dev
+ ;;
+ yum|dnf|yast|zypper)
+ $do $install python-devel
+ ;;
+ esac
+}
+
+ntpviz () {
+ # Prerequisites to use ntpviz: gnuplot and liberation fonts
+ case $installer in
+ apt)
+ distro=`lsb_release -i -s`
+ if [ "$distro" = "Ubuntu" ]
+ then
+ echo "# Looks like an Ubuntu system"
+ $do $install gnuplot5
+ else
+ echo "# Looks like a generic Debian system"
+ $do $install gnuplot
+ fi
+ $do $install fonts-liberation
+ ;;
+ emerge)
+ $do $install sci-visualization/gnuplot
+ $do $install media-fonts/liberation-fonts
+ ;;
+ yum|dnf)
+ $do $install gnuplot
+ $do $install liberation-fonts-common.noarch
+ $do $install liberation-mono-fonts.noarch
+ $do $install liberation-narrow-fonts.noarch
+ $do $install liberation-sans-fonts.noarch
+ $do $install liberation-serif-fonts.noarch
+ ;;
+ yast)
+ $do $install gnuplot liberation-fonts
+ ;;
+ zypper)
+ $do $install gnuplot liberation-fonts
+ ;;
+ esac
+}
+
+# Main sequence
+daemon
+tools
+ntpviz
echo ""
echo "# Done."
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/2933de68de5e079e15d0ef478ef266066903e7b7...3cb9fbe1f21cba547c95ba0cd23708c1a539f838
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170315/21688874/attachment.html>
More information about the vc
mailing list