%global pypi_name CommonMark %global desc Pure Python port of jgm’s stmd.js, a Markdown parser and renderer for the\ CommonMark specification, using only native modules. Once both this project and\ the CommonMark specification are stable we will release the first 1.0 version\ and attempt to keep up to date with changes in stmd.js.\ \ We are currently at the same development stage (actually a bit ahead because we\ have implemented HTML entity conversion and href URL escaping) as stmd.js. Since\ Python versions pre-3.4 use outdated (i.e. not HTML5 spec) entity conversion,\ I’ve converted the 3.4 implementation into a single file, entitytrans.py which\ so far seems to work (all tests pass on 2.7, 3.3, and 3.4). Name: python-%{pypi_name} Version: 0.5.4 Release: 3%{?dist} Summary: Python parser for the CommonMark Markdown spec License: BSD URL: https://pypi.python.org/pypi/%{pypi_name} Source0: https://pypi.python.org/packages/source/C/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description %{desc} %package -n python2-%{pypi_name} BuildRequires: python2-devel Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} %{desc} %package doc Summary: Documentation for python-%{pypi_name} %description doc %{desc} Documentation package. %package -n python%{python3_pkgversion}-%{pypi_name} BuildRequires: python%{python3_pkgversion}-devel Summary: %{summary} %{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} %description -n python%{python3_pkgversion}-%{pypi_name} %{desc} %prep %setup -qn %{pypi_name}-%{version} chmod -x LICENSE chmod -x README.md sed -i '1{\@^#!/usr/bin/env python@d}' CommonMark/CommonMark.py %build %py2_build %py3_build %install %py2_install %py3_install # correct shebang sed -i 's@^#!/usr/bin/python2@#!%{__python3}@' %{buildroot}%{_bindir}/cmark.py %check PYTHONPATH=$(pwd) %{__python2} CommonMark/test/test-CommonMark.py -np PYTHONPATH=$(pwd) %{__python3} CommonMark/test/test-CommonMark.py -np %files -n python2-%{pypi_name} %license LICENSE %{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info %{python2_sitelib}/%{pypi_name}/ %files -n python%{python3_pkgversion}-%{pypi_name} %license LICENSE %{_bindir}/cmark.py %{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/%{pypi_name}/ %files doc %license LICENSE %doc README.md docs/* %changelog * Sat Dec 5 2015 Julien Enselme - 0.5.4-3 - Use only one doc package. - Use %%summary to avoid summary repetition. - Use %%__python3 macro to fix shebang. * Fri Dec 4 2015 Julien Enselme - 0.5.4-2 - Correct shebang of cmark.py (/usr/bin/python2 -> /usr/bin/python3) - Add doc packages. * Fri Dec 4 2015 Julien Enselme - 0.5.4-1 - Inital package