<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>
Amar Takhar pushed to branch master
at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/10a79acccc19a11932760764d87de0f16d3a96b3">10a79acc</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2016-01-26T15:44:01-05:00</i>
</div>
<pre class='commit-message'>Add support for a 'Release mode'

Steps to use:
  1. Build as normal with manpages enabled.
  2. Edit wscript and change NTPS_RELEASE to True
  3. run 'make dist'

This will do a two things:

  1. Remove dependency on Bison and include generated files
  2. Include prebuilt manpages and remove dependency on asciidoc

This is most important for #1 as we can ship our pretested generated files
removing users using the tarball from having a buggy version of Bison.

Having prebuilt manpages is good for those who don't want to deal with asciidoc
on smaller systems.  It also makes things easier for packaging on some systems.</pre>
</li>
</ul>
<h4>4 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
ntpd/wscript
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
pylib/configure.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
pylib/waf.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
wscript
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/10a79acccc19a11932760764d87de0f16d3a96b3#diff-0'>
<strong>
ntpd/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/wscript
</span><span style="color: #aaaaaa">@@ -3,29 +3,29 @@ def build(ctx):
</span>   srcnode = ctx.srcnode.abspath()
        bldnode = ctx.bldnode.abspath()
 
<span style="color: #000000;background-color: #ffdddd">-
</span>   if ctx.variant == "host":
 
<span style="color: #000000;background-color: #ffdddd">-                bison_source = [
-                       "ntp_parser.y"
-               ]
-
-               ctx(
-                       target          = "bison_obj",
-                       features        = "c src_include bld_include libisc_include",
-                       source          = bison_source,
-                       includes    = [
-                                                       "%s/ntpd/" % srcnode,
-                                                       "%s/" % ctx.bldnode.parent.abspath()
</span><span style="color: #000000;background-color: #ddffdd">+           if not ctx.env.NTPS_RELEASE:
+                       bison_source = [
+                               "ntp_parser.y"
</span>                   ]
<span style="color: #000000;background-color: #ffdddd">-                )
</span> 
<span style="color: #000000;background-color: #ffdddd">-                ctx.add_group() # Generate Bison files first.
</span><span style="color: #000000;background-color: #ddffdd">+                   ctx(
+                               target          = "bison_obj",
+                               features        = "c src_include bld_include libisc_include",
+                               source          = bison_source,
+                               includes    = [
+                                                               "%s/ntpd/" % srcnode,
+                                                               "%s/" % ctx.bldnode.parent.abspath()
+                               ]
+                       )
+
+                       ctx.add_group() # Generate Bison files first.
</span> 
 
                keyword_gen_source = [
                        "keyword-gen.c",
<span style="color: #000000;background-color: #ffdddd">-         ]
</span><span style="color: #000000;background-color: #ddffdd">+           ]
</span> 
                ctx(
                        target      = "keyword-gen",
<span style="color: #aaaaaa">@@ -81,7 +81,8 @@ def build(ctx):
</span>   ctx(
                target          = "ntpd_lib",
                features        = "c cstlib",
<span style="color: #000000;background-color: #ffdddd">-                use                     = "libntpd_obj bison_obj",
</span><span style="color: #000000;background-color: #ddffdd">+           use                     = "libntpd_obj",
+#              use                     = "libntpd_obj bison_obj",
</span>   )
 
 
<span style="color: #aaaaaa">@@ -116,10 +117,11 @@ def build(ctx):
</span>           "ntp_io.c",
                "ntp_scanner.c",
                "ntpd.c",
<span style="color: #000000;background-color: #ffdddd">-                ctx.bldnode.parent.find_node("host/ntpd/ntp_parser.tab.c")
</span><span style="color: #000000;background-color: #ddffdd">+           ctx.bldnode.parent.find_node("host/ntpd/ntp_parser.tab.c") if not ctx.env.NTPS_RELEASE else "ntp_parser.tab.c"
</span>   ]
 
 
<span style="color: #000000;background-color: #ddffdd">+
</span>   # XXX: This really sucks, we need to get rid of all these refclock
        #      defines littered everywhere and segment it to their own source files.
        refclock_define = []
<span style="color: #aaaaaa">@@ -137,7 +139,8 @@ def build(ctx):
</span>           target          = "ntpd",
                features        = "c rtems_trace cprogram bld_include src_include libisc_include libisc_pthread_include ntp_version",
                source          = ntpd_source,
<span style="color: #000000;background-color: #ffdddd">-                use                     = "libntpd_obj bison_obj isc ntp sodium opts OSSAUDIO M parse GCC_S RT CAP THR PTHREAD CRYPTO DNS_SD DNS_SD_INCLUDES %s" % use_refclock,
</span><span style="color: #000000;background-color: #ddffdd">+           use                     = "libntpd_obj isc ntp sodium opts OSSAUDIO M parse GCC_S RT CAP THR PTHREAD CRYPTO DNS_SD DNS_SD_INCLUDES %s" % use_refclock,
+#              use                     = "libntpd_obj bison_obj isc ntp sodium opts OSSAUDIO M parse GCC_S RT CAP THR PTHREAD CRYPTO DNS_SD DNS_SD_INCLUDES %s" % use_refclock,
</span>           includes        = [
                                                "%s/host/ntpd/" % ctx.bldnode.parent.abspath(),
                                                "%s/ntpd/" % srcnode,
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/10a79acccc19a11932760764d87de0f16d3a96b3#diff-1'>
<strong>
pylib/configure.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/configure.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/configure.py
</span><span style="color: #aaaaaa">@@ -18,7 +18,9 @@ def cmd_configure(ctx):
</span>   ctx.setenv('host', ctx.env.derive())
 
        ctx.load('compiler_c')
<span style="color: #000000;background-color: #ffdddd">-        ctx.load('bison')
</span><span style="color: #000000;background-color: #ddffdd">+
+       if not ctx.env.NTPS_RELEASE:
+               ctx.load('bison')
</span> 
        for opt in opt_map:
                ctx.env[opt] = opt_map[opt]
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/10a79acccc19a11932760764d87de0f16d3a96b3#diff-2'>
<strong>
pylib/waf.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/waf.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/waf.py
</span><span style="color: #aaaaaa">@@ -56,6 +56,10 @@ def manpage_subst_fun(task, text):
</span> @conf
 def manpage(ctx, section, source):
 
<span style="color: #000000;background-color: #ddffdd">+        if ctx.env.NTPS_RELEASE:
+               ctx.install_files("${PREFIX}/man%s/" % section, source.replace("-man.txt", ".%s" % section))
+               return
+
</span>   if (not ctx.env.BIN_A2X) or ctx.env.DISABLE_MANPAGE:
                return
 
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/10a79acccc19a11932760764d87de0f16d3a96b3#diff-3'>
<strong>
wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/wscript
</span><span style="color: #aaaaaa">@@ -4,6 +4,10 @@ from waflib import Context, Errors
</span> from waflib import Scripting
 from waflib.Logs import pprint
 
<span style="color: #000000;background-color: #ddffdd">+config = {
+       "NTPS_RELEASE": False # Set to 'True' if this is a release
+}
+
</span> out="build"
 
 from pylib.configure import cmd_configure
<span style="color: #aaaaaa">@@ -23,16 +27,49 @@ def parse_version():
</span>                 "NTPS_VERSION_REV" : int(rev)
         }
 
<span style="color: #000000;background-color: #ffdddd">-config = parse_version()
</span><span style="color: #000000;background-color: #ddffdd">+config.update(parse_version())
</span> 
 def dist(ctx):
<span style="color: #000000;background-color: #ffdddd">-        ctx.base_name = "ntpsec-%d.%d.%d" % \
-                        (config["NTPS_VERSION_MAJOR"], \
-                         config["NTPS_VERSION_MINOR"], \
-                         config["NTPS_VERSION_REV"])
-        if ctx.options.build_version_tag:
-                ctx.base_name = ctx.base_name + "-" + \
-                                ctx.options.build_version_tag
</span><span style="color: #000000;background-color: #ddffdd">+           from os import path
+               from shutil import copyfile
+               files_man = []
+
+               if not config["NTPS_RELEASE"]:
+                       ctx.fatal("NTPS_RELEASE must be set to True")
+
+
+               # XXX: Redo to not use globs.
+               bldnode = ctx.path.make_node(out)
+               for section in [1, 5, 8]:
+                       files_man += bldnode.ant_glob("**/*.%d" % section)
+
+               # Need a more reliable check.
+               if not files_man:
+                       ctx.fatal("You must configure and build first with NTPS_RELEASE set to false")
+
+               for man in files_man:
+                       src = man.abspath()
+                       dst = src.replace("%s/main/" % bldnode.abspath(), "")
+                       print "Copying %s -> %s" % (src, dst)
+                       copyfile(src, dst)
+
+               files = [
+                       ("build/host/ntpd/ntp_parser.tab.c", "ntpd/ntp_parser.tab.c"),
+                       ("build/host/ntpd/ntp_parser.tab.h", "ntpd/ntp_parser.tab.h")
+               ]
+
+               for src, dst in files:
+                       if not path.exists(src):
+                               ctx.fatal("%s doesn't exist please configure and build first.  NTPS_RELEASE must be set to False" % src)
+                       print "Copying %s -> %s" % (src, dst)
+                       copyfile(src, dst)
+
+               ctx.base_name = "ntpsec-%d.%d.%d" % \
+                                               (config["NTPS_VERSION_MAJOR"], \
+                                               config["NTPS_VERSION_MINOR"], \
+                                               config["NTPS_VERSION_REV"])
+               if ctx.options.build_version_tag:
+                       ctx.base_name = "%s-%s" % (ctx.base_name, ctx.options.build_version_tag)
</span> 
 def options(ctx):
        ctx.load("compiler_c")
<span style="color: #aaaaaa">@@ -86,6 +123,7 @@ def options(ctx):
</span> 
 
 def configure(ctx):
<span style="color: #000000;background-color: #ddffdd">+        ctx.env.NTPS_RELEASE = config["NTPS_RELEASE"]
</span>   ctx.env.NTPS_VERSION_MAJOR = config["NTPS_VERSION_MAJOR"]
        ctx.env.NTPS_VERSION_MINOR = config["NTPS_VERSION_MINOR"]
        ctx.env.NTPS_VERSION_REV = config["NTPS_VERSION_REV"]
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/10a79acccc19a11932760764d87de0f16d3a96b3">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/10a79acccc19a11932760764d87de0f16d3a96b3"}}</script>
</p>
</div>
</body>
</html>