]> git.pld-linux.org Git - packages/python-commonmark.git/blob - python-commonmark.spec
rebuild with tests and docs
[packages/python-commonmark.git] / python-commonmark.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # unit tests
6
7 Summary:        Python parser for the CommonMark Markdown spec
8 Summary(pl.UTF-8):      Pythonowy parser specyfikacji CommonMark Markdown
9 Name:           python-commonmark
10 Version:        0.9.1
11 Release:        5
12 License:        BSD
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
19 %if %{with python2}
20 BuildRequires:  python-modules >= 1:2.7
21 BuildRequires:  python-setuptools
22 %if %{with tests}
23 BuildRequires:  python-future >= 0.14.0
24 BuildRequires:  python-hypothesis >= 3.55.3
25 %endif
26 %endif
27 %if %{with python3}
28 BuildRequires:  python3-modules >= 1:3.3
29 BuildRequires:  python3-setuptools
30 %if %{with tests}
31 BuildRequires:  python3-hypothesis >= 3.55.3
32 %endif
33 %endif
34 BuildRequires:  rpm-pythonprov
35 BuildRequires:  rpmbuild(macros) >= 1.714
36 Requires:       python-future
37 Requires:       python-modules >= 1:2.7
38 BuildArch:      noarch
39 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40
41 %description
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
44 native modules.
45
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.
50
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
56
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
60 native modules.
61
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.
66
67 %prep
68 %setup -q -n commonmark-%{version}
69 %patch0 -p1
70
71 %build
72 %if %{with python2}
73 %py_build
74
75 %if %{with tests}
76 LC_ALL=C.UTF-8 \
77 PYTHONIOENCODING=utf-8 \
78 PYTHONPATH=$(pwd)/build-2/lib \
79 %{__python} commonmark/tests/run_spec_tests.py
80 %endif
81 %endif
82
83 %if %{with python3}
84 %py3_build
85
86 %if %{with tests}
87 LC_ALL=C.UTF-8 \
88 PYTHONPATH=$(pwd)/build-3/lib \
89 %{__python3} commonmark/tests/run_spec_tests.py
90 %endif
91 %endif
92
93 %install
94 rm -rf $RPM_BUILD_ROOT
95
96 %if %{with python2}
97 %py_install
98
99 %py_postclean
100
101 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cmark{,-2}
102 %endif
103
104 %if %{with python3}
105 %py3_install
106
107 %{__mv} $RPM_BUILD_ROOT%{_bindir}/cmark{,-3}
108
109 ln -sf cmark-3 $RPM_BUILD_ROOT%{_bindir}/cmark
110 %endif
111
112 %clean
113 rm -rf $RPM_BUILD_ROOT
114
115 %if %{with python2}
116 %files
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
122 %endif
123
124 %if %{with python3}
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
132 %endif
This page took 0.07722 seconds and 3 git commands to generate.