[Git][NTPsec/ntpsec][master] Skip build/install of ntploggps if python gps module isn't found

Matt Selsky gitlab at mg.gitlab.com
Tue Dec 18 05:45:31 UTC 2018


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
19bd4641 by Matt Selsky at 2018-12-18T04:30:41Z
Skip build/install of ntploggps if python gps module isn't found

We require 3.18+ since that's when gps.isfinite() was added

Also add a CI target that has a new enough 'gps' module so that we can verify
that our tests work.

- - - - -


3 changed files:

- .gitlab-ci.yml
- pylib/wscript
- wscript


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -369,6 +369,16 @@ fedora-rawhide-refclocks:
   tags:
     - gitlab-org
 
+fedora-rawhide-refclocks-gpsd:
+  <<: *job_definition
+  image: registry.fedoraproject.org/fedora:rawhide
+  allow_failure: true
+  script:
+    - yum -y install bison gcc openssl-devel libcap-devel pps-tools-devel python3-devel python3-gpsd
+    - python3 ./waf configure --refclock=all build
+  tags:
+    - gitlab-org
+
 python3:
   <<: *job_definition
   image: python:3


=====================================
pylib/wscript
=====================================
@@ -16,6 +16,12 @@ def configure(conf):
     except conf.errors.ConfigurationError:
         pprint("YELLOW", "WARNING: ntpmon will not be built/installed since "
                "python curses module was not found")
+    try:
+        conf.check_python_module('gps', condition="ver >= num(3, 18)")
+        conf.env['PYTHON_GPS'] = True
+    except conf.errors.ConfigurationError:
+        pprint("YELLOW", "WARNING: ntploggps will not be built/installed since "
+               "python gps module >= 3.18 was not found")
 
 
 def build(ctx):


=====================================
wscript
=====================================
@@ -990,7 +990,6 @@ def afterparty(ctx):
 
 
 python_scripts = [
-    "ntpclients/ntploggps.py",
     "ntpclients/ntpdig.py",
     "ntpclients/ntpkeygen.py",
     "ntpclients/ntpq.py",
@@ -1040,6 +1039,8 @@ def build(ctx):
 
     if ctx.env['PYTHON_CURSES']:
         python_scripts.append("ntpclients/ntpmon.py")
+    if ctx.env['PYTHON_GPS']:
+        python_scripts.append("ntpclients/ntploggps.py")
 
     # Make sure the python scripts compile, but don't install them
     ctx(
@@ -1062,7 +1063,8 @@ def build(ctx):
     if ctx.cmd == 'clean':
         afterparty(ctx)
 
-    ctx.manpage(1, "ntpclients/ntploggps-man.txt")
+    if ctx.env['PYTHON_GPS']:
+        ctx.manpage(1, "ntpclients/ntploggps-man.txt")
     ctx.manpage(1, "ntpclients/ntpdig-man.txt")
     if ctx.env['PYTHON_CURSES']:
         ctx.manpage(1, "ntpclients/ntpmon-man.txt")



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

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/19bd46413d36171c759ee03d3f4c15bec4176fb7
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/20181218/53e16b9f/attachment-0001.html>


More information about the vc mailing list