3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # unit tests
7 Summary: Python parser for the CommonMark Markdown spec
8 Summary(pl.UTF-8): Pythonowy parser specyfikacji CommonMark Markdown
9 Name: python-commonmark
13 Group: Libraries/Python
14 #Source0Download: https://pypi.org/simple/commonmark/
15 Source0: https://files.pythonhosted.org/packages/source/c/commonmark/commonmark-%{version}.tar.gz
16 # Source0-md5: cd1dc70c4714d9ed4117a40490c25e00
17 Patch0: %{name}-deps.patch
18 URL: https://github.com/rtfd/CommonMark-py
20 BuildRequires: python-modules >= 1:2.7
21 BuildRequires: python-setuptools
23 BuildRequires: python-future >= 0.14.0
24 BuildRequires: python-hypothesis >= 3.55.3
28 BuildRequires: python3-modules >= 1:3.3
29 BuildRequires: python3-setuptools
31 BuildRequires: python3-hypothesis >= 3.55.3
34 BuildRequires: rpm-pythonprov
35 BuildRequires: rpmbuild(macros) >= 1.714
36 Requires: python-future
37 Requires: python-modules >= 1:2.7
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 CommonMark-py is a pure Python port of jgm's commonmark.js, a Markdown
43 parser and renderer for the CommonMark specification, using only
46 %description -l pl.UTF-8
47 CommonMark-py to czysto perlowy port kodu jgm commonmark.js - parsera
48 i renderera specyfikacji CommonMark, napisany przy wyłącznie przy
49 użyciu natywnych modułów.
51 %package -n python3-commonmark
52 Summary: Python parser for the CommonMark Markdown spec
53 Summary(pl.UTF-8): Pythonowy parser specyfikacji CommonMark Markdown
54 Group: Libraries/Python
55 Requires: python3-modules >= 1:3.3
57 %description -n python3-commonmark
58 CommonMark-py is a pure Python port of jgm's commonmark.js, a Markdown
59 parser and renderer for the CommonMark specification, using only
62 %description -n python3-commonmark -l pl.UTF-8
63 CommonMark-py to czysto perlowy port kodu jgm commonmark.js - parsera
64 i renderera specyfikacji CommonMark, napisany przy wyłącznie przy
65 użyciu natywnych modułów.
68 %setup -q -n commonmark-%{version}
77 PYTHONIOENCODING=utf-8 \
78 PYTHONPATH=$(pwd)/build-2/lib \
79 %{__python} commonmark/tests/run_spec_tests.py
88 PYTHONPATH=$(pwd)/build-3/lib \
89 %{__python3} commonmark/tests/run_spec_tests.py
94 rm -rf $RPM_BUILD_ROOT
101 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cmark{,-2}
107 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cmark{,-3}
109 ln -sf cmark-3 $RPM_BUILD_ROOT%{_bindir}/cmark
113 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
118 %doc CHANGELOG.md LICENSE README.rst spec.txt
119 %attr(755,root,root) %{_bindir}/cmark-2
120 %{py_sitescriptdir}/commonmark
121 %{py_sitescriptdir}/commonmark-%{version}-py*.egg-info
125 %files -n python3-commonmark
126 %defattr(644,root,root,755)
127 %doc CHANGELOG.md LICENSE README.rst spec.txt
128 %attr(755,root,root) %{_bindir}/cmark
129 %attr(755,root,root) %{_bindir}/cmark-3
130 %{py3_sitescriptdir}/commonmark
131 %{py3_sitescriptdir}/commonmark-%{version}-py*.egg-info