75d2f10
%global upname mistune
75d2f10
%global with_python3 1
75d2f10
75d2f10
Name:           python-mistune
edc5385
Version:        0.7.1
febdfce
Release:        2%{?dist}
75d2f10
Summary:        Markdown parser for Python 
75d2f10
75d2f10
License:        BSD
75d2f10
URL:            https://github.com/lepture/mistune
75d2f10
Source0:        https://github.com/lepture/mistune/archive/v%{version}.tar.gz
75d2f10
75d2f10
BuildRequires:  Cython
75d2f10
BuildRequires:  python2-devel
75d2f10
BuildRequires:  python-nose
75d2f10
BuildRequires:  python-setuptools
75d2f10
%if 0%{?with_python3}
75d2f10
BuildRequires:  python3-Cython
75d2f10
BuildRequires:  python3-devel
75d2f10
BuildRequires:  python3-nose
75d2f10
BuildRequires:  python3-setuptools
75d2f10
%endif
75d2f10
75d2f10
%description
75d2f10
The fastest markdown parser in pure Python, inspired by marked.
75d2f10
75d2f10
75d2f10
%if 0%{?with_python3}
75d2f10
%package -n python3-%{upname}
75d2f10
Summary:        Markdown parser for Python
75d2f10
75d2f10
%description -n python3-%{upname}
75d2f10
The fastest markdown parser in pure Python, inspired by marked.
75d2f10
%endif
75d2f10
75d2f10
%prep
75d2f10
%setup -q -n %{upname}-%{version}
75d2f10
# Moved to source archive from github, doesn't contain egg-info
399065a
#rm -rf mistune.egg-info
75d2f10
75d2f10
%if 0%{?with_python3}
75d2f10
rm -rf %{py3dir}
75d2f10
cp -a . %{py3dir}
75d2f10
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
75d2f10
%endif # with_python3
75d2f10
75d2f10
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
75d2f10
75d2f10
75d2f10
%build
75d2f10
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
75d2f10
75d2f10
%if 0%{?with_python3}
75d2f10
pushd %{py3dir}
75d2f10
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
75d2f10
popd
75d2f10
%endif # with_python3
75d2f10
75d2f10
75d2f10
%install
75d2f10
%if 0%{?with_python3}
75d2f10
pushd %{py3dir}
75d2f10
%{__python3} setup.py install --skip-build --root %{buildroot}
75d2f10
popd
75d2f10
%endif # with_python3
75d2f10
75d2f10
%{__python2} setup.py install --skip-build --root %{buildroot}
75d2f10
%{_fixperms} %{buildroot}/*
75d2f10
75d2f10
75d2f10
%check
75d2f10
%if 0%{?with_python3}
75d2f10
pushd %{py3dir}
75d2f10
%{__python3} setup.py test
75d2f10
popd
75d2f10
%endif # with_python3
75d2f10
75d2f10
%{__python2} setup.py test
75d2f10
75d2f10
%files
75d2f10
%doc LICENSE README.rst
75d2f10
# For arch-specific packages: sitearch
75d2f10
%{python2_sitearch}/%{upname}.*
75d2f10
%{python2_sitearch}/%{upname}-%{version}-py?.?.egg-info
75d2f10
75d2f10
%if 0%{?with_python3}
75d2f10
%files -n python3-%{upname}
75d2f10
%doc LICENSE README.rst
75d2f10
%{python3_sitearch}/%{upname}.*
75d2f10
%{python3_sitearch}/%{upname}-%{version}-py?.?.egg-info
75d2f10
%{python3_sitearch}/__pycache__/%{upname}*
75d2f10
%endif # with_python3
75d2f10
75d2f10
%changelog
febdfce
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.1-2
febdfce
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
febdfce
edc5385
* Wed Sep 23 2015 Christian Dersch <lupinix@fedoraproject.org> - 0.7.1-1
edc5385
- new version
edc5385
e230b1a
* Wed Jun 17 2015 Christian Dersch <lupinix@fedoraproject.org> - 0.6-1
e230b1a
- new upstream release
e230b1a
de5ed37
* Mon Apr 20 2015 Christian Dersch <lupinix@fedoraproject.org> - 0.5.1-1
de5ed37
- new upstream release (0.5.1)
de5ed37
75d2f10
* Fri Dec  5 2014 Christian Dersch <lupinix@fedoraproject.org> - 0.5-1
75d2f10
- new upstream release
75d2f10
- enabled tests
75d2f10
75d2f10
* Thu Dec  4 2014 Christian Dersch <lupinix@fedoraproject.org> - 0.4.1-2
75d2f10
- spec fixes
75d2f10
75d2f10
* Thu Dec  4 2014 Christian Dersch <lupinix@fedoraproject.org> - 0.4.1-1
75d2f10
- initial spec