3 %bcond_without python2 # CPython 2.x module
4 %bcond_with python3 # CPython 3.x module (built from python3-pygments.spec)
5 %bcond_without doc # Sphinx documentation
6 %bcond_without tests # unit tests
8 %define module pygments
9 Summary: A generic syntax highlighter as Python 2.x module
10 Summary(pl.UTF-8): Moduł Pythona 2.x do ogólnego podświetlania składni
11 Name: python-%{module}
15 Group: Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/pygments/
17 Source0: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
18 # Source0-md5: 465a35559863089d959d783a69f79b9f
20 URL: https://pygments.org/
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python >= 1:2.7
24 BuildRequires: python-devel >= 1:2.7
25 BuildRequires: python-modules >= 1:2.7
26 BuildRequires: python-setuptools
28 BuildRequires: python-pytest
32 BuildRequires: python3 >= 1:3.5
33 BuildRequires: python3-devel >= 1:3.5
34 BuildRequires: python3-modules >= 1:3.5
35 BuildRequires: python3-setuptools
37 BuildRequires: python3-pytest
40 BuildRequires: rpm-pythonprov
41 %{?with_doc:BuildRequires: sphinx-pdg-2}
42 Requires: python-modules >= 1:2.7
43 Requires: python-setuptools
44 Provides: python-Pygments = %{version}-%{release}
45 Obsoletes: python-Pygments < 1.5
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 Pygments is a generic syntax highlighter for general use in all kinds
51 of software such as forum systems, wikis or other applications that
52 need to prettify source code. Highlights are:
53 - a wide range of common languages and markup formats is supported
54 - special attention is paid to details that increase highlighting
56 - support for new languages and formats are added easily; most
57 languages use a simple regex-based lexing mechanism
58 - a number of output formats is available, among them HTML, RTF, LaTeX
60 - it is usable as a command-line tool and as a library
61 - ... and it highlights even Brainf*ck!
63 %description -l pl.UTF-8
64 Pygments to moduł Pythona do podświetlania składni ogólnego
65 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
66 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
67 źródłowego. Zalety Pygments to:
68 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
69 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
71 - łatwa obsługa nowych języków i formatów; większość języków
72 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
74 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
76 - możliwość używania z linii poleceń oraz jako biblioteki
77 - ...a także - podświetla nawet Brainf*cka!
79 %package -n python3-%{module}
80 Summary: Generic syntax highlighter as Python 3.x module
81 Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni
82 Group: Development/Languages/Python
83 Requires: python3-modules >= 1:3.5
84 Requires: python3-setuptools
85 Conflicts: python-pygments < 2.5.2
87 %description -n python3-%{module}
88 Pygments is a generic syntax highlighter for general use in all kinds
89 of software such as forum systems, wikis or other applications that
90 need to prettify source code. Highlights are
91 - a wide range of common languages and markup formats is supported
92 - special attention is paid to details that increase highlighting
94 - support for new languages and formats are added easily; most
95 languages use a simple regex-based lexing mechanism
96 - a number of output formats is available, among them HTML, RTF, LaTeX
98 - it is usable as a command-line tool and as a library
99 - ... and it highlights even Brainf*ck!
101 %description -n python3-%{module} -l pl.UTF-8
102 Pygments to moduł Pythona do podświetlania składni ogólnego
103 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
104 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
105 źródłowego. Zalety Pygments to:
106 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
107 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
109 - łatwa obsługa nowych języków i formatów; większość języków
110 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
112 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
114 - możliwość używania z linii poleceń oraz jako biblioteki
115 - ...a także - podświetla nawet Brainf*cka!
118 Summary: API documentation for Python Pygments module
119 Summary(pl.UTF-8): Dokumentacja API modułu Pythona Pygments
123 API documentation for Python Pygments module.
125 %description apidocs -l pl.UTF-8
126 Dokumentacja API modułu Pythona Pygments.
129 %setup -q -n Pygments-%{version}
137 %{__python} -m pytest tests
145 %{__python3} -m pytest tests
151 %{__make} -C doc html \
152 SPHINXBUILD=sphinx-build-2
156 rm -rf $RPM_BUILD_ROOT
161 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
169 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
173 ln -sf pygmentize-3 $RPM_BUILD_ROOT%{_bindir}/pygmentize
177 rm -rf $RPM_BUILD_ROOT
181 %defattr(644,root,root,755)
182 %doc AUTHORS CHANGES LICENSE README.rst
183 %attr(755,root,root) %{_bindir}/pygmentize-2
184 %{py_sitescriptdir}/%{module}
185 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
189 %files -n python3-%{module}
190 %defattr(644,root,root,755)
191 %doc AUTHORS CHANGES LICENSE README.rst
192 %attr(755,root,root) %{_bindir}/pygmentize
193 %attr(755,root,root) %{_bindir}/pygmentize-3
194 %{py3_sitescriptdir}/%{module}
195 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
200 %defattr(644,root,root,755)
201 %doc doc/_build/html/{_static,docs,*.html,*.js}