3 %bcond_without tests # do not perform "make test"
4 %bcond_without python2 # python2 package
5 %bcond_without python3 # python3 package
7 %define module markdown
8 Summary: Markdown implementation in Python 2
9 Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 2
10 Name: python-%{module}
14 Group: Development/Languages/Python
15 #Source0Download: https://pypi.python.org/simple/markdown/
16 Source0: https://files.pythonhosted.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
17 # Source0-md5: a06f1c5d462b32e0e8da014e9eebb0d9
18 URL: https://pythonhosted.org/Markdown/
19 BuildRequires: python-devel
20 BuildRequires: python-elementtree
22 BuildRequires: python-PyYAML
23 BuildRequires: python-nose
25 BuildRequires: rpm-pythonprov
26 BuildRequires: rpmbuild(macros) >= 1.714
27 BuildRequires: sed >= 4.0
29 BuildRequires: python3-devel >= 1:3.2
31 BuildRequires: python3-PyYAML
32 BuildRequires: python3-nose
35 Requires: python-elementtree
36 Provides: python-Markdown = %{version}-%{release}
37 Obsoletes: python-Markdown = 2.2.1
39 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42 This is a Python 2 implementation of John Gruber's Markdown. It is
43 almost completely compliant with the reference implementation, though
44 there are a few known issues.
46 %description -l pl.UTF-8
47 Ten pakiet zawiera implementację formatu Markdown Johna Grubera w
48 Pythonie 2. Jest prawie całkowicie zgodna z implementacją wzorcową,
49 choć jest kilka znanych problemów.
51 %package -n python3-markdown
52 Summary: Markdown implementation in Python 3
53 Summary(pl.UTF-8): Implementacja formatu Markdown w Pythonie 3
54 Group: Development/Languages/Python
56 %description -n python3-markdown
57 This is a Python 3 implementation of John Gruber's Markdown. It is
58 almost completely compliant with the reference implementation, though
59 there are a few known issues.
61 %description -n python3-markdown -l pl.UTF-8
62 Ten pakiet zawiera implementację formatu Markdown Johna Grubera w
63 Pythonie 3. Jest prawie całkowicie zgodna z implementacją wzorcową,
64 choć jest kilka znanych problemów.
67 %setup -q -n Markdown-%{version}
70 find markdown -type f -name '*.py' -exec sed -i -e '/^#!/{1D}' {} ';'
73 %undos docs/release-2.2.0.txt
80 %{__python} ./run-tests.py
88 %{__python3} ./run-tests.py
93 rm -rf $RPM_BUILD_ROOT
98 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
105 %{__mv} $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
106 # 2.X binary is called by default for now
107 ln -s markdown_py-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
111 rm -rf $RPM_BUILD_ROOT
115 %defattr(644,root,root,755)
116 %doc LICENSE.md README.md docs/{authors.txt,change_log.txt,cli.txt,index.txt,reference.txt,release-*.txt,siteindex.txt,extensions}
117 %attr(755,root,root) %{_bindir}/markdown_py
118 %attr(755,root,root) %{_bindir}/markdown_py-%{py_ver}
119 %{py_sitescriptdir}/markdown
120 %{py_sitescriptdir}/Markdown-%{version}-py*.egg-info
124 %files -n python3-markdown
125 %defattr(644,root,root,755)
126 %doc LICENSE.md README.md docs/{authors.txt,change_log.txt,cli.txt,index.txt,reference.txt,release-*.txt,siteindex.txt,extensions}
127 %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver}
128 %{py3_sitescriptdir}/markdown
129 %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info