]>
Commit | Line | Data |
---|---|---|
b039b19f | 1 | # |
8f09c9ec | 2 | # Conditional build: |
e96db9a4 JB |
3 | %bcond_without doc # Sphinx documentation |
4 | %bcond_without tests # unit tests | |
6d0d5676 | 5 | |
8f09c9ec | 6 | %define module pygments |
75ca7121 JB |
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} | |
10 | Version: 2.7.1 | |
11 | Release: 1 | |
5dc968a7 | 12 | License: BSD |
13 | Group: Development/Languages/Python | |
734c86c9 | 14 | #Source0Download: https://pypi.org/simple/pygments/ |
ad49381b | 15 | Source0: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz |
75ca7121 | 16 | # Source0-md5: 8b4d5fe67fde78e9cf7eab088b341bfb |
971b9c53 | 17 | Patch0: rpmspec.patch |
1fcda2a5 | 18 | URL: http://pygments.org/ |
3bee43f6 JB |
19 | BuildRequires: python3 >= 1:3.5 |
20 | BuildRequires: python3-devel >= 1:3.5 | |
21 | BuildRequires: python3-modules >= 1:3.5 | |
343e28d9 | 22 | BuildRequires: python3-setuptools |
3bee43f6 | 23 | %if %{with tests} |
734c86c9 | 24 | BuildRequires: python3-pytest |
3bee43f6 | 25 | %endif |
2d23140c | 26 | BuildRequires: rpm-pythonprov |
75ca7121 | 27 | BuildRequires: rpmbuild(macros) >= 1.714 |
e96db9a4 | 28 | %{?with_doc:BuildRequires: sphinx-pdg} |
75ca7121 JB |
29 | Requires: python3-modules >= 1:3.5 |
30 | Requires: python3-setuptools | |
6fad5816 | 31 | Conflicts: python-pygments < 2.5.2 |
5dc968a7 | 32 | BuildArch: noarch |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
34 | ||
35 | %description | |
2d23140c | 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 | |
8f09c9ec | 38 | need to prettify source code. Highlights are: |
5dc968a7 | 39 | - a wide range of common languages and markup formats is supported |
2d23140c | 40 | - special attention is paid to details that increase highlighting |
41 | quality | |
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 | |
45 | and ANSI sequences | |
5dc968a7 | 46 | - it is usable as a command-line tool and as a library |
47 | - ... and it highlights even Brainf*ck! | |
48 | ||
8f09c9ec JB |
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ść | |
56 | podświetlania | |
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 | |
59 | regularne | |
60 | - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i | |
61 | sekwencje ANSI | |
62 | - możliwość używania z linii poleceń oraz jako biblioteki | |
63 | - ...a także - podświetla nawet Brainf*cka! | |
64 | ||
e96db9a4 JB |
65 | %package apidocs |
66 | Summary: API documentation for Python Pygments module | |
67 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona Pygments | |
68 | Group: Documentation | |
69 | ||
70 | %description apidocs | |
71 | API documentation for Python Pygments module. | |
72 | ||
73 | %description apidocs -l pl.UTF-8 | |
74 | Dokumentacja API modułu Pythona Pygments. | |
75 | ||
5dc968a7 | 76 | %prep |
77 | %setup -q -n Pygments-%{version} | |
971b9c53 | 78 | %patch0 -p1 |
5dc968a7 | 79 | |
80 | %build | |
cd0bf674 | 81 | %py3_build |
e96db9a4 JB |
82 | |
83 | %if %{with tests} | |
734c86c9 | 84 | %{__python3} -m pytest tests |
e96db9a4 | 85 | %endif |
e96db9a4 JB |
86 | |
87 | %if %{with doc} | |
88 | PYTHONPATH=$(pwd) \ | |
89 | %{__make} -C doc html | |
b039b19f | 90 | %endif |
5dc968a7 | 91 | |
92 | %install | |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
cd0bf674 | 95 | %py3_install |
b039b19f | 96 | |
de554ad7 | 97 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3} |
b039b19f | 98 | |
734c86c9 | 99 | ln -sf pygmentize-3 $RPM_BUILD_ROOT%{_bindir}/pygmentize |
5dc968a7 | 100 | |
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %files | |
105 | %defattr(644,root,root,755) | |
734c86c9 | 106 | %doc AUTHORS CHANGES LICENSE README.rst |
734c86c9 | 107 | %attr(755,root,root) %{_bindir}/pygmentize |
b039b19f | 108 | %attr(755,root,root) %{_bindir}/pygmentize-3 |
75ca7121 | 109 | %{py3_sitescriptdir}/pygments |
8f09c9ec | 110 | %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info |
e96db9a4 JB |
111 | |
112 | %if %{with doc} | |
113 | %files apidocs | |
114 | %defattr(644,root,root,755) | |
115 | %doc doc/_build/html/{_static,docs,*.html,*.js} | |
116 | %endif |