]> git.pld-linux.org Git - packages/python-recommonmark.git/blame - python-recommonmark.spec
Release 4 (by relup.sh)
[packages/python-recommonmark.git] / python-recommonmark.spec
CommitLineData
5f21dfb6
JP
1#
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
03a31635
JB
5%bcond_without doc # Sphinx documentation
6%bcond_without tests # unit tests
5f21dfb6 7
5f21dfb6 8Summary: docutils-compatibility bridge to CommonMark
03a31635 9Summary(pl.UTF-8): Pomost zgodności z docutils dla CommonMark
5f21dfb6 10Name: python-recommonmark
ce0249e4 11Version: 0.7.1
97f540c5 12Release: 4
5f21dfb6
JP
13License: MIT
14Group: Libraries/Python
69a34bb0
JB
15#Source0Download: https://pypi.org/simple/recommonmark/
16Source0: https://files.pythonhosted.org/packages/source/r/recommonmark/recommonmark-%{version}.tar.gz
ce0249e4 17# Source0-md5: 3c550a76eb62006bf007843a9f1805bb
69a34bb0
JB
18# from https://github.com/readthedocs/recommonmark/pull/124
19# https://github.com/readthedocs/recommonmark/commit/917e0359fa93acd9b22d7122e2c03d994d9fda44.patch
20Patch0: %{name}-math.patch
b5d6a45d 21Patch1: %{name}-docutils.patch
5f21dfb6
JP
22URL: https://recommonmark.readthedocs.io/en/latest/
23%if %{with python2}
24BuildRequires: python-modules >= 1:2.7
25BuildRequires: python-setuptools
03a31635
JB
26%if %{with tests}
27BuildRequires: python-Sphinx >= 1.3.1
69a34bb0 28BuildRequires: python-commonmark >= 0.8.1
03a31635
JB
29BuildRequires: python-docutils >= 0.11
30BuildRequires: python-pytest
31%endif
5f21dfb6
JP
32%endif
33%if %{with python3}
34BuildRequires: python3-modules >= 1:3.3
35BuildRequires: python3-setuptools
03a31635
JB
36%if %{with tests}
37BuildRequires: python3-Sphinx >= 1.3.1
69a34bb0 38BuildRequires: python3-commonmark >= 0.8.1
03a31635
JB
39BuildRequires: python3-docutils >= 0.11
40BuildRequires: python3-pytest
41%endif
5f21dfb6
JP
42%endif
43BuildRequires: rpm-pythonprov
44BuildRequires: rpmbuild(macros) >= 1.714
03a31635 45%if %{with doc}
342440e0 46BuildRequires: python3-commonmark >= 0.8.1
03a31635
JB
47BuildRequires: sphinx-pdg
48%endif
5f21dfb6
JP
49Requires: python-modules >= 1:2.7
50BuildArch: noarch
51BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52
53%description
54This allows you to write CommonMark inside of Docutils & Sphinx
55projects.
56
03a31635
JB
57%description -l pl.UTF-8
58Ten moduł pozwala na pisanie z użyciem CommonMark wewnątrz projektów
59Docutils i Sphinksa.
60
5f21dfb6
JP
61%package -n python3-recommonmark
62Summary: docutils-compatibility bridge to CommonMark
03a31635 63Summary(pl.UTF-8): Pomost zgodności z docutils dla CommonMark
5f21dfb6
JP
64Group: Libraries/Python
65Requires: python3-modules >= 1:3.3
66
67%description -n python3-recommonmark
68This allows you to write CommonMark inside of Docutils & Sphinx
69projects.
70
03a31635
JB
71%description -n python3-recommonmark -l pl.UTF-8
72Ten moduł pozwala na pisanie z użyciem CommonMark wewnątrz projektów
73Docutils i Sphinksa.
74
75%package apidocs
76Summary: Documentation for Python recommonmark module
77Summary(pl.UTF-8): Dokumentacja modułu Pythona recommonmark
78Group: Documentation
79
80%description apidocs
81Documentation for Python recommonmark module.
82
83%description apidocs -l pl.UTF-8
84Dokumentacja modułu Pythona recommonmark.
85
5f21dfb6 86%prep
69a34bb0 87%setup -q -n recommonmark-%{version}
03a31635 88%patch0 -p1
b5d6a45d 89%patch1 -p1
5f21dfb6
JP
90
91%build
92%if %{with python2}
93%py_build
03a31635 94
ce0249e4 95%if %{with tests}
03a31635 96# skip: python2 uses different XML formatting, tests expect python3 formatting
ce0249e4 97%{__python} -m pytest tests -k 'not CustomExtensionTests'
03a31635 98%endif
5f21dfb6
JP
99%endif
100
101%if %{with python3}
102%py3_build
03a31635
JB
103
104%if %{with tests}
ce0249e4
JB
105# sphinx tests are too dependent on Sphinx version
106%{__python3} -m pytest tests -k 'not test_sphinx'
03a31635
JB
107%endif
108%endif
109
110%if %{with doc}
111PYTHONPATH=$(pwd) \
112%{__make} -C docs html
5f21dfb6
JP
113%endif
114
115%install
116rm -rf $RPM_BUILD_ROOT
117
118%if %{with python2}
119%py_install
120
121%py_postclean
03a31635
JB
122
123for f in cm2{html,latex,man,pseudoxml,xetex,xml} ; do
124 %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-2
125done
5f21dfb6
JP
126%endif
127
128%if %{with python3}
129%py3_install
03a31635
JB
130
131for f in cm2{html,latex,man,pseudoxml,xetex,xml} ; do
132 %{__mv} $RPM_BUILD_ROOT%{_bindir}/${f} $RPM_BUILD_ROOT%{_bindir}/${f}-3
133 ln -sf ${f}-3 $RPM_BUILD_ROOT%{_bindir}/${f}
134done
5f21dfb6
JP
135%endif
136
137%clean
138rm -rf $RPM_BUILD_ROOT
139
140%if %{with python2}
141%files
142%defattr(644,root,root,755)
03a31635
JB
143%doc CHANGELOG.md README.md license.md
144%attr(755,root,root) %{_bindir}/cm2html-2
145%attr(755,root,root) %{_bindir}/cm2latex-2
146%attr(755,root,root) %{_bindir}/cm2man-2
147%attr(755,root,root) %{_bindir}/cm2pseudoxml-2
148%attr(755,root,root) %{_bindir}/cm2xetex-2
149%attr(755,root,root) %{_bindir}/cm2xml-2
5f21dfb6 150%{py_sitescriptdir}/recommonmark
69a34bb0 151%{py_sitescriptdir}/recommonmark-%{version}-py*.egg-info
5f21dfb6
JP
152%endif
153
154%if %{with python3}
155%files -n python3-recommonmark
156%defattr(644,root,root,755)
03a31635
JB
157%doc CHANGELOG.md README.md license.md
158%attr(755,root,root) %{_bindir}/cm2html
159%attr(755,root,root) %{_bindir}/cm2latex
160%attr(755,root,root) %{_bindir}/cm2man
161%attr(755,root,root) %{_bindir}/cm2pseudoxml
162%attr(755,root,root) %{_bindir}/cm2xetex
163%attr(755,root,root) %{_bindir}/cm2xml
164%attr(755,root,root) %{_bindir}/cm2html-3
165%attr(755,root,root) %{_bindir}/cm2latex-3
166%attr(755,root,root) %{_bindir}/cm2man-3
167%attr(755,root,root) %{_bindir}/cm2pseudoxml-3
168%attr(755,root,root) %{_bindir}/cm2xetex-3
169%attr(755,root,root) %{_bindir}/cm2xml-3
5f21dfb6 170%{py3_sitescriptdir}/recommonmark
69a34bb0 171%{py3_sitescriptdir}/recommonmark-%{version}-py*.egg-info
5f21dfb6 172%endif
03a31635
JB
173
174%if %{with doc}
175%files apidocs
176%defattr(644,root,root,755)
177%doc docs/_build/html/{_static,*.html,*.js}
178%endif
This page took 1.861765 seconds and 5 git commands to generate.