| |
@@ -1,23 +1,22 @@
|
| |
%global upstream_name Pygments
|
| |
%global srcname pygments
|
| |
%global sum Syntax highlighting engine written in Python
|
| |
- %if 0%{?fedora} || 0%{?rhel} > 7
|
| |
- %global with_python3 1
|
| |
- %endif
|
| |
|
| |
+ # when bootstrapping, we cannot yet use sphinx
|
| |
+ %bcond_without docs
|
| |
|
| |
Name: python-pygments
|
| |
- Version: 2.2.0
|
| |
- Release: 17%{?dist}
|
| |
+ Version: 2.3.1
|
| |
+ Release: 1%{?dist}
|
| |
Summary: %{sum}
|
| |
|
| |
License: BSD
|
| |
URL: http://pygments.org/
|
| |
- Source0: https://pypi.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
|
| |
- Patch0: import-directive.patch
|
| |
- # Support for Python 3.7:
|
| |
- # https://bitbucket.org/birkenfeld/pygments-main/issues/1457
|
| |
- Patch1: pep479.patch
|
| |
+ Source0: %{pypi_source %{upstream_name} %{version}}
|
| |
+
|
| |
+ # https://bitbucket.org/birkenfeld/pygments-main/commits/113118f16792
|
| |
+ Patch1: sphinx2.patch
|
| |
+
|
| |
BuildArch: noarch
|
| |
|
| |
%description
|
| |
@@ -37,10 +36,10 @@
|
| |
|
| |
|
| |
%package -n python2-%{srcname}
|
| |
- BuildRequires: python%{?fedora:2}-devel >= 2.4, python%{?fedora:2}-setuptools
|
| |
- BuildRequires: python%{?fedora:2}-nose
|
| |
- BuildRequires: python%{?fedora:3}-sphinx
|
| |
- Requires: python%{?fedora:2}-setuptools
|
| |
+ BuildRequires: python2-devel
|
| |
+ BuildRequires: python2-setuptools
|
| |
+ BuildRequires: python2-nose
|
| |
+ Requires: python2-setuptools
|
| |
Summary: %{sum}
|
| |
%{?python_provide:%python_provide python2-%{srcname}}
|
| |
|
| |
@@ -59,10 +58,14 @@
|
| |
* it is usable as a command-line tool and as a library
|
| |
* ... and it highlights even Brainf*ck!
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
%package -n python3-%{srcname}
|
| |
- BuildRequires: python3-devel, python3-setuptools, python3-nose
|
| |
+ BuildRequires: python3-devel
|
| |
+ BuildRequires: python3-setuptools
|
| |
+ BuildRequires: python3-nose
|
| |
Requires: python3-setuptools
|
| |
+ %if %{with docs}
|
| |
+ BuildRequires: python3-sphinx
|
| |
+ %endif
|
| |
Summary: %{sum}
|
| |
%{?python_provide:%python_provide python3-%{srcname}}
|
| |
|
| |
@@ -80,33 +83,28 @@
|
| |
LaTeX and ANSI sequences
|
| |
* it is usable as a command-line tool and as a library
|
| |
* ... and it highlights even Brainf*ck!
|
| |
- %endif
|
| |
|
| |
%prep
|
| |
- %setup -q -n %{upstream_name}-%{version}
|
| |
- %patch0 -p 1
|
| |
- %patch1 -p 1
|
| |
+ %autosetup -p1 -n %{upstream_name}-%{version}
|
| |
|
| |
%build
|
| |
%{__sed} -i 's/\r//' LICENSE
|
| |
%py2_build
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
%py3_build
|
| |
- %endif
|
| |
|
| |
%install
|
| |
# Python 2 install
|
| |
- # NOTE: sphinx is built on Python2 and packages with python2 and python3
|
| |
%py2_install
|
| |
- %{?fedora:%{__python3}}%{?!fedora:%{__python2}} setup.py build_sphinx
|
| |
- install doc/pygmentize.1 -Dt %{buildroot}%{_mandir}/man1/
|
| |
- cp -r doc/docs doc/reST
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
# Python 3 install
|
| |
%py3_install
|
| |
+
|
| |
+ %if %{with docs}
|
| |
+ %{__python3} setup.py build_sphinx
|
| |
+ install doc/pygmentize.1 -Dt %{buildroot}%{_mandir}/man1/
|
| |
%endif
|
| |
+ cp -r doc/docs doc/reST
|
| |
+
|
| |
|
| |
%check
|
| |
make test PYTHON=%{__python2}
|
| |
@@ -114,26 +112,29 @@
|
| |
|
| |
|
| |
%files -n python2-pygments
|
| |
- %doc AUTHORS CHANGES build/sphinx/html doc/reST TODO
|
| |
- %license LICENSE
|
| |
- # For noarch packages: sitelib
|
| |
- %{python2_sitelib}/*
|
| |
- # Fix build on EL7
|
| |
- %if !0%{?fedora} && 0%{?rhel} <= 7
|
| |
- %{_bindir}/pygmentize
|
| |
- %lang(en) %{_mandir}/man1/pygmentize.1*
|
| |
+ %doc AUTHORS CHANGES doc/reST TODO
|
| |
+ %if %{with docs}
|
| |
+ %doc build/sphinx/html
|
| |
%endif
|
| |
+ %license LICENSE
|
| |
+ %{python2_sitelib}/pygments/
|
| |
+ %{python2_sitelib}/Pygments-%{version}-py%{python2_version}.egg-info/
|
| |
|
| |
- %if 0%{?with_python3}
|
| |
%files -n python3-pygments
|
| |
- %doc AUTHORS CHANGES build/sphinx/html doc/reST TODO
|
| |
+ %doc AUTHORS CHANGES doc/reST TODO
|
| |
%license LICENSE
|
| |
- %{python3_sitelib}/*
|
| |
+ %{python3_sitelib}/pygments/
|
| |
+ %{python3_sitelib}/Pygments-%{version}-py%{python3_version}.egg-info/
|
| |
%{_bindir}/pygmentize
|
| |
+ %if %{with docs}
|
| |
%lang(en) %{_mandir}/man1/pygmentize.1*
|
| |
+ %doc build/sphinx/html
|
| |
%endif
|
| |
|
| |
%changelog
|
| |
+ * Tue Mar 12 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-1
|
| |
+ - Update to 2.3.1
|
| |
+
|
| |
* Mon Mar 11 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.2.0-17
|
| |
- Use python3-sphinx to build docs
|
| |
|
| |
cc @qulogic @zbyszek