python-pygments/python-pygments.spec

110 lines
3.2 KiB
RPMSpec
Raw Permalink Normal View History

2019-12-14 21:12:48 +08:00
%global _description \
Pygments is a generic syntax highlighter suitable for use \
in code hosting, forums, wikis or other applications that \
need to prettify source code. Highlights are: \
* a wide range of over 500 languages and other text \
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 Perl 6!
Name: python-pygments
Summary: Syntax highlighting engine written in Python
2020-08-22 18:34:43 +08:00
Version: 2.5.2
Release: 6
2019-12-14 21:12:48 +08:00
License: BSD
URL: http://pygments.org/
Source0: https://pypi.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
BuildArch: noarch
Patch6000: backport-CVE-2021-20270.patch
Patch6001: backport-CVE-2021-27291.patch
Patch6002: backport-weed-out-more-backtracking-string-regexes.patch
Patch6003: backport-Remove-generated-output-directory-when-make-clean-is.patch
Patch6004: backport-Use-wildcards-to-include-the-pygments-module.patch
2019-12-14 21:12:48 +08:00
%description
%{_description}
%package -n python2-pygments
BuildRequires: python2-devel >= 2.4, python2-setuptools
2020-12-05 16:29:39 +08:00
BuildRequires: python2-nose, python2-sphinx python2-pytest
2019-12-14 21:12:48 +08:00
Summary: Syntax highlighting engine written in Python
%{?python_provide:%python_provide python2-pygments}
%description -n python2-pygments
%{_description}
%package -n python3-pygments
2020-12-05 16:29:39 +08:00
BuildRequires: python3-devel, python3-setuptools, python3-nose python3-pytest
2019-12-14 21:12:48 +08:00
Summary: Syntax highlighting engine written in Python
%{?python_provide:%python_provide python3-pygments}
%description -n python3-pygments
%{_description}
%package_help
%prep
%autosetup -p1 -n Pygments-%{version}
%build
%{__sed} -i 's/\r//' LICENSE
%py2_build
%py3_build
%install
%py2_install
%{__python2} setup.py build_sphinx
pushd doc
install -d %{buildroot}%{_mandir}/man1
mv pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1
popd
cp -r doc/docs doc/reST
%py3_install
%check
2020-12-05 16:29:39 +08:00
%{__python2} -m pytest
%{__python3} -m pytest
2019-12-14 21:12:48 +08:00
%files -n python2-pygments
%license LICENSE
%{python2_sitelib}/*
%files -n python3-pygments
%license LICENSE
%{python3_sitelib}/*
%{_bindir}/pygmentize
%files help
2020-08-22 18:34:43 +08:00
%doc AUTHORS CHANGES build/sphinx/html doc/reST
2019-12-14 21:12:48 +08:00
%lang(en) %{_mandir}/man1/pygmentize.1*
%changelog
* Wed Dec 27 2023 fandehui <fandehui@xfusion.com> - 2.5.2-6
- Use wildcards to include the pygments module
* Thu Nov 3 2021 huangduirong<huangduirong@huawei.com> - 2.5.2-5
- Remove generated output/ directory when 'make clean' is called
* Sun Sep 26 2021 huangduirong<huangduirong@huawei.com> - 2.5.2-4
- Infinite loop in get_tokens_unprocessed
* Mon Apr 12 2021 shixuantong<shixuantong@huawei.com> - 2.5.2-3
- fix CVE-2021-20270 CVE-2021-27291
2020-12-05 16:29:39 +08:00
* Sat Dec 05 2020 shixuantong<shixuantong@huawei.com> - 2.5.2-2
- use pytest to run test suite
2020-08-22 18:34:43 +08:00
* Sat Aug 22 2020 tianwei<tianwei12@huawei.com> - 2.5.2-1
- Package update to 2.5.2
2019-12-14 21:12:48 +08:00
* Fri Dec 6 2019 caomeng<caomeng5@huawei.com> - 2.2.0-15
2020-08-22 18:34:43 +08:00
- Package init