]> git.pld-linux.org Git - packages/python-cmd2.git/blame - python-cmd2.spec
rebuild with tests and docs
[packages/python-cmd2.git] / python-cmd2.spec
CommitLineData
4142ef01
JK
1#
2# Conditional build:
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
7
8Summary: cmd2 - a tool for building interactive command line applications in Python
9Name: python-cmd2
10Version: 0.7.5
4d591c75 11Release: 8
4142ef01
JK
12License: MIT
13Group: Libraries/Python
14Source0: https://pypi.python.org/packages/99/18/0bfe8240ffaebd28b1bce5a48170404e32bc1de6e640c8e7f37f1e522edb/cmd2-%{version}.tar.gz
15# Source0-md5: 9f758f3a6a20f1220d60f6320bb839b3
16URL: https://pypi.python.org/pypi/cmd2
17BuildRequires: rpm-pythonprov
18BuildRequires: rpmbuild(macros) >= 1.714
19%if %{with python2}
20BuildRequires: python-setuptools
21%if %{with tests}
22BuildRequires: python-mock
23BuildRequires: python-pyparsing >= 2.0.1
24BuildRequires: python-pyperclip
25BuildRequires: python-pytest
26BuildRequires: python-six
27%endif
28%endif
29%if %{with python3}
30BuildRequires: python3-setuptools
31%if %{with tests}
32BuildRequires: python3-mock
33BuildRequires: python3-pyparsing >= 2.0.1
34BuildRequires: python3-pyperclip
35BuildRequires: python3-pytest
36BuildRequires: python3-six
37%endif
38%if %{with doc}
39BuildRequires: python3-sphinx_rtd_theme
40BuildRequires: sphinx-pdg-3
41%endif
42%endif
43Requires: python3-pyparsing >= 2.0.1
44Requires: python3-pyperclip
45Requires: python3-six
46BuildArch: noarch
47BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49%description
50cmd2 is a tool for building interactive command line applications in
51Python. Its goal is to make it quick and easy for developers to build
52feature-rich and user-friendly interactive command line applications.
53It provides a simple API which is an extension of Python's built-in
54cmd module. cmd2 provides a wealth of features on top of cmd to make
55your life easier and eliminates much of the boilerplate code which
56would be necessary when using cmd.
57
58%package -n python3-cmd2
59Summary: cmd2 - a tool for building interactive command line applications in Python
60Group: Libraries/Python
61Requires: python3-modules
62
63%description -n python3-cmd2
64cmd2 is a tool for building interactive command line applications in
65Python. Its goal is to make it quick and easy for developers to build
66feature-rich and user-friendly interactive command line applications.
67It provides a simple API which is an extension of Python's built-in
68cmd module. cmd2 provides a wealth of features on top of cmd to make
69your life easier and eliminates much of the boilerplate code which
70would be necessary when using cmd.
71
72%package apidocs
73Summary: API documentation for Python cmd2 module
74Summary(pl.UTF-8): Dokumentacja API modułu Pythona cmd2
75Group: Documentation
76
77%description apidocs
78API documentation for Pythona cmd2 module.
79
80%description apidocs -l pl.UTF-8
81Dokumentacja API modułu Pythona cmd2.
82
83%prep
84%setup -q -n cmd2-%{version}
85
86%build
87%if %{with python2}
88%py_build %{?with_tests:pytest}
89%endif
90
91%if %{with python3}
92%py3_build %{?with_tests:pytest}
93
94%if %{with doc}
95%{__python3} setup.py build_sphinx
96%endif
97%endif
98
99%install
100rm -rf $RPM_BUILD_ROOT
101
102%if %{with python2}
103%py_install
104
105%py_postclean
106%endif
107
108%if %{with python3}
109%py3_install
110%endif
111
112# in case there are examples provided
113%if %{with python2}
114install -d $RPM_BUILD_ROOT%{_examplesdir}/python-cmd2-%{version}
115cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python-cmd2-%{version}
116find $RPM_BUILD_ROOT%{_examplesdir}/python-cmd2-%{version} -name '*.py' \
117 | xargs sed -i '1s|^#!.*python\b|#!%{__python}|'
118%endif
119%if %{with python3}
120install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-cmd2-%{version}
121cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-cmd2-%{version}
122find $RPM_BUILD_ROOT%{_examplesdir}/python3-cmd2-%{version} -name '*.py' \
123 | xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
124%endif
125
126%clean
127rm -rf $RPM_BUILD_ROOT
128
129%if %{with python2}
130%files
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}
136%endif
137
138%if %{with python3}
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}
146%endif
147
148%if %{with doc}
149%files apidocs
150%defattr(644,root,root,755)
151%doc docs/_build/html/*
152%endif
This page took 0.096952 seconds and 4 git commands to generate.