68560b
# when bootstrapping, we cannot yet use sphinx and pytest
68560b
%bcond_without docs
68560b
%bcond_without tests
68560b
68560b
Name:           python-pygments
68560b
Version:        2.7.4
68560b
Release:        4%{?dist}
68560b
Summary:        Syntax highlighting engine written in Python
68560b
68560b
License:        BSD
68560b
URL:            https://pygments.org/
68560b
68560b
# One of the examples has a questionable licence clause, see:
68560b
#   https://github.com/pygments/pygments/issues/1831
68560b
# To obtain a cleaned-up tarball, run:
68560b
#   $ ./get-clean-tarball.sh
68560b
Source0:        Pygments-%{version}-clean.tar.xz
68560b
Source1:        get-clean-tarball.sh
68560b
68560b
BuildArch:      noarch
68560b
68560b
%global _description %{expand:
68560b
Pygments is a generic syntax highlighter for general use in all kinds
68560b
of software such as forum systems, wikis or other applications that
68560b
need to prettify source code. Highlights are:
68560b
68560b
  * a wide range of common languages and markup formats is supported
68560b
  * special attention is paid to details that increase highlighting
68560b
    quality
68560b
  * support for new languages and formats are added easily; most
68560b
    languages use a simple regex-based lexing mechanism
68560b
  * a number of output formats is available, among them HTML, RTF,
68560b
    LaTeX and ANSI sequences
68560b
  * it is usable as a command-line tool and as a library
68560b
  * ... and it highlights even Brainf*ck!}
68560b
68560b
%description %_description
68560b
68560b
%package -n python%{python3_pkgversion}-pygments
68560b
BuildRequires:  python%{python3_pkgversion}-devel
68560b
BuildRequires:  pyproject-rpm-macros
68560b
%if %{with tests}
68560b
BuildRequires:  make
68560b
BuildRequires:  python%{python3_pkgversion}-pytest
68560b
%endif
68560b
%if %{with docs}
68560b
BuildRequires:  python%{python3_pkgversion}-sphinx
68560b
%endif
68560b
Summary:        Syntax highlighting engine written in Python
68560b
%{?python_provide:%python_provide python%{python3_pkgversion}-pygments}
68560b
68560b
%description -n python%{python3_pkgversion}-pygments %_description
68560b
68560b
%prep
68560b
%autosetup -p1 -n Pygments-%{version}
68560b
68560b
%generate_buildrequires
68560b
%pyproject_buildrequires
68560b
68560b
%build
68560b
sed -i 's/\r//' LICENSE
68560b
%pyproject_wheel
68560b
68560b
%install
68560b
%pyproject_install
68560b
%pyproject_save_files pygments
68560b
68560b
%if %{with docs}
68560b
%{python3} setup.py build_sphinx
68560b
rm -rf build/sphinx/html/.buildinfo
68560b
install doc/pygmentize.1 -Dt %{buildroot}%{_mandir}/man1/
68560b
chmod -x %{buildroot}%{_mandir}/man1/*.1
68560b
%endif
68560b
cp -r doc/docs doc/reST
68560b
68560b
68560b
%if %{with tests}
68560b
%check
68560b
make test PYTHON=%{python3}
68560b
%endif
68560b
68560b
68560b
%files -n python%{python3_pkgversion}-pygments -f %{pyproject_files}
68560b
%doc AUTHORS CHANGES doc/reST
68560b
%license LICENSE
68560b
%{_bindir}/pygmentize
68560b
%if %{with docs}
68560b
%lang(en) %{_mandir}/man1/pygmentize.1*
68560b
%doc build/sphinx/html
68560b
%endif
68560b
68560b
%changelog
68560b
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 2.7.4-4
68560b
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
68560b
  Related: rhbz#1991688
68560b
68560b
* Thu Jun 03 2021 Petr Viktorin <pviktori@redhat.com> - 2.7.4-3
68560b
- Remove test files with a no-nuclear license from the sources
68560b
- Related: rhbz#1950291
68560b
68560b
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.7.4-2
68560b
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
68560b
68560b
* Fri Jan 29 12:41:43 CET 2021 Tomas Hrnciar <thrnciar@redhat.com> - 2.7.4-1
68560b
- Update to 2.7.4
68560b
68560b
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.2-2
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
68560b
68560b
* Wed Nov 25 2020 Petr Viktorin <pviktori@redhat.com> - 2.7.2-1
68560b
- Update to 2.7.2
68560b
68560b
* Mon Oct 12 2020 Tomas Hrnciar <thrnciar@redhat.com> - 2.7.1-1
68560b
- Update to 2.7.1
68560b
68560b
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.6.1-4
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
68560b
68560b
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 2.6.1-3
68560b
- Rebuilt for Python 3.9
68560b
68560b
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 2.6.1-2
68560b
- Bootstrap for Python 3.9
68560b
68560b
* Tue May 19 2020 Miro Hrončok <mhroncok@redhat.com> - 2.6.1-1
68560b
- Update to 2.6.1 (#1776922)
68560b
68560b
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-7
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
68560b
68560b
* Fri Nov 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-6
68560b
- Subpackage python2-pygments has been removed
68560b
  See https://fedoraproject.org/wiki/Changes/RetirePython2
68560b
68560b
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-5
68560b
- Rebuilt for Python 3.8.0rc1 (#1748018)
68560b
68560b
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-4
68560b
- Rebuilt for Python 3.8
68560b
68560b
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 2.4.2-3
68560b
- Bootstrap for Python 3.8
68560b
68560b
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.2-2
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
68560b
68560b
* Wed Jul 10 2019 Kevin Fenzi <kevin@scrye.com> - 2.4.2-1
68560b
- Update to 2.4.2. Fixes bug #1707945
68560b
68560b
* Tue Mar 12 2019 Miro Hrončok <mhroncok@redhat.com> - 2.3.1-1
68560b
- Update to 2.3.1
68560b
68560b
* Mon Mar 11 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 2.2.0-17
68560b
- Use python3-sphinx to build docs
68560b
68560b
* Tue Feb 26 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 2.2.0-16
68560b
- Add missing setuptools Requires
68560b
68560b
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-15
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
68560b
68560b
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-14
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
68560b
68560b
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.0-13
68560b
- Run tests
68560b
- Add fix for 3.7
68560b
68560b
* Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.0-12
68560b
- Rebuilt for Python 3.7
68560b
68560b
* Mon Mar 19 2018 Steve Milner <smilner@redhat.com> - 2.2.0-11
68560b
- Added import-directive.patch to work around a change in sphinx.
68560b
68560b
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-10
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
68560b
68560b
* Fri Sep 29 2017 Troy Dawson <tdawson@redhat.com> - 2.2.0-9
68560b
- Cleanup spec file conditionals
68560b
68560b
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-8
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
68560b
68560b
* Thu Mar 23 2017 Steve Milner <smilner@redhat.com> - 2.2.0-7
68560b
- Fixed python2 sitelib in files section.
68560b
68560b
* Wed Mar 22 2017 Steve Milner <smilner@redhat.com> - 2.2.0-6
68560b
- Dropped python26 support.
68560b
- Spec clean up
68560b
68560b
* Mon Mar 20 2017 Steve Milner <smilner@redhat.com> - 2.2.0-5
68560b
- Updated for standards per BZ#1433650
68560b
68560b
* Mon Mar  6 2017 Steve Milner <smilner@redhat.com> - 2.2.0-4
68560b
- Added conflict per BZ#1429075
68560b
68560b
* Mon Mar  6 2017 Steve Milner <smilner@redhat.com> - 2.2.0-3
68560b
- Python3 package now houses the pygmentize binary
68560b
- Fixed Source0 url to point to pypi.org
68560b
- Made python3-nose a hard BuildRequirement for python3
68560b
68560b
* Thu Mar  2 2017 Steve Milner <smilner@redhat.com> - 2.2.0-2
68560b
- Update bin to come back into line with Fedora standards
68560b
68560b
* Thu Mar  2 2017 Steve Milner <smilner@redhat.com> - 2.2.0-1
68560b
- Update for upstream release.
68560b
68560b
* Thu Mar  2 2017 Steve Milner <smilner@redhat.com> - 2.1.3-5
68560b
- Split bin between versions.
68560b
68560b
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.3-4
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
68560b
68560b
* Mon Dec 12 2016 Charalampos Stratakis <cstratak@redhat.com> - 2.1.3-3
68560b
- Rebuild for Python 3.6
68560b
- Don't make rpmbuild fail on failed tests for now
68560b
68560b
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.3-2
68560b
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
68560b
68560b
* Fri Mar  4 2016 Steve Milner <smilner@redhat.com> - 2.1.3-1
68560b
- Update for upstream release.
68560b
68560b
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.2-5
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
68560b
68560b
* Thu Nov 12 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-4
68560b
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
68560b
68560b
* Thu Oct 29 2015 Steve Milner <smilner@redhat.com> - 2.0.2-3
68560b
- Backport patch to fix font manager shell injection for BZ#1276321
68560b
68560b
* Mon Oct 12 2015 Robert Kuska <rkuska@redhat.com> - 2.0.2-2
68560b
- Rebuilt for Python3.5 rebuild
68560b
- Also remove python3-sphinx from BR as docs are built only with python2-sphinx
68560b
68560b
* Mon Aug 24 2015 Steve Milner <smilner@redhat.com> - 2.0.2-1
68560b
- update for upstream release.
68560b
- Added python-pygments/python3-pygments to BuildRequires.
68560b
68560b
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-4
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
68560b
68560b
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.6-3
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
68560b
68560b
* Sat May 10 2014 Orion Poplawski <orion@cora.nwra.com> - 1.6-2
68560b
- Rebuild for Python 3.4
68560b
68560b
* Tue Nov 26 2013 Steve Milner <smilner@fedoraproject.org> - 1.6-1
68560b
- update for upstream release.
68560b
68560b
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-9
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
68560b
68560b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-8
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
68560b
68560b
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 1.4-7
68560b
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
68560b
68560b
* Fri Aug  3 2012 David Malcolm <dmalcolm@redhat.com> - 1.4-6
68560b
- remove rhel logic from with_python3 conditional
68560b
68560b
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-5
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
68560b
68560b
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-4
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
68560b
68560b
* Tue Sep 13 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.4-3
68560b
- Really enable the python3 unittests.
68560b
- Fix python26 byte compilation (thanks to Jeffrey Ness)
68560b
68560b
* Sat Sep 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.4-2
68560b
- Fix python main package having dependencies for the python2.6 subpackage
68560b
- Fix places that used the default python instead of python26
68560b
- Attempt to make byte compilation more robust in case we add python3 to EPEL5
68560b
- Run unittests on python3 in F15+
68560b
68560b
* Fri Jun 24 2011 Steve Milner <smilner@fedoraproject.org> - 1.4-1
68560b
- update for upstream release
68560b
- Add python2.6 support done by Steve Traylen <steve.traylen@cern.ch>. BZ#662755.
68560b
68560b
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-8
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
68560b
68560b
* Wed Aug 25 2010 Thomas Spura <tomspur@fedoraproject.org> - 1.3.1-7
68560b
- update to most recent python guidelines
68560b
- rebuild with python3.2
68560b
  http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
68560b
68560b
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-6
68560b
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
68560b
68560b
* Thu May  6 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 1.3.1-5
68560b
- Enforce that Pygments requires Python 2.4 or later via an explicit BR
68560b
- Minor tweaks to spec file
68560b
- Deliver html and reST doc files to specifically named directories
68560b
- Align description with that of http://pygments.org/
68560b
- Add %%check section for Python2 and add BR on python-nose
68560b
68560b
* Fri Apr 23 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-4
68560b
- switched with_python3 back to 1
68560b
68560b
* Fri Apr 23 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-3
68560b
- add python3 subpackage (BZ#537244), ignoring soft-dep on imaging for now
68560b
68560b
* Tue Apr 13 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-2
68560b
- added python-imaging as a dependency per BZ#581663.
68560b
68560b
* Sat Mar  6 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-1
68560b
- Updated for release.
68560b
68560b
* Tue Sep 29 2009 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.1.1-1
68560b
- Updated for release.
68560b
68560b
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
68560b
68560b
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
68560b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
68560b
68560b
* Sun Dec 21 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.0-3
68560b
- Updated for release.
68560b
68560b
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.0-2
68560b
- Rebuild for Python 2.6
68560b
68560b
* Thu Nov 27 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.0-1
68560b
- Updated for upstream 1.0.
68560b
68560b
* Sun Sep 14 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.11.1-1
68560b
- Updated for upstream 0.11.
68560b
68560b
* Mon Jul 21 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.10-1
68560b
- Updated for upstream 0.10.
68560b
68560b
* Thu Nov 29 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.9-2
68560b
- Added python-setuptools as a Requires per bz#403601.
68560b
68560b
* Mon Nov 12 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.9-1
68560b
- Updated for upstream 0.9.
68560b
68560b
* Fri Aug 17 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.8.1-2
68560b
- Removed the dos2unix build dependency.
68560b
68560b
* Thu Jun 28 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.8.1-1
68560b
- Initial packaging for Fedora.