1 # NOTE: for versions >= 3.2 (for python 3.6+) see python3-markdown.spec
4 %bcond_with doc # documentation
5 %bcond_without tests # unit tests
6 %bcond_without python2 # python2 package
7 %bcond_with python3 # python3 package (built from python3-markdown.spec)
9 %define module markdown
10 Summary: Markdown implementation in Python 2
11 Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 2
12 Name: python-%{module}
13 # keep 3.1.x here for python2 support
17 Group: Development/Languages/Python
18 #Source0Download: https://pypi.org/simple/markdown/
19 Source0: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
20 # Source0-md5: d84732ecc65b3a1bff693d9d4c24277f
21 URL: https://pypi.org/project/markdown/
23 BuildRequires: python-devel >= 1:2.7
24 BuildRequires: python-setuptools >= 1:36
26 BuildRequires: python-PyYAML
30 BuildRequires: python3-devel >= 1:3.5
31 BuildRequires: python3-setuptools >= 1:36
33 BuildRequires: python3-PyYAML
37 BuildRequires: python-mkdocs >= 1.0
38 BuildRequires: python-mkdocs-nature
40 BuildRequires: rpm-pythonprov
41 BuildRequires: rpmbuild(macros) >= 1.714
42 Provides: python-Markdown = %{version}-%{release}
43 Obsoletes: python-Markdown < 2.3
45 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48 This is a Python 2 implementation of John Gruber's Markdown. It is
49 almost completely compliant with the reference implementation, though
50 there are a few known issues.
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.
57 %package -n python3-markdown
58 Summary: Markdown implementation in Python 3
59 Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 3
60 Group: Development/Languages/Python
61 Conflicts: python-markdown < 3
63 %description -n python3-markdown
64 This is a Python 3 implementation of John Gruber's Markdown. It is
65 almost completely compliant with the reference implementation, though
66 there are a few known issues.
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.
74 %setup -q -n Markdown-%{version}
81 %{__python} -m unittest discover tests
89 %{__python3} -m unittest discover tests
98 rm -rf $RPM_BUILD_ROOT
105 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
111 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
113 ln -s markdown_py-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
117 rm -rf $RPM_BUILD_ROOT
121 %defattr(644,root,root,755)
122 %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
123 %attr(755,root,root) %{_bindir}/markdown_py-%{py_ver}
124 %{py_sitescriptdir}/markdown
125 %{py_sitescriptdir}/Markdown-%{version}-py*.egg-info
129 %files -n python3-markdown
130 %defattr(644,root,root,755)
131 %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md}
132 %attr(755,root,root) %{_bindir}/markdown_py
133 %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver}
134 %{py3_sitescriptdir}/markdown
135 %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info