3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
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: 13037baca42f16917cbd5ad2fab50844
20 Patch1: %{name}-py3.7.patch
21 URL: http://pygments.org/
22 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: python >= 1:2.6
25 BuildRequires: python-devel >= 1:2.6
26 BuildRequires: python-modules >= 1:2.6
27 BuildRequires: python-setuptools
30 BuildRequires: python3 >= 1:3.2
31 BuildRequires: python3-2to3 >= 1:3.2
32 BuildRequires: python3-devel >= 1:3.2
33 BuildRequires: python3-modules >= 1:3.2
34 BuildRequires: python3-setuptools
36 BuildRequires: rpm-pythonprov
37 %{?with_doc:BuildRequires: sphinx-pdg}
38 Requires: python-modules >= 1:2.6
39 Requires: python-setuptools
40 Provides: python-Pygments = %{version}-%{release}
41 Obsoletes: python-Pygments
43 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 Pygments is a generic syntax highlighter for general use in all kinds
47 of software such as forum systems, wikis or other applications that
48 need to prettify source code. Highlights are:
49 - a wide range of common languages and markup formats is supported
50 - special attention is paid to details that increase highlighting
52 - support for new languages and formats are added easily; most
53 languages use a simple regex-based lexing mechanism
54 - a number of output formats is available, among them HTML, RTF, LaTeX
56 - it is usable as a command-line tool and as a library
57 - ... and it highlights even Brainf*ck!
59 %description -l pl.UTF-8
60 Pygments to moduł Pythona do podświetlania składni ogólnego
61 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
62 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
63 źródłowego. Zalety Pygments to:
64 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
65 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
67 - łatwa obsługa nowych języków i formatów; większość języków
68 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
70 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
72 - możliwość używania z linii poleceń oraz jako biblioteki
73 - ...a także - podświetla nawet Brainf*cka!
75 %package -n python3-%{module}
76 Summary: Generic syntax highlighter as Python 3.x module
77 Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni
78 Group: Development/Languages/Python
79 Requires: python3-modules >= 1:3.2
80 Requires: python3-setuptools
82 %description -n python3-%{module}
83 Pygments is a generic syntax highlighter for general use in all kinds
84 of software such as forum systems, wikis or other applications that
85 need to prettify source code. Highlights are
86 - a wide range of common languages and markup formats is supported
87 - special attention is paid to details that increase highlighting
89 - support for new languages and formats are added easily; most
90 languages use a simple regex-based lexing mechanism
91 - a number of output formats is available, among them HTML, RTF, LaTeX
93 - it is usable as a command-line tool and as a library
94 - ... and it highlights even Brainf*ck!
96 %description -n python3-%{module} -l pl.UTF-8
97 Pygments to moduł Pythona do podświetlania składni ogólnego
98 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
99 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
100 źródłowego. Zalety Pygments to:
101 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
102 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
104 - łatwa obsługa nowych języków i formatów; większość języków
105 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
107 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
109 - możliwość używania z linii poleceń oraz jako biblioteki
110 - ...a także - podświetla nawet Brainf*cka!
113 Summary: API documentation for Python Pygments module
114 Summary(pl.UTF-8): Dokumentacja API modułu Pythona Pygments
118 API documentation for Python Pygments module.
120 %description apidocs -l pl.UTF-8
121 Dokumentacja API modułu Pythona Pygments.
124 %setup -q -n Pygments-%{version}
133 %{__python} tests/run.py
141 %{__python3} tests/run.py
147 %{__make} -C doc html
151 rm -rf $RPM_BUILD_ROOT
156 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
164 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
168 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
172 rm -rf $RPM_BUILD_ROOT
176 %defattr(644,root,root,755)
177 %doc AUTHORS CHANGES LICENSE README.rst TODO
178 %attr(755,root,root) %{_bindir}/pygmentize
179 %attr(755,root,root) %{_bindir}/pygmentize-2
180 %{py_sitescriptdir}/%{module}
181 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
185 %files -n python3-%{module}
186 %defattr(644,root,root,755)
187 %doc AUTHORS CHANGES LICENSE README.rst TODO
188 %attr(755,root,root) %{_bindir}/pygmentize-3
189 %{py3_sitescriptdir}/%{module}
190 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
195 %defattr(644,root,root,755)
196 %doc doc/_build/html/{_static,docs,*.html,*.js}