3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
5 %bcond_without python2 # CPython 2.x module
6 %bcond_without python3 # CPython 3.x module
8 Summary: Python fork of SmartyPants
9 Summary(pl.UTF-8): Pythonowa wersja SmartyPants
10 Name: python-smartypants
14 Group: Libraries/Python
15 ##Source0Download: https://pypi.org/simple/smartypants/
16 #Source0: https://files.pythonhosted.org/packages/source/s/smartypants/smartypants-%{version}.tar.gz
17 # 2.0.1 missing on pypi, so...
18 #Source0Download: https://github.com/leohemsted/smartypants.py/releases
19 Source0: https://github.com/leohemsted/smartypants.py/archive/v%{version}/smartypants.py-%{version}.tar.gz
20 # Source0-md5: 27957540f4718e892039b2ed208c78f3
21 URL: https://pypi.org/project/smartypants/
23 BuildRequires: python-modules >= 1:2.5
26 BuildRequires: python3-modules >= 1:3.2
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.714
30 %{?with_doc:BuildRequires: sphinx-pdg}
31 Requires: python-modules >= 1:2.5
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 smartypants is a Python fork of SmartyPants. It can turn:
37 - straight or backticks quotes into HTML quote entities
38 - dashes into en- and em-dash entities
39 - three consecutive dots into an ellipsis entity
41 %description -l pl.UTF-8
42 smartypants to pythonowa wersja SmartyPants. Potrafi zamieniać:
43 - proste lub odwrotne cudzysłowy na encje cudzysłowów HTML
44 - kreski na encje pauzy i półpauzy
45 - trzy kropki na encję wielokropka
47 %package -n python3-smartypants
48 Summary: Python fork of SmartyPants
49 Summary(pl.UTF-8): Pythonowa wersja SmartyPants
50 Group: Libraries/Python
51 Requires: python3-modules >= 1:3.2
53 %description -n python3-smartypants
54 smartypants is a Python fork of SmartyPants. It can turn:
55 - straight or backticks quotes into HTML quote entities
56 - dashes into en- and em-dash entities
57 - three consecutive dots into an ellipsis entity
59 %description -n python3-smartypants -l pl.UTF-8
60 smartypants to pythonowa wersja SmartyPants. Potrafi zamieniać:
61 - proste lub odwrotne cudzysłowy na encje cudzysłowów HTML
62 - kreski na encje pauzy i półpauzy
63 - trzy kropki na encję wielokropka
66 Summary: API documentation for Python smartypants module
67 Summary(pl.UTF-8): Dokumentacja API modułu Pythona smartypants
71 API documentation for Python smartypants module.
73 %description apidocs -l pl.UTF-8
74 Dokumentacja API modułu Pythona smartypants.
77 %setup -q -n smartypants.py-%{version}
81 %py_build %{?with_tests:test}
85 %py3_build %{?with_tests:test}
89 %{__make} -C docs html
93 rm -rf $RPM_BUILD_ROOT
100 %{__mv} $RPM_BUILD_ROOT%{_bindir}/smartypants{,-2}
106 %{__mv} $RPM_BUILD_ROOT%{_bindir}/smartypants{,-3}
107 ln -sf smartypants-3 $RPM_BUILD_ROOT%{_bindir}/smartypants
111 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
116 %doc CHANGES.rst COPYING README.rst
117 %attr(755,root,root) %{_bindir}/smartypants-2
118 %{py_sitescriptdir}/smartypants.py[co]
119 %{py_sitescriptdir}/smartypants-%{version}-py*.egg-info
123 %files -n python3-smartypants
124 %defattr(644,root,root,755)
126 %attr(755,root,root) %{_bindir}/smartypants
127 %attr(755,root,root) %{_bindir}/smartypants-3
128 %{py3_sitescriptdir}/smartypants.py
129 %{py3_sitescriptdir}/__pycache__/smartypants.cpython-*.py[co]
130 %{py3_sitescriptdir}/smartypants-%{version}-py*.egg-info
135 %defattr(644,root,root,755)
136 %doc docs/_build/html/{_modules,_static,*.html,*.js}