Commit f9c5b37d authored by Matt Selsky's avatar Matt Selsky
Browse files

Only install ntpmon script and man page if we find python curses module

parent 2572c03b
Pipeline #38453227 passed with stages
in 19 minutes and 58 seconds
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):
......
......@@ -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")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment