3 %bcond_with doc # build doc (broken)
4 %bcond_with tests # do perform "make test" (broken)
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 Summary: cmd2 - a tool for building interactive command line applications in Python
13 Group: Libraries/Python
14 Source0: https://pypi.python.org/packages/99/18/0bfe8240ffaebd28b1bce5a48170404e32bc1de6e640c8e7f37f1e522edb/cmd2-%{version}.tar.gz
15 # Source0-md5: 9f758f3a6a20f1220d60f6320bb839b3
16 URL: https://pypi.python.org/pypi/cmd2
17 BuildRequires: rpm-pythonprov
18 BuildRequires: rpmbuild(macros) >= 1.714
20 BuildRequires: python-setuptools
22 BuildRequires: python-mock
23 BuildRequires: python-pyparsing >= 2.0.1
24 BuildRequires: python-pyperclip
25 BuildRequires: python-pytest
26 BuildRequires: python-six
30 BuildRequires: python3-setuptools
32 BuildRequires: python3-mock
33 BuildRequires: python3-pyparsing >= 2.0.1
34 BuildRequires: python3-pyperclip
35 BuildRequires: python3-pytest
36 BuildRequires: python3-six
39 BuildRequires: python3-sphinx_rtd_theme
40 BuildRequires: sphinx-pdg-3
43 Requires: python3-pyparsing >= 2.0.1
44 Requires: python3-pyperclip
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 cmd2 is a tool for building interactive command line applications in
51 Python. Its goal is to make it quick and easy for developers to build
52 feature-rich and user-friendly interactive command line applications.
53 It provides a simple API which is an extension of Python's built-in
54 cmd module. cmd2 provides a wealth of features on top of cmd to make
55 your life easier and eliminates much of the boilerplate code which
56 would be necessary when using cmd.
58 %package -n python3-cmd2
59 Summary: cmd2 - a tool for building interactive command line applications in Python
60 Group: Libraries/Python
61 Requires: python3-modules
63 %description -n python3-cmd2
64 cmd2 is a tool for building interactive command line applications in
65 Python. Its goal is to make it quick and easy for developers to build
66 feature-rich and user-friendly interactive command line applications.
67 It provides a simple API which is an extension of Python's built-in
68 cmd module. cmd2 provides a wealth of features on top of cmd to make
69 your life easier and eliminates much of the boilerplate code which
70 would be necessary when using cmd.
73 Summary: API documentation for Python cmd2 module
74 Summary(pl.UTF-8): Dokumentacja API modułu Pythona cmd2
78 API documentation for Pythona cmd2 module.
80 %description apidocs -l pl.UTF-8
81 Dokumentacja API modułu Pythona cmd2.
84 %setup -q -n cmd2-%{version}
88 %py_build %{?with_tests:pytest}
92 %py3_build %{?with_tests:pytest}
95 %{__python3} setup.py build_sphinx
100 rm -rf $RPM_BUILD_ROOT
112 # in case there are examples provided
114 install -d $RPM_BUILD_ROOT%{_examplesdir}/python-cmd2-%{version}
115 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-cmd2-%{version}
116 find $RPM_BUILD_ROOT%{_examplesdir}/python-cmd2-%{version} -name '*.py' \
117 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
120 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-cmd2-%{version}
121 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-cmd2-%{version}
122 find $RPM_BUILD_ROOT%{_examplesdir}/python3-cmd2-%{version} -name '*.py' \
123 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
127 rm -rf $RPM_BUILD_ROOT
131 %defattr(644,root,root,755)
132 %doc CHANGES.md README.md
133 %{py_sitescriptdir}/cmd2.py*
134 %{py_sitescriptdir}/cmd2-%{version}-py*.egg-info
135 %{_examplesdir}/python-cmd2-%{version}
139 %files -n python3-cmd2
140 %defattr(644,root,root,755)
141 %doc CHANGES.md README.md
142 %{py3_sitescriptdir}/cmd2.py
143 %{py3_sitescriptdir}/__pycache__/*
144 %{py3_sitescriptdir}/cmd2-%{version}-py*.egg-info
145 %{_examplesdir}/python3-cmd2-%{version}
150 %defattr(644,root,root,755)
151 %doc docs/_build/html/*