3 %bcond_without doc # Sphinx documentation
4 %bcond_without tests # unit tests
6 %define module pygments
7 Summary: A generic syntax highlighter as Python 3 module
8 Summary(pl.UTF-8): Moduł Pythona 3 do ogólnego podświetlania składni
9 Name: python3-%{module}
13 Group: Development/Languages/Python
14 #Source0Download: https://pypi.org/simple/pygments/
15 Source0: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
16 # Source0-md5: 87369a4e15019caf9cf056ab2c5858b3
18 URL: http://pygments.org/
19 BuildRequires: python3 >= 1:3.5
20 BuildRequires: python3-devel >= 1:3.5
21 BuildRequires: python3-modules >= 1:3.5
22 BuildRequires: python3-setuptools
24 BuildRequires: python3-pytest
26 BuildRequires: rpm-pythonprov
27 BuildRequires: rpmbuild(macros) >= 1.714
28 %{?with_doc:BuildRequires: sphinx-pdg}
29 Requires: python3-modules >= 1:3.5
30 Requires: python3-setuptools
31 Conflicts: python-pygments < 2.5.2
33 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36 Pygments is a generic syntax highlighter for general use in all kinds
37 of software such as forum systems, wikis or other applications that
38 need to prettify source code. Highlights are:
39 - a wide range of common languages and markup formats is supported
40 - special attention is paid to details that increase highlighting
42 - support for new languages and formats are added easily; most
43 languages use a simple regex-based lexing mechanism
44 - a number of output formats is available, among them HTML, RTF, LaTeX
46 - it is usable as a command-line tool and as a library
47 - ... and it highlights even Brainf*ck!
49 %description -l pl.UTF-8
50 Pygments to moduł Pythona do podświetlania składni ogólnego
51 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
52 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
53 źródłowego. Zalety Pygments to:
54 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
55 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
57 - łatwa obsługa nowych języków i formatów; większość języków
58 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
60 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
62 - możliwość używania z linii poleceń oraz jako biblioteki
63 - ...a także - podświetla nawet Brainf*cka!
66 Summary: API documentation for Python Pygments module
67 Summary(pl.UTF-8): Dokumentacja API modułu Pythona Pygments
71 API documentation for Python Pygments module.
73 %description apidocs -l pl.UTF-8
74 Dokumentacja API modułu Pythona Pygments.
77 %setup -q -n Pygments-%{version}
84 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
85 %{__python3} -m pytest tests
94 rm -rf $RPM_BUILD_ROOT
98 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
100 ln -sf pygmentize-3 $RPM_BUILD_ROOT%{_bindir}/pygmentize
103 rm -rf $RPM_BUILD_ROOT
106 %defattr(644,root,root,755)
107 %doc AUTHORS CHANGES LICENSE README.rst
108 %attr(755,root,root) %{_bindir}/pygmentize
109 %attr(755,root,root) %{_bindir}/pygmentize-3
110 %{py3_sitescriptdir}/pygments
111 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
115 %defattr(644,root,root,755)
116 %doc doc/_build/html/{_static,docs,*.html,*.js}