]> git.pld-linux.org Git - packages/python-smartypants.git/blame - python-smartypants.spec
rebuild with tests and docs
[packages/python-smartypants.git] / python-smartypants.spec
CommitLineData
f92f3b49
JB
1#
2# Conditional build:
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
7
8Summary: Python fork of SmartyPants
9Summary(pl.UTF-8): Pythonowa wersja SmartyPants
10Name: python-smartypants
11Version: 2.0.1
b9c5f47f 12Release: 4
f92f3b49
JB
13License: BSD
14Group: 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
19Source0: https://github.com/leohemsted/smartypants.py/archive/v%{version}/smartypants.py-%{version}.tar.gz
20# Source0-md5: 27957540f4718e892039b2ed208c78f3
21URL: https://pypi.org/project/smartypants/
22%if %{with python2}
23BuildRequires: python-modules >= 1:2.5
24%endif
25%if %{with python3}
26BuildRequires: python3-modules >= 1:3.2
27%endif
28BuildRequires: rpm-pythonprov
29BuildRequires: rpmbuild(macros) >= 1.714
30%{?with_doc:BuildRequires: sphinx-pdg}
31Requires: python-modules >= 1:2.5
32BuildArch: noarch
33BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34
35%description
36smartypants 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
40
41%description -l pl.UTF-8
42smartypants 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
46
47%package -n python3-smartypants
48Summary: Python fork of SmartyPants
49Summary(pl.UTF-8): Pythonowa wersja SmartyPants
50Group: Libraries/Python
51Requires: python3-modules >= 1:3.2
52
53%description -n python3-smartypants
54smartypants 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
58
59%description -n python3-smartypants -l pl.UTF-8
60smartypants 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
64
65%package apidocs
66Summary: API documentation for Python smartypants module
67Summary(pl.UTF-8): Dokumentacja API modułu Pythona smartypants
68Group: Documentation
69
70%description apidocs
71API documentation for Python smartypants module.
72
73%description apidocs -l pl.UTF-8
74Dokumentacja API modułu Pythona smartypants.
75
76%prep
77%setup -q -n smartypants.py-%{version}
78
79%build
80%if %{with python2}
81%py_build %{?with_tests:test}
82%endif
83
84%if %{with python3}
85%py3_build %{?with_tests:test}
86%endif
87
88%if %{with doc}
89%{__make} -C docs html
90%endif
91
92%install
93rm -rf $RPM_BUILD_ROOT
94
95%if %{with python2}
96%py_install
97
98%py_postclean
99
100%{__mv} $RPM_BUILD_ROOT%{_bindir}/smartypants{,-2}
101%endif
102
103%if %{with python3}
104%py3_install
105
106%{__mv} $RPM_BUILD_ROOT%{_bindir}/smartypants{,-3}
107ln -sf smartypants-3 $RPM_BUILD_ROOT%{_bindir}/smartypants
108%endif
109
110%clean
111rm -rf $RPM_BUILD_ROOT
112
113%if %{with python2}
114%files
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
120%endif
121
122%if %{with python3}
123%files -n python3-smartypants
124%defattr(644,root,root,755)
125%doc README.rst
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
131%endif
132
133%if %{with doc}
134%files apidocs
135%defattr(644,root,root,755)
136%doc docs/_build/html/{_modules,_static,*.html,*.js}
137%endif
This page took 0.123951 seconds and 4 git commands to generate.