| |
@@ -1,12 +1,11 @@
|
| |
%global upname mistune
|
| |
- %global with_python3 1
|
| |
|
| |
%global common_description %{expand:
|
| |
The fastest markdown parser in pure Python, inspired by marked.}
|
| |
|
| |
Name: python-mistune
|
| |
Version: 0.8.3
|
| |
- Release: 8%{?dist}
|
| |
+ Release: 9%{?dist}
|
| |
Summary: Markdown parser for Python
|
| |
|
| |
License: BSD
|
| |
@@ -14,92 +13,76 @@
|
| |
Source0: https://github.com/lepture/mistune/archive/v%{version}.tar.gz
|
| |
|
| |
BuildRequires: gcc
|
| |
- BuildRequires: python2-Cython
|
| |
+
|
| |
BuildRequires: python2-devel
|
| |
BuildRequires: python2-nose
|
| |
BuildRequires: python2-setuptools
|
| |
- %if 0%{?with_python3}
|
| |
+
|
| |
BuildRequires: python3-Cython
|
| |
BuildRequires: python3-devel
|
| |
BuildRequires: python3-nose
|
| |
BuildRequires: python3-setuptools
|
| |
- %endif
|
| |
-
|
| |
|
| |
%description %{common_description}
|
| |
|
| |
+
|
| |
%package -n python2-%{upname}
|
| |
Summary: %{summary}
|
| |
+ Obsoletes: python2-%{upname} < 0.8.3-8
|
| |
+ BuildArch: noarch
|
| |
%{?python_provide:%python_provide python2-%{upname}}
|
| |
|
| |
%description -n python2-%{upname} %{common_description}
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
+
|
| |
%package -n python3-%{upname}
|
| |
Summary: %{summary}
|
| |
+ %{?python_provide:%python_provide python3-%{upname}}
|
| |
|
| |
%description -n python3-%{upname} %{common_description}
|
| |
- %endif
|
| |
+
|
| |
|
| |
%prep
|
| |
%setup -q -n %{upname}-%{version}
|
| |
- # Moved to source archive from github, doesn't contain egg-info
|
| |
- #rm -rf mistune.egg-info
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- rm -rf %{py3dir}
|
| |
- cp -a . %{py3dir}
|
| |
- find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
| |
- %endif # with_python3
|
| |
-
|
| |
- find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|'
|
| |
|
| |
|
| |
%build
|
| |
- CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- pushd %{py3dir}
|
| |
+ %py2_build
|
| |
%py3_build
|
| |
- popd
|
| |
- %endif # with_python3
|
| |
|
| |
|
| |
%install
|
| |
- %if 0%{?with_python3}
|
| |
- pushd %{py3dir}
|
| |
+ %py2_install
|
| |
%py3_install
|
| |
- popd
|
| |
- %endif # with_python3
|
| |
|
| |
- %{__python2} setup.py install --skip-build --root %{buildroot}
|
| |
+ pathfix.py -pni "%{__python2} %{py2_shbang_opts}" %{buildroot}%{python2_sitelib}
|
| |
+ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}%{python3_sitearch}
|
| |
%{_fixperms} %{buildroot}/*
|
| |
|
| |
|
| |
%check
|
| |
- %if 0%{?with_python3}
|
| |
- pushd %{py3dir}
|
| |
+ %{__python2} setup.py test
|
| |
%{__python3} setup.py test
|
| |
- popd
|
| |
- %endif # with_python3
|
| |
|
| |
- %{__python2} setup.py test
|
| |
|
| |
%files -n python2-%{upname}
|
| |
- %doc LICENSE README.rst
|
| |
- # For arch-specific packages: sitearch
|
| |
- %{python2_sitearch}/%{upname}.*
|
| |
- %{python2_sitearch}/%{upname}-%{version}-py?.?.egg-info
|
| |
+ %doc README.rst
|
| |
+ %license LICENSE
|
| |
+ %{python2_sitelib}/%{upname}.*
|
| |
+ %{python2_sitelib}/%{upname}-%{version}-py%{python2_version}.egg-info/
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
%files -n python3-%{upname}
|
| |
- %doc LICENSE README.rst
|
| |
+ %doc README.rst
|
| |
+ %license LICENSE
|
| |
%{python3_sitearch}/%{upname}.*
|
| |
- %{python3_sitearch}/%{upname}-%{version}-py?.?.egg-info
|
| |
+ %{python3_sitearch}/%{upname}-%{version}-py%{python3_version}.egg-info/
|
| |
%{python3_sitearch}/__pycache__/%{upname}*
|
| |
- %endif # with_python3
|
| |
+
|
| |
|
| |
%changelog
|
| |
+ * Thu Sep 12 2019 Miro Hrončok <mhroncok@redhat.com> - 0.8.3-9
|
| |
+ - Modernize packaging, drop build dependency on python2-Cython
|
| |
+
|
| |
* Sat Aug 17 2019 Miro Hrončok <mhroncok@redhat.com> - 0.8.3-8
|
| |
- Rebuilt for Python 3.8
|
| |
|
| |