]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | Summary: Python fork of SmartyPants | |
9 | Summary(pl.UTF-8): Pythonowa wersja SmartyPants | |
10 | Name: python-smartypants | |
11 | Version: 2.0.1 | |
b9c5f47f | 12 | Release: 4 |
f92f3b49 JB |
13 | License: BSD |
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/ | |
22 | %if %{with python2} | |
23 | BuildRequires: python-modules >= 1:2.5 | |
24 | %endif | |
25 | %if %{with python3} | |
26 | BuildRequires: python3-modules >= 1:3.2 | |
27 | %endif | |
28 | BuildRequires: rpm-pythonprov | |
29 | BuildRequires: rpmbuild(macros) >= 1.714 | |
30 | %{?with_doc:BuildRequires: sphinx-pdg} | |
31 | Requires: python-modules >= 1:2.5 | |
32 | BuildArch: noarch | |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
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 | |
40 | ||
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 | |
46 | ||
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 | |
52 | ||
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 | |
58 | ||
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 | |
64 | ||
65 | %package apidocs | |
66 | Summary: API documentation for Python smartypants module | |
67 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona smartypants | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for Python smartypants module. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja 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 | |
93 | rm -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} | |
107 | ln -sf smartypants-3 $RPM_BUILD_ROOT%{_bindir}/smartypants | |
108 | %endif | |
109 | ||
110 | %clean | |
111 | rm -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 |