Blob Blame History Raw
%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.7.2
Release:        2%{?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/6b/6b/9f711705fd36259a47ae7b5a4feeea664eea46d3a54856bbda00de7f119c/CommonMark-0.7.2.tar.gz

BuildArch:      noarch

%description
%{desc}

%package -n     python2-%{pypi_name}
BuildRequires:  python2-devel
BuildRequires:  python2-future
BuildRequires:  python2-hypothesis
Requires:       python2-future
Suggests: python-CommonMark-doc
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     python3-%{pypi_name}
BuildRequires:  python3-devel
BuildRequires:  python3-future
BuildRequires:  python3-hypothesis
Requires:       python3-future
Suggests: python-CommonMark-doc
Summary:        %{summary}
%{?python_provide:%python_provide python3-%{pypi_name}}

%description -n python3-%{pypi_name}
%{desc}


%prep
%setup -qn %{pypi_name}-%{version}
# Fix non executable scripts
sed -i '1{\@^#!/usr/bin/env python@d}' CommonMark/tests/run_spec_tests.py
sed -i '1{\@^#!/usr/bin/env python@d}' CommonMark/cmark.py



%build
%py2_build
%py3_build


%install
%py2_install
%py3_install


%check
export LC_ALL='en_US.utf8'
export LC_CTYPE='en_US.utf8'
export LANG=en_US.utf8
export PYTHONIOENCODING=UTF-8
PYTHONPATH=$(pwd) %{__python2} setup.py test
PYTHONPATH=$(pwd) %{__python3} setup.py test


%files -n python2-%{pypi_name}
%license LICENSE
%{python2_sitelib}/%{pypi_name}-%{version}-py%{python2_version}.egg-info
%{python2_sitelib}/%{pypi_name}/

%files -n python3-%{pypi_name}
%license LICENSE
%{_bindir}/cmark
%{python3_sitelib}/%{pypi_name}-%{version}-py%{python3_version}.egg-info
%{python3_sitelib}/%{pypi_name}/

%files doc
%license LICENSE
%doc README.rst spec.txt


%changelog
* Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 0.7.2-2
- Correct encodings in tests

* Sun Sep 18 2016 Julien Enselme <jujens@jujens.eu> - 0.7.2-1
- Update to 0.7.2

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.4-5
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Dec 5 2015 Julien Enselme <jujens@jujens.eu> - 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 <jujens@jujens.eu> - 0.5.4-2
- Correct shebang of cmark.py (/usr/bin/python2 -> /usr/bin/python3)
- Add doc packages.

* Fri Dec 4 2015 Julien Enselme <jujens@jujens.eu> - 0.5.4-1
- Inital package