]>
Commit | Line | Data |
---|---|---|
fc7d0b35 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with doc # documentation | |
4 | %bcond_without tests # unit tests | |
5 | ||
6 | %define module markdown | |
7 | Summary: Markdown implementation in Python 3 | |
8 | Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 3 | |
9 | Name: python3-%{module} | |
9b70f3c5 JB |
10 | Version: 3.4.1 |
11 | Release: 1 | |
fc7d0b35 JB |
12 | License: BSD |
13 | Group: Development/Languages/Python | |
14 | #Source0Download: https://pypi.org/simple/markdown/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz | |
9b70f3c5 | 16 | # Source0-md5: 597656cf4feadf1998b0511201620202 |
fc7d0b35 | 17 | URL: https://pypi.org/project/markdown/ |
9b70f3c5 | 18 | BuildRequires: python3-devel >= 1:3.7 |
54241bff | 19 | BuildRequires: python3-setuptools >= 1:36.6 |
fc7d0b35 JB |
20 | %if %{with tests} |
21 | BuildRequires: python3-PyYAML | |
22 | %if "%{py3_ver}" <= "3.8" | |
23 | BuildRequires: python3-importlib_metadata | |
24 | %endif | |
25 | %endif | |
26 | %if %{with doc} | |
27 | BuildRequires: python3-mkdocs >= 1.0 | |
28 | BuildRequires: python3-mkdocs-nature | |
29 | %endif | |
30 | BuildRequires: rpm-pythonprov | |
31 | BuildRequires: rpmbuild(macros) >= 1.714 | |
32 | Conflicts: python-markdown < 3 | |
33 | BuildArch: noarch | |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
37 | This is a Python 3 implementation of John Gruber's Markdown. It is | |
38 | almost completely compliant with the reference implementation, though | |
39 | there are a few known issues. | |
40 | ||
41 | %description -l pl.UTF-8 | |
42 | Ten pakiet zawiera implementację formatu Markdown Johna Grubera w | |
43 | Pythonie 3. Jest prawie całkowicie zgodna z implementacją wzorcową, | |
44 | choć jest kilka znanych problemów. | |
45 | ||
46 | %prep | |
47 | %setup -q -n Markdown-%{version} | |
48 | ||
49 | %build | |
50 | %py3_build | |
51 | ||
52 | %if %{with tests} | |
53 | %{__python3} -m unittest discover tests | |
54 | %endif | |
55 | ||
56 | %if %{with doc} | |
57 | mkdocs-3 | |
58 | %endif | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | ||
63 | %py3_install | |
64 | # rename binary | |
65 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}} | |
66 | # default binary | |
67 | ln -s markdown_py-%{py3_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py | |
68 | ||
69 | %clean | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %files | |
73 | %defattr(644,root,root,755) | |
74 | %doc LICENSE.md README.md docs/{change_log,extensions,authors.md,cli.md,favicon.ico,index.md,py.png,reference.md} | |
75 | %attr(755,root,root) %{_bindir}/markdown_py | |
76 | %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver} | |
77 | %{py3_sitescriptdir}/markdown | |
78 | %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info |