Skip to content

Commit 80c451e

Browse files
committed
setup: Make man page generation optional
rst2man doesn't appear to be in /usr/bin via pip packages, so make manpage building optional Signed-off-by: Cole Robinson <[email protected]>
1 parent 16058de commit 80c451e

3 files changed

Lines changed: 7 additions & 18 deletions

File tree

python-bugzilla.spec

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,23 +99,10 @@ cp -a . %{py3dir}
9999

100100

101101

102-
%build
103-
%if %{with python3}
104-
pushd %{py3dir}
105-
%{__python3} setup.py build
106-
popd
107-
%endif
108-
109-
%if %{with python2}
110-
%{__python2} setup.py build
111-
%endif
112-
113-
114-
115102
%install
116103
%if %{with python3}
117104
pushd %{py3dir}
118-
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
105+
%{__python3} setup.py install -O1 --root %{buildroot}
119106

120107
%if %{with python2}
121108
rm %{buildroot}/usr/bin/bugzilla
@@ -125,7 +112,7 @@ popd
125112
%endif
126113

127114
%if %{with python2}
128-
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
115+
%{__python2} setup.py install -O1 --root %{buildroot}
129116
%endif
130117

131118
# Replace '#!/usr/bin/env python' with '#!/usr/bin/python2'

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
docutils
21
requests

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ def _make_man_pages(self):
9696
print("Generating %s" % newpath)
9797
ret = os.system('rst2man %s > %s' % (path, newpath))
9898
if ret != 0:
99-
raise RuntimeError("Generating '%s' failed." % newpath)
99+
print("Generating '%s' failed." % newpath)
100+
continue
101+
self.distribution.data_files.append(
102+
('share/man/man1', (newpath,)))
100103

101104
def run(self):
102105
self._make_man_pages()
@@ -135,8 +138,8 @@ def _parse_requirements(fname):
135138
'Programming Language :: Python :: 3.7',
136139
],
137140
packages=['bugzilla'],
141+
data_files=[],
138142
entry_points={'console_scripts': ['bugzilla = bugzilla._cli:cli']},
139-
data_files=[('share/man/man1', ['man/bugzilla.1'])],
140143

141144
install_requires=_parse_requirements("requirements.txt"),
142145
tests_require=_parse_requirements("test-requirements.txt"),

0 commit comments

Comments
 (0)