From 3868613c8f8590dd720dfef22088c057b64243bd Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Wed, 15 Feb 2017 21:28:06 +0100 Subject: [PATCH] Generate Apol compressed help file with "setup.py build_qhc" "setup.py build_qhc" invokes qcollectiongenerator on qhc/apol.qhcp, which produces two files: - apol.qhc, a Qt Help Collection file - apol.qch, a Qt Compressed Help file As apol.qhc is merely a set of metadata with a relative link to apol.qch, Qt Assistant requires both files in order to display Apol help. Make "setup.py build_qhc" build both files in setoolsgui/apol/. Moreover '*.qch' needs to be added to package_data in order to install apol.qch. Fixes: https://github.com/TresysTechnology/setools/issues/165 --- .gitignore | 4 ++-- setup.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index c1274f6..007d4c7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,8 +11,8 @@ setools/policyrep/qpol.py *.so # Qt Generated Help files -help/apol.qch -#help/apol.qhc +qhc/apol.qch +qhc/apol.qhc # Generated by tox /.tox diff --git a/setup.py b/setup.py index fa0d7a1..5719dc2 100644 --- a/setup.py +++ b/setup.py @@ -24,13 +24,13 @@ class QtHelpCommand(Command): pass def run(self): - command = ['qcollectiongenerator', 'apol.qhcp', '-o', '../setoolsgui/apol/apol.qhc'] + command = ['qcollectiongenerator', 'qhc/apol.qhcp'] self.announce("Building Qt help files", level=log.INFO) self.announce(' '.join(command), level=log.INFO) - pwd = os.getcwd() - os.chdir("./qhc") subprocess.check_call(command) - os.chdir(pwd) + self.announce("Moving Qt help files to setoolsgui/apol") + os.rename('qhc/apol.qhc', 'setoolsgui/apol/apol.qhc') + os.rename('qhc/apol.qch', 'setoolsgui/apol/apol.qch') class YaccCommand(Command): @@ -182,7 +182,7 @@ setup(name='setools', packages=['setools', 'setools.diff', 'setools.policyrep', 'setoolsgui', 'setoolsgui.apol'], scripts=['apol', 'sediff', 'seinfo', 'seinfoflow', 'sesearch', 'sedta'], data_files=[(join(sys.prefix, 'share/man/man1'), glob.glob("man/*.1"))], - package_data={'': ['*.ui', '*.qhc'], 'setools': ['perm_map']}, + package_data={'': ['*.ui', '*.qhc', '*.qch'], 'setools': ['perm_map']}, ext_modules=ext_py_mods, test_suite='tests', license='GPLv2+, LGPLv2.1+',