]>
Commit | Line | Data |
---|---|---|
9a8cda62 | 1 | # NOTE: for versions >= 3.2 (for python 3.6+) see python3-markdown.spec |
f8804a58 | 2 | # |
4e2d3523 | 3 | # Conditional build: |
c1058429 | 4 | %bcond_with doc # documentation |
4c99705f | 5 | %bcond_without tests # unit tests |
cc59a982 | 6 | %bcond_without python2 # python2 package |
9a8cda62 | 7 | %bcond_with python3 # python3 package (built from python3-markdown.spec) |
4e2d3523 | 8 | |
4ceaf0fc | 9 | %define module markdown |
f8804a58 JB |
10 | Summary: Markdown implementation in Python 2 |
11 | Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 2 | |
4ceaf0fc | 12 | Name: python-%{module} |
9a8cda62 | 13 | # keep 3.1.x here for python2 support |
c1058429 JB |
14 | Version: 3.1.1 |
15 | Release: 1 | |
a974dd9e AF |
16 | License: BSD |
17 | Group: Development/Languages/Python | |
f8e0eed6 | 18 | #Source0Download: https://pypi.org/simple/markdown/ |
f8804a58 | 19 | Source0: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz |
c1058429 | 20 | # Source0-md5: d84732ecc65b3a1bff693d9d4c24277f |
f8e0eed6 | 21 | URL: https://pypi.org/project/markdown/ |
c1058429 JB |
22 | %if %{with python2} |
23 | BuildRequires: python-devel >= 1:2.7 | |
c1058429 | 24 | BuildRequires: python-setuptools >= 36 |
f8804a58 JB |
25 | %if %{with tests} |
26 | BuildRequires: python-PyYAML | |
c1058429 | 27 | %endif |
f8804a58 | 28 | %endif |
f8804a58 | 29 | %if %{with python3} |
c1058429 JB |
30 | BuildRequires: python3-devel >= 1:3.5 |
31 | BuildRequires: python3-setuptools >= 36 | |
f8804a58 JB |
32 | %if %{with tests} |
33 | BuildRequires: python3-PyYAML | |
f8804a58 | 34 | %endif |
4e2d3523 | 35 | %endif |
0d815958 JB |
36 | %if %{with doc} |
37 | BuildRequires: python-mkdocs >= 1.0 | |
38 | BuildRequires: python-mkdocs-nature | |
39 | %endif | |
f8e0eed6 JB |
40 | BuildRequires: rpm-pythonprov |
41 | BuildRequires: rpmbuild(macros) >= 1.714 | |
4ceaf0fc | 42 | Provides: python-Markdown = %{version}-%{release} |
f8e0eed6 | 43 | Obsoletes: python-Markdown < 2.3 |
a974dd9e AF |
44 | BuildArch: noarch |
45 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
46 | ||
47 | %description | |
f8804a58 | 48 | This is a Python 2 implementation of John Gruber's Markdown. It is |
4e2d3523 ER |
49 | almost completely compliant with the reference implementation, though |
50 | there are a few known issues. | |
51 | ||
f8804a58 JB |
52 | %description -l pl.UTF-8 |
53 | Ten pakiet zawiera implementację formatu Markdown Johna Grubera w | |
54 | Pythonie 2. Jest prawie całkowicie zgodna z implementacją wzorcową, | |
55 | choć jest kilka znanych problemów. | |
56 | ||
4e2d3523 | 57 | %package -n python3-markdown |
f8804a58 JB |
58 | Summary: Markdown implementation in Python 3 |
59 | Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 3 | |
4e2d3523 | 60 | Group: Development/Languages/Python |
24f34a9e | 61 | Conflicts: python-markdown < 3 |
4e2d3523 ER |
62 | |
63 | %description -n python3-markdown | |
f8804a58 | 64 | This is a Python 3 implementation of John Gruber's Markdown. It is |
4e2d3523 ER |
65 | almost completely compliant with the reference implementation, though |
66 | there are a few known issues. | |
a974dd9e | 67 | |
f8804a58 JB |
68 | %description -n python3-markdown -l pl.UTF-8 |
69 | Ten pakiet zawiera implementację formatu Markdown Johna Grubera w | |
70 | Pythonie 3. Jest prawie całkowicie zgodna z implementacją wzorcową, | |
71 | choć jest kilka znanych problemów. | |
72 | ||
a974dd9e | 73 | %prep |
cc59a982 | 74 | %setup -q -n Markdown-%{version} |
4e2d3523 | 75 | |
a974dd9e | 76 | %build |
cc59a982 | 77 | %if %{with python2} |
d44221e5 | 78 | %py_build |
a974dd9e | 79 | |
4e2d3523 | 80 | %if %{with tests} |
c1058429 | 81 | %{__python} -m unittest discover tests |
cc59a982 JB |
82 | %endif |
83 | %endif | |
4e2d3523 | 84 | |
f8804a58 | 85 | %if %{with python3} |
cc59a982 JB |
86 | %py3_build |
87 | ||
88 | %if %{with tests} | |
c1058429 | 89 | %{__python3} -m unittest discover tests |
4e2d3523 ER |
90 | %endif |
91 | %endif | |
92 | ||
c1058429 | 93 | %if %{with doc} |
9a8cda62 | 94 | mkdocs-2 |
c1058429 JB |
95 | %endif |
96 | ||
a974dd9e AF |
97 | %install |
98 | rm -rf $RPM_BUILD_ROOT | |
4e2d3523 | 99 | |
cc59a982 JB |
100 | %if %{with python2} |
101 | %py_install | |
c1058429 | 102 | |
cc59a982 JB |
103 | %py_postclean |
104 | # rename binary | |
105 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}} | |
c1058429 JB |
106 | %endif |
107 | ||
108 | %if %{with python3} | |
109 | %py3_install | |
110 | # rename binary | |
111 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}} | |
112 | # default binary | |
113 | ln -s markdown_py-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py | |
cc59a982 | 114 | %endif |
4e2d3523 | 115 | |
a974dd9e AF |
116 | %clean |
117 | rm -rf $RPM_BUILD_ROOT | |
118 | ||
cc59a982 | 119 | %if %{with python2} |
a974dd9e AF |
120 | %files |
121 | %defattr(644,root,root,755) | |
4c99705f | 122 | %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md} |
4e2d3523 | 123 | %attr(755,root,root) %{_bindir}/markdown_py-%{py_ver} |
a974dd9e | 124 | %{py_sitescriptdir}/markdown |
4e2d3523 | 125 | %{py_sitescriptdir}/Markdown-%{version}-py*.egg-info |
cc59a982 | 126 | %endif |
4e2d3523 | 127 | |
f8804a58 | 128 | %if %{with python3} |
4e2d3523 ER |
129 | %files -n python3-markdown |
130 | %defattr(644,root,root,755) | |
4c99705f | 131 | %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md} |
c1058429 | 132 | %attr(755,root,root) %{_bindir}/markdown_py |
4e2d3523 | 133 | %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver} |
4e2d3523 | 134 | %{py3_sitescriptdir}/markdown |
f8804a58 | 135 | %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info |
a974dd9e | 136 | %endif |