Packaging improvements...

- provide pygmentize
- update description to match upstream
- use %{summary} in the subpackage Summary
- drop %{?python_provide:...}
- move BRs before the subpackage
- do not package sources of documentation
- it is no longer needed to fix LICENSE end-of-lines
This commit is contained in:
Miro Hrončok 2021-08-16 11:40:13 +02:00
parent a9b56752f8
commit 6ec5db69a7

View File

@ -13,24 +13,6 @@ Source0: %{pypi_source Pygments}
BuildArch: noarch
%global _description %{expand:
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!}
%description %_description
%package -n python%{python3_pkgversion}-pygments
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: pyproject-rpm-macros
%if %{with tests}
@ -40,21 +22,43 @@ BuildRequires: python%{python3_pkgversion}-pytest
%if %{with docs}
BuildRequires: python%{python3_pkgversion}-sphinx
%endif
Summary: Syntax highlighting engine written in Python
%{?python_provide:%python_provide python%{python3_pkgversion}-pygments}
%global _description %{expand:
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}
%description %_description
%package -n python%{python3_pkgversion}-pygments
Summary: %{summary}
Provides: pygmentize = %{?epoch:%{epoch}:}%{version}-%{release}
%description -n python%{python3_pkgversion}-pygments %_description
%prep
%autosetup -p1 -n Pygments-%{version}
%generate_buildrequires
%pyproject_buildrequires
%build
sed -i 's/\r//' LICENSE
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files pygments
@ -65,7 +69,6 @@ rm -rf build/sphinx/html/.buildinfo
install doc/pygmentize.1 -Dt %{buildroot}%{_mandir}/man1/
chmod -x %{buildroot}%{_mandir}/man1/*.1
%endif
cp -r doc/docs doc/reST
%if %{with tests}
@ -75,7 +78,7 @@ make test PYTHON=%{python3}
%files -n python%{python3_pkgversion}-pygments -f %{pyproject_files}
%doc AUTHORS CHANGES doc/reST
%doc AUTHORS CHANGES
%license LICENSE
%{_bindir}/pygmentize
%if %{with docs}
@ -83,6 +86,7 @@ make test PYTHON=%{python3}
%doc build/sphinx/html
%endif
%changelog
* Mon Aug 16 2021 Miro Hrončok <mhroncok@redhat.com> - 2.10.0-1
- Update to 2.10.0