2 # - check py3 tests, are they ran?
5 %bcond_without tests # do not perform "make test"
6 %bcond_without py3 # do not build python3 package
8 %define module markdown
9 Summary: Markdown implementation in Python
10 Name: python-%{module}
14 Group: Development/Languages/Python
15 Source0: http://pypi.python.org/packages/source/M/Markdown/Markdown-%{version}.tar.gz
16 # Source0-md5: 9e002c8051fb346cae75060f3302048a
17 URL: http://packages.python.org/Markdown/
18 BuildRequires: python-devel
19 BuildRequires: python-elementtree
20 BuildRequires: python-nose
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.219
24 BuildRequires: python3-devel
25 BuildRequires: python3-nose
26 # for converting before running the tests:
27 BuildRequires: python-2to3
29 Requires: python-elementtree
30 Provides: python-Markdown = %{version}-%{release}
31 Obsoletes: python-Markdown = 2.2.1
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 This is a Python implementation of John Gruber's Markdown. It is
37 almost completely compliant with the reference implementation, though
38 there are a few known issues.
40 %package -n python3-markdown
41 Summary: Markdown implementation in Python
42 Group: Development/Languages/Python
44 %description -n python3-markdown
45 This is a Python implementation of John Gruber's Markdown. It is
46 almost completely compliant with the reference implementation, though
47 there are a few known issues.
50 # install does not support --build-base. so create two different trees
52 mv Markdown-%{version} py2
56 find markdown -type f -name '*.py' -exec sed -i -e '/^#!/{1D}' {} ';'
59 sed -i 's/\r//' docs/release-2.2.0.txt
66 %{__python} setup.py build
70 %{__python3} setup.py build
79 2to3 -d -w -n markdown tests run-tests.py > /dev/null
80 # FIXME: run-tests.py shebang points to python2, is that correct?
86 rm -rf $RPM_BUILD_ROOT
87 # somewhy --build-base not supported in install
89 %{__python} setup.py install \
92 --root $RPM_BUILD_ROOT
97 mv $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py_ver}}
101 %{__python3} setup.py install \
104 --root $RPM_BUILD_ROOT
107 mv $RPM_BUILD_ROOT%{_bindir}/markdown_py{,-%{py3_ver}}
110 # 2.X binary is called by default for now
111 ln -s markdown_py-%{py_ver} $RPM_BUILD_ROOT%{_bindir}/markdown_py
114 rm -rf $RPM_BUILD_ROOT
117 %defattr(644,root,root,755)
119 %attr(755,root,root) %{_bindir}/markdown_py
120 %attr(755,root,root) %{_bindir}/markdown_py-%{py_ver}
121 %{py_sitescriptdir}/markdown
122 %{py_sitescriptdir}/Markdown-%{version}-py*.egg-info
125 %files -n python3-markdown
126 %defattr(644,root,root,755)
128 %attr(755,root,root) %{_bindir}/markdown_py-%{py3_ver}
129 %{py3_sitescriptdir}/Markdown-%{version}-py*.egg-info
130 %{py3_sitescriptdir}/markdown