[Git][NTPsec/ntpsec][master] Only install ntpmon script and man page if we find python curses module

Gary E. Miller gitlab at mg.gitlab.com
Fri Nov 30 05:48:56 UTC 2018


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
f9c5b37d by Matt Selsky at 2018-11-30T05:08:51Z
Only install ntpmon script and man page if we find python curses module

- - - - -


2 changed files:

- pylib/wscript
- wscript


Changes:

=====================================
pylib/wscript
=====================================
@@ -1,3 +1,6 @@
+from waflib.Logs import pprint
+
+
 def options(opt):
     opt.load('python')
 
@@ -7,6 +10,12 @@ def configure(conf):
     if not conf.env.ENABLE_CROSS:
         conf.check_python_version((2, 6, 0))
     conf.check_python_headers(features='pyext')  # Extension-only, no embedded
+    try:
+        conf.check_python_module('curses')
+        conf.env['PYTHON_CURSES'] = True
+    except conf.errors.ConfigurationError:
+        pprint("YELLOW", "WARNING: ntpmon will not be built/installed since "
+               "python curses module was not found")
 
 
 def build(ctx):


=====================================
wscript
=====================================
@@ -992,7 +992,6 @@ python_scripts = [
     "ntpclients/ntploggps.py",
     "ntpclients/ntpdig.py",
     "ntpclients/ntpkeygen.py",
-    "ntpclients/ntpmon.py",
     "ntpclients/ntpq.py",
     "ntpclients/ntpsweep.py",
     "ntpclients/ntptrace.py",
@@ -1038,6 +1037,9 @@ def build(ctx):
     ctx.recurse("attic")
     ctx.recurse("tests")
 
+    if ctx.env['PYTHON_CURSES']:
+        python_scripts.append("ntpclients/ntpmon.py")
+
     # Make sure the python scripts compile, but don't install them
     ctx(
         features="py",
@@ -1061,7 +1063,8 @@ def build(ctx):
 
     ctx.manpage(1, "ntpclients/ntploggps-man.txt")
     ctx.manpage(1, "ntpclients/ntpdig-man.txt")
-    ctx.manpage(1, "ntpclients/ntpmon-man.txt")
+    if ctx.env['PYTHON_CURSES']:
+        ctx.manpage(1, "ntpclients/ntpmon-man.txt")
     ctx.manpage(1, "ntpclients/ntpq-man.txt")
     ctx.manpage(1, "ntpclients/ntpsweep-man.txt")
     ctx.manpage(1, "ntpclients/ntptrace-man.txt")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f9c5b37d040033a9a058a61bb6f44aec84cefd9d

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/f9c5b37d040033a9a058a61bb6f44aec84cefd9d
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20181130/79081737/attachment-0001.html>


More information about the vc mailing list