1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-build: Split dist() target to generate manpages separately

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12595

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2017-02-21 22:30:30 +11:00 committed by Martin Schwenke
parent 646917ec07
commit 5005362122

View File

@ -957,7 +957,27 @@ def show_version(ctx):
print VERSION
def dist():
def manpages(ctx):
BASE_URL = 'http://docbook.sourceforge.net/release/xsl/current'
MAN_XSL = '%s/manpages/docbook.xsl' % BASE_URL
HTML_XSL = '%s/html/docbook.xsl' % BASE_URL
CMD_TEMPLATE = 'xsltproc --xinclude -o %s --nonet %s %s'
manpages = manpages_binary + manpages_misc + manpages_etcd + manpages_ceph
for t in manpages:
cmd = CMD_TEMPLATE % ('doc/%s' % t, MAN_XSL, 'doc/%s.xml' % t)
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0:
print('Command %s failed with exit status %d' % (cmd, ret))
sys.exit(ret)
cmd = CMD_TEMPLATE % ('doc/%s.html' % t, HTML_XSL, 'doc/%s.xml' % t)
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0:
print('Command %s failed with exit status %d' % (cmd, ret))
sys.exit(ret)
def distonly(ctx):
samba_dist.DIST_FILES('VERSION:VERSION', extend=True)
t = 'include/ctdb_version.h'
@ -979,24 +999,8 @@ def dist():
sys.exit(ret)
samba_dist.DIST_FILES('ctdb/%s:%s' % (t, t), extend=True)
BASE_URL = 'http://docbook.sourceforge.net/release/xsl/current'
MAN_XSL = '%s/manpages/docbook.xsl' % BASE_URL
HTML_XSL = '%s/html/docbook.xsl' % BASE_URL
CMD_TEMPLATE = 'xsltproc --xinclude -o %s --nonet %s %s'
manpages = manpages_binary + manpages_misc + manpages_etcd + manpages_ceph
for t in manpages:
cmd = CMD_TEMPLATE % ('doc/%s' % t, MAN_XSL, 'doc/%s.xml' % t)
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0:
print('Command %s failed with exit status %d' % (cmd, ret))
sys.exit(ret)
cmd = CMD_TEMPLATE % ('doc/%s.html' % t, HTML_XSL, 'doc/%s.xml' % t)
ret = samba_utils.RUN_COMMAND(cmd)
if ret != 0:
print('Command %s failed with exit status %d' % (cmd, ret))
sys.exit(ret)
samba_dist.DIST_FILES('ctdb/doc/%s:doc/%s' % (t, t), extend=True)
samba_dist.DIST_FILES('ctdb/doc/%s.html:doc/%s.html' % (t, t),
extend=True)
@ -1004,6 +1008,12 @@ def dist():
samba_dist.dist()
def dist():
import Scripting
Scripting.commands.append('manpages')
Scripting.commands.append('distonly')
def rpmonly(ctx):
opts = os.getenv('RPM_OPTIONS') or ''
cmd = 'rpmbuild -ta --clean --rmsource %s ctdb-%s.tar.gz' % (opts, VERSION)