|
|
|
@ -1,25 +1,48 @@
|
|
|
|
|
# when bootstrapping, we cannot yet use sphinx and pytest
|
|
|
|
|
%bcond_without docs
|
|
|
|
|
%global debug_package %{nil}
|
|
|
|
|
# python2X and python3X are built form the same module, so we need a conditional
|
|
|
|
|
# for python[23] bits the state of the conditional is not important in the spec,
|
|
|
|
|
# it is set in modulemd
|
|
|
|
|
%bcond_without python2
|
|
|
|
|
%bcond_without python3
|
|
|
|
|
%bcond_with python36_module
|
|
|
|
|
|
|
|
|
|
%if %{without python3}
|
|
|
|
|
%bcond_with doc
|
|
|
|
|
%else
|
|
|
|
|
%bcond_without doc
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%bcond_without tests
|
|
|
|
|
|
|
|
|
|
%global upstream_name Pygments
|
|
|
|
|
%global srcname pygments
|
|
|
|
|
%global sum Syntax highlighting engine written in Python
|
|
|
|
|
|
|
|
|
|
Name: python-pygments
|
|
|
|
|
Version: 2.7.4
|
|
|
|
|
Release: 4%{?dist}
|
|
|
|
|
Summary: Syntax highlighting engine written in Python
|
|
|
|
|
Version: 2.2.0
|
|
|
|
|
Release: 22%{?dist}
|
|
|
|
|
Summary: %{sum}
|
|
|
|
|
|
|
|
|
|
License: BSD
|
|
|
|
|
URL: https://pygments.org/
|
|
|
|
|
URL: http://pygments.org/
|
|
|
|
|
Source0: https://pypi.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
|
|
|
|
|
Patch0: import-directive.patch
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
# One of the examples has a questionable licence clause, see:
|
|
|
|
|
# https://github.com/pygments/pygments/issues/1831
|
|
|
|
|
# To obtain a cleaned-up tarball, run:
|
|
|
|
|
# $ ./get-clean-tarball.sh
|
|
|
|
|
Source0: Pygments-%{version}-clean.tar.xz
|
|
|
|
|
Source1: get-clean-tarball.sh
|
|
|
|
|
# Fix CVE-2021-20270: infinite loop in SML lexer which may lead to DoS
|
|
|
|
|
# Resolved upstream: https://github.com/pygments/pygments/commit/f91804ff4772e3ab41f46e28d370f57898700333
|
|
|
|
|
Patch1: CVE-2021-20270-infinite-loop-in-SML-lexer.patch
|
|
|
|
|
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
# CVE-2021-27291: ReDos via crafted malicious input
|
|
|
|
|
# Tracking bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2021-27291
|
|
|
|
|
# Upstream fix: https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14
|
|
|
|
|
Patch2: CVE-2021-27291.patch
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
BuildRequires: python3-sphinx
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%global _description %{expand:
|
|
|
|
|
%description
|
|
|
|
|
Pygments is a generic syntax highlighter for general use in all kinds
|
|
|
|
|
of software such as forum systems, wikis or other applications that
|
|
|
|
|
need to prettify source code. Highlights are:
|
|
|
|
@ -32,142 +55,174 @@ need to prettify source code. Highlights are:
|
|
|
|
|
* a number of output formats is available, among them HTML, RTF,
|
|
|
|
|
LaTeX and ANSI sequences
|
|
|
|
|
* it is usable as a command-line tool and as a library
|
|
|
|
|
* ... and it highlights even Brainf*ck!}
|
|
|
|
|
* ... and it highlights even Brainf*ck!
|
|
|
|
|
|
|
|
|
|
%description %_description
|
|
|
|
|
|
|
|
|
|
%package -n python%{python3_pkgversion}-pygments
|
|
|
|
|
BuildRequires: python%{python3_pkgversion}-devel
|
|
|
|
|
BuildRequires: pyproject-rpm-macros
|
|
|
|
|
%if %{with tests}
|
|
|
|
|
BuildRequires: make
|
|
|
|
|
BuildRequires: python%{python3_pkgversion}-pytest
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%package -n python2-%{srcname}
|
|
|
|
|
BuildRequires: python2-devel >= 2.4
|
|
|
|
|
BuildRequires: python2-setuptools
|
|
|
|
|
BuildRequires: python2-nose
|
|
|
|
|
Summary: %{sum}
|
|
|
|
|
%{?python_provide:%python_provide python2-%{srcname}}
|
|
|
|
|
|
|
|
|
|
%description -n python2-%{srcname}
|
|
|
|
|
Pygments is a generic syntax highlighter for general use in all kinds
|
|
|
|
|
of software such as forum systems, wikis or other applications that
|
|
|
|
|
need to prettify source code. Highlights are:
|
|
|
|
|
|
|
|
|
|
* a wide range of common languages and markup formats is supported
|
|
|
|
|
* special attention is paid to details that increase highlighting
|
|
|
|
|
quality
|
|
|
|
|
* support for new languages and formats are added easily; most
|
|
|
|
|
languages use a simple regex-based lexing mechanism
|
|
|
|
|
* a number of output formats is available, among them HTML, RTF,
|
|
|
|
|
LaTeX and ANSI sequences
|
|
|
|
|
* it is usable as a command-line tool and as a library
|
|
|
|
|
* ... and it highlights even Brainf*ck!
|
|
|
|
|
%endif
|
|
|
|
|
%if %{with docs}
|
|
|
|
|
BuildRequires: python%{python3_pkgversion}-sphinx
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%package -n python3-%{srcname}
|
|
|
|
|
%if %{with python36_module}
|
|
|
|
|
BuildRequires: python36-devel
|
|
|
|
|
BuildRequires: python36-rpm-macros
|
|
|
|
|
%else
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
%endif
|
|
|
|
|
Summary: Syntax highlighting engine written in Python
|
|
|
|
|
%{?python_provide:%python_provide python%{python3_pkgversion}-pygments}
|
|
|
|
|
BuildRequires: python3-setuptools, python3-nose
|
|
|
|
|
Summary: %{sum}
|
|
|
|
|
%{?python_provide:%python_provide python3-%{srcname}}
|
|
|
|
|
|
|
|
|
|
%description -n python%{python3_pkgversion}-pygments %_description
|
|
|
|
|
%description -n python3-%{srcname}
|
|
|
|
|
Pygments is a generic syntax highlighter for general use in all kinds
|
|
|
|
|
of software such as forum systems, wikis or other applications that
|
|
|
|
|
need to prettify source code. Highlights are:
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%autosetup -p1 -n Pygments-%{version}
|
|
|
|
|
* a wide range of common languages and markup formats is supported
|
|
|
|
|
* special attention is paid to details that increase highlighting
|
|
|
|
|
quality
|
|
|
|
|
* support for new languages and formats are added easily; most
|
|
|
|
|
languages use a simple regex-based lexing mechanism
|
|
|
|
|
* a number of output formats is available, among them HTML, RTF,
|
|
|
|
|
LaTeX and ANSI sequences
|
|
|
|
|
* it is usable as a command-line tool and as a library
|
|
|
|
|
* ... and it highlights even Brainf*ck!
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
|
%pyproject_buildrequires
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n %{upstream_name}-%{version}
|
|
|
|
|
%patch0 -p 1
|
|
|
|
|
%patch1 -p1
|
|
|
|
|
%patch2 -p1
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
sed -i 's/\r//' LICENSE
|
|
|
|
|
%pyproject_wheel
|
|
|
|
|
%{__sed} -i 's/\r//' LICENSE
|
|
|
|
|
%{?with_python2:%py2_build}
|
|
|
|
|
%{?with_python3:%py3_build}
|
|
|
|
|
%{?with_doc:%{__python3} setup.py build_sphinx}
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%pyproject_install
|
|
|
|
|
%pyproject_save_files pygments
|
|
|
|
|
|
|
|
|
|
%if %{with docs}
|
|
|
|
|
%{python3} setup.py build_sphinx
|
|
|
|
|
rm -rf build/sphinx/html/.buildinfo
|
|
|
|
|
install doc/pygmentize.1 -Dt %{buildroot}%{_mandir}/man1/
|
|
|
|
|
chmod -x %{buildroot}%{_mandir}/man1/*.1
|
|
|
|
|
# Python 2 install
|
|
|
|
|
# NOTE: sphinx is built on Python 3 and packages with python2 and python3
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%py2_install
|
|
|
|
|
mv %{buildroot}%{_bindir}/pygmentize{,-%{python2_version}}
|
|
|
|
|
ln -s pygmentize-%{python2_version} %{buildroot}%{_bindir}/pygmentize-2
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with doc}
|
|
|
|
|
pushd doc
|
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
|
|
|
|
mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
|
|
|
|
|
popd
|
|
|
|
|
cp -r doc/docs doc/reST
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%py3_install
|
|
|
|
|
cp %{buildroot}%{_bindir}/pygmentize{,-%{python3_version}}
|
|
|
|
|
ln -s pygmentize-%{python3_version} %{buildroot}%{_bindir}/pygmentize-3
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with tests}
|
|
|
|
|
%check
|
|
|
|
|
make test PYTHON=%{python3}
|
|
|
|
|
%if %{with tests}
|
|
|
|
|
%{?with_python2:make test PYTHON=%{__python2}}
|
|
|
|
|
%{?with_python3:make test PYTHON=%{__python3}}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with python2}
|
|
|
|
|
%files -n python2-pygments
|
|
|
|
|
%doc AUTHORS CHANGES TODO
|
|
|
|
|
%if %{with doc}
|
|
|
|
|
%doc build/sphinx/html doc/reST
|
|
|
|
|
%lang(en) %{_mandir}/man1/pygmentize.1*
|
|
|
|
|
%endif
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{python2_sitelib}/*
|
|
|
|
|
%{_bindir}/pygmentize-2
|
|
|
|
|
%{_bindir}/pygmentize-%{python2_version}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%files -n python%{python3_pkgversion}-pygments -f %{pyproject_files}
|
|
|
|
|
%doc AUTHORS CHANGES doc/reST
|
|
|
|
|
%if %{with python3}
|
|
|
|
|
%files -n python3-pygments
|
|
|
|
|
%doc AUTHORS CHANGES TODO
|
|
|
|
|
%if %{with doc}
|
|
|
|
|
%doc build/sphinx/html doc/reST
|
|
|
|
|
%lang(en) %{_mandir}/man1/pygmentize.1*
|
|
|
|
|
%endif
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%{python3_sitelib}/*
|
|
|
|
|
%{_bindir}/pygmentize
|
|
|
|
|
%if %{with docs}
|
|
|
|
|
%lang(en) %{_mandir}/man1/pygmentize.1*
|
|
|
|
|
%doc build/sphinx/html
|
|
|
|
|
%{_bindir}/pygmentize-3
|
|
|
|
|
%{_bindir}/pygmentize-%{python3_version}
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.7.4-4
|
|
|
|
|
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
|
|
|
|
Related: rhbz#1991688
|
|
|
|
|
|
|
|
|
|
* Thu Jun 03 2021 Petr Viktorin <pviktori@redhat.com> - 2.7.4-3
|
|
|
|
|
- Remove test files with a no-nuclear license from the sources
|
|
|
|
|
- Related: rhbz#1950291
|
|
|
|
|
|
|
|
|
|
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.7.4-2
|
|
|
|
|
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
|
|
|
|
|
|
|
|
|
* Fri Jan 29 12:41:43 CET 2021 Tomas Hrnciar <thrnciar@redhat.com> - 2.7.4-1
|
|
|
|
|
- Update to 2.7.4
|
|
|
|
|
|
|
|
|
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.2-2
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Wed Nov 25 2020 Petr Viktorin <pviktori@redhat.com> - 2.7.2-1
|
|
|
|
|
- Update to 2.7.2
|
|
|
|
|
|
|
|
|
|
* Mon Oct 12 2020 Tomas Hrnciar <thrnciar@redhat.com> - 2.7.1-1
|
|
|
|
|
- Update to 2.7.1
|
|
|
|
|
|
|
|
|
|
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-4
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 2.6.1-3
|
|
|
|
|
- Rebuilt for Python 3.9
|
|
|
|
|
|
|
|
|
|
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 2.6.1-2
|
|
|
|
|
- Bootstrap for Python 3.9
|
|
|
|
|
|
|
|
|
|
* Tue May 19 2020 Miro Hrončok <mhroncok@redhat.com> - 2.6.1-1
|
|
|
|
|
- Update to 2.6.1 (#1776922)
|
|
|
|
|
|
|
|
|
|
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-7
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Fri Nov 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-6
|
|
|
|
|
- Subpackage python2-pygments has been removed
|
|
|
|
|
See https://fedoraproject.org/wiki/Changes/RetirePython2
|
|
|
|
|
|
|
|
|
|
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-5
|
|
|
|
|
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
|
|
|
|
* Wed Apr 03 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 2.2.0-22
|
|
|
|
|
- Rebuilt for MSVSphere 8.10 beta
|
|
|
|
|
|
|
|
|
|
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-4
|
|
|
|
|
- Rebuilt for Python 3.8
|
|
|
|
|
* Thu Apr 22 2021 Lumír Balhar <lbalhar@redhat.com> - 2.2.0-22
|
|
|
|
|
- Fix CVE-2021-27291: ReDos via crafted malicious input
|
|
|
|
|
Resolves: rhbz#1943459 rhbz#1943460
|
|
|
|
|
|
|
|
|
|
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-3
|
|
|
|
|
- Bootstrap for Python 3.8
|
|
|
|
|
* Wed Mar 03 2021 Charalampos Stratakis <cstratak@redhat.com> - 2.2.0-21
|
|
|
|
|
- Fix CVE-2021-20270: infinite loop in SML lexer which may lead to DoS
|
|
|
|
|
Resolves: rhbz#1933876
|
|
|
|
|
|
|
|
|
|
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-2
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
|
|
|
|
* Thu Apr 25 2019 Tomas Orsava <torsava@redhat.com> - 2.2.0-20
|
|
|
|
|
- Bumping due to problems with modular RPM upgrade path
|
|
|
|
|
- Resolves: rhbz#1695587
|
|
|
|
|
|
|
|
|
|
* Wed Jul 10 2019 Kevin Fenzi <kevin@scrye.com> - 2.4.2-1
|
|
|
|
|
- Update to 2.4.2. Fixes bug #1707945
|
|
|
|
|
* Mon Sep 17 2018 Lumír Balhar <lbalhar@redhat.com> - 2.2.0-19
|
|
|
|
|
- Get rid of unversioned Python dependencies
|
|
|
|
|
- Resolves: rhbz#1628242
|
|
|
|
|
|
|
|
|
|
* Tue Mar 12 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-1
|
|
|
|
|
- Update to 2.3.1
|
|
|
|
|
* Wed Aug 08 2018 Lumír Balhar <lbalhar@redhat.com> - 2.2.0-18
|
|
|
|
|
- Remove unversioned binaries from python2 subpackage
|
|
|
|
|
- Resolves: rhbz#1613343
|
|
|
|
|
|
|
|
|
|
* Mon Mar 11 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.2.0-17
|
|
|
|
|
- Use python3-sphinx to build docs
|
|
|
|
|
* Wed Aug 01 2018 Lumír Balhar <lbalhar@redhat.com> - 2.2.0-17
|
|
|
|
|
- Specfile cleanup
|
|
|
|
|
- Condition for tests
|
|
|
|
|
- Condition for doc
|
|
|
|
|
|
|
|
|
|
* Tue Feb 26 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.0-16
|
|
|
|
|
- Add missing setuptools Requires
|
|
|
|
|
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 2.2.0-16
|
|
|
|
|
- Switch python3 coditions to bcond
|
|
|
|
|
|
|
|
|
|
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-15
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
|
|
|
|
* Wed Jul 18 2018 Tomas Orsava <torsava@redhat.com> - 2.2.0-15
|
|
|
|
|
- BuildRequire also python36-rpm-macros as part of the python36 module build
|
|
|
|
|
|
|
|
|
|
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-14
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
|
|
|
|
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.0-14
|
|
|
|
|
- Add a bcond for python2
|
|
|
|
|
- Fix the test invocation
|
|
|
|
|
|
|
|
|
|
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.0-13
|
|
|
|
|
- Run tests
|
|
|
|
|
- Add fix for 3.7
|
|
|
|
|
* Thu Jun 14 2018 Tomas Orsava <torsava@redhat.com> - 2.2.0-13
|
|
|
|
|
- Switch to using Python 3 version of sphinx
|
|
|
|
|
|
|
|
|
|
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.0-12
|
|
|
|
|
- Rebuilt for Python 3.7
|
|
|
|
|
* Mon Apr 30 2018 Tomas Orsava <torsava@redhat.com> - 2.2.0-12
|
|
|
|
|
- Require the python36-devel package when building for the python36 module
|
|
|
|
|
|
|
|
|
|
* Mon Mar 19 2018 Steve Milner <smilner@redhat.com> - 2.2.0-11
|
|
|
|
|
- Added import-directive.patch to work around a change in sphinx.
|
|
|
|
@ -181,7 +236,7 @@ make test PYTHON=%{python3}
|
|
|
|
|
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-8
|
|
|
|
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
|
|
|
|
|
|
|
|
|
* Thu Mar 23 2017 Steve Milner <smilner@redhat.com> - 2.2.0-7
|
|
|
|
|
* Thu Mar 22 2017 Steve Milner <smilner@redhat.com> - 2.2.0-7
|
|
|
|
|
- Fixed python2 sitelib in files section.
|
|
|
|
|
|
|
|
|
|
* Wed Mar 22 2017 Steve Milner <smilner@redhat.com> - 2.2.0-6
|
|
|
|
|