]> git.pld-linux.org Git - packages/python-markdown.git/blob - python-markdown.spec
- setuptools epoch
[packages/python-markdown.git] / python-markdown.spec
1 # NOTE: for versions >= 3.2 (for python 3.6+) see python3-markdown.spec
2 #
3 # Conditional build:
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)
8
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
14 Version:        3.1.1
15 Release:        2
16 License:        BSD
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/
22 %if %{with python2}
23 BuildRequires:  python-devel >= 1:2.7
24 BuildRequires:  python-setuptools >= 1:36
25 %if %{with tests}
26 BuildRequires:  python-PyYAML
27 %endif
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3-devel >= 1:3.5
31 BuildRequires:  python3-setuptools >= 1:36
32 %if %{with tests}
33 BuildRequires:  python3-PyYAML
34 %endif
35 %endif
36 %if %{with doc}
37 BuildRequires:  python-mkdocs >= 1.0
38 BuildRequires:  python-mkdocs-nature
39 %endif
40 BuildRequires:  rpm-pythonprov
41 BuildRequires:  rpmbuild(macros) >= 1.714
42 Provides:       python-Markdown = %{version}-%{release}
43 Obsoletes:      python-Markdown < 2.3
44 BuildArch:      noarch
45 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46
47 %description
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.
51
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
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
62
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.
67
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
73 %prep
74 %setup -q -n Markdown-%{version}
75
76 %build
77 %if %{with python2}
78 %py_build
79
80 %if %{with tests}
81 %{__python} -m unittest discover tests
82 %endif
83 %endif
84
85 %if %{with python3}
86 %py3_build
87
88 %if %{with tests}
89 %{__python3} -m unittest discover tests
90 %endif
91 %endif
92
93 %if %{with doc}
94 mkdocs-2
95 %endif
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99
100 %if %{with python2}
101 %py_install
102
103 %py_postclean
104 # rename binary
105 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
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
114 %endif
115
116 %clean
117 rm -rf $RPM_BUILD_ROOT
118
119 %if %{with python2}
120 %files
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
126 %endif
127
128 %if %{with python3}
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
136 %endif
This page took 0.073731 seconds and 3 git commands to generate.