wscript: add version to sphinx and manpages
authorPaul Brossier <piem@piem.org>
Tue, 3 Jan 2017 16:38:27 +0000 (17:38 +0100)
committerPaul Brossier <piem@piem.org>
Tue, 3 Jan 2017 16:38:27 +0000 (17:38 +0100)
wscript

diff --git a/wscript b/wscript
index 86517d6..bc7cdf5 100644 (file)
--- a/wscript
+++ b/wscript
@@ -411,6 +411,7 @@ def txt2man(bld):
         from waflib import TaskGen
         if 'MANDIR' not in bld.env:
             bld.env['MANDIR'] = bld.env['DATAROOTDIR'] + '/man'
+        bld.env.VERSION = VERSION
         rule_str = '${TXT2MAN} -t `basename ${TGT} | cut -f 1 -d . | tr a-z A-Z`'
         rule_str += ' -r ${PACKAGE}\\ ${VERSION} -P ${PACKAGE}'
         rule_str += ' -v ${PACKAGE}\\ User\\\'s\\ manual'
@@ -440,8 +441,9 @@ def sphinx(bld):
     # build documentation from source files using sphinx-build
     # note: build in ../doc/_build/html, otherwise waf wont install unsigned files
     if bld.env['SPHINX']:
+        bld.env.VERSION = VERSION
         bld( name = 'sphinx',
-                rule = '${SPHINX} -b html -a -q `dirname ${SRC}` `dirname ${TGT}`',
+                rule = '${SPHINX} -b html -D release=${VERSION} -D version=${VERSION} -a -q `dirname ${SRC}` `dirname ${TGT}`',
                 source = 'doc/conf.py',
                 target = '../doc/_build/html/index.html')
         bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc/sphinx',