]> git.pld-linux.org Git - packages/python3-pygments.git/blame - python-pygments.spec
- added py3.7 patch (fix StopIteration issues with python 3.7)
[packages/python3-pygments.git] / python-pygments.spec
CommitLineData
b039b19f 1#
8f09c9ec
JB
2# Conditional build:
3%bcond_without python2 # CPython 2.x module
4%bcond_without python3 # CPython 3.x module
e96db9a4
JB
5%bcond_without doc # Sphinx documentation
6%bcond_without tests # unit tests
6d0d5676 7
8f09c9ec
JB
8%define module pygments
9Summary: A generic syntax highlighter as Python 2.x module
10Summary(pl.UTF-8): Moduł Pythona 2.x do ogólnego podświetlania składni
5dc968a7 11Name: python-%{module}
ad49381b 12Version: 2.2.0
e96db9a4 13Release: 3
5dc968a7 14License: BSD
15Group: Development/Languages/Python
e96db9a4 16#Source0Download: https://pypi.org/simple/Pygments/
ad49381b
JB
17Source0: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
18# Source0-md5: 13037baca42f16917cbd5ad2fab50844
971b9c53 19Patch0: rpmspec.patch
e96db9a4 20Patch1: %{name}-py3.7.patch
1fcda2a5 21URL: http://pygments.org/
de554ad7 22BuildRequires: rpmbuild(macros) >= 1.714
0cfd7bce 23%if %{with python2}
de554ad7 24BuildRequires: python >= 1:2.6
21987620 25BuildRequires: python-devel >= 1:2.6
de554ad7 26BuildRequires: python-modules >= 1:2.6
343e28d9 27BuildRequires: python-setuptools
0cfd7bce 28%endif
29%if %{with python3}
de554ad7
JB
30BuildRequires: python3 >= 1:3.2
31BuildRequires: python3-2to3 >= 1:3.2
32BuildRequires: python3-devel >= 1:3.2
33BuildRequires: python3-modules >= 1:3.2
343e28d9 34BuildRequires: python3-setuptools
0cfd7bce 35%endif
2d23140c 36BuildRequires: rpm-pythonprov
e96db9a4 37%{?with_doc:BuildRequires: sphinx-pdg}
de554ad7 38Requires: python-modules >= 1:2.6
343e28d9 39Requires: python-setuptools
ef989146 40Provides: python-Pygments = %{version}-%{release}
e986ca66 41Obsoletes: python-Pygments
5dc968a7 42BuildArch: noarch
43BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45%description
2d23140c 46Pygments is a generic syntax highlighter for general use in all kinds
47of software such as forum systems, wikis or other applications that
8f09c9ec 48need to prettify source code. Highlights are:
5dc968a7 49- a wide range of common languages and markup formats is supported
2d23140c 50- special attention is paid to details that increase highlighting
51 quality
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
55 and ANSI sequences
5dc968a7 56- it is usable as a command-line tool and as a library
57- ... and it highlights even Brainf*ck!
58
8f09c9ec
JB
59%description -l pl.UTF-8
60Pygments to moduł Pythona do podświetlania składni ogólnego
61przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
62foró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ść
66 podświetlania
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
69 regularne
70- dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
71 sekwencje ANSI
72- możliwość używania z linii poleceń oraz jako biblioteki
73- ...a także - podświetla nawet Brainf*cka!
74
b039b19f 75%package -n python3-%{module}
8f09c9ec
JB
76Summary: Generic syntax highlighter as Python 3.x module
77Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni
b039b19f 78Group: Development/Languages/Python
de554ad7 79Requires: python3-modules >= 1:3.2
343e28d9 80Requires: python3-setuptools
b039b19f
AF
81
82%description -n python3-%{module}
2d23140c 83Pygments is a generic syntax highlighter for general use in all kinds
84of software such as forum systems, wikis or other applications that
85need to prettify source code. Highlights are
b039b19f 86- a wide range of common languages and markup formats is supported
2d23140c 87- special attention is paid to details that increase highlighting
88 quality
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
92 and ANSI sequences
b039b19f
AF
93- it is usable as a command-line tool and as a library
94- ... and it highlights even Brainf*ck!
95
8f09c9ec
JB
96%description -n python3-%{module} -l pl.UTF-8
97Pygments to moduł Pythona do podświetlania składni ogólnego
98przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
99foró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ść
103 podświetlania
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
106 regularne
107- dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
108 sekwencje ANSI
109- możliwość używania z linii poleceń oraz jako biblioteki
110- ...a także - podświetla nawet Brainf*cka!
111
e96db9a4
JB
112%package apidocs
113Summary: API documentation for Python Pygments module
114Summary(pl.UTF-8): Dokumentacja API modułu Pythona Pygments
115Group: Documentation
116
117%description apidocs
118API documentation for Python Pygments module.
119
120%description apidocs -l pl.UTF-8
121Dokumentacja API modułu Pythona Pygments.
122
5dc968a7 123%prep
124%setup -q -n Pygments-%{version}
971b9c53 125%patch0 -p1
e96db9a4 126%patch1 -p1
5dc968a7 127
128%build
b039b19f 129%if %{with python2}
cd0bf674 130%py_build
e96db9a4
JB
131
132%if %{with tests}
133%{__python} tests/run.py
134%endif
b039b19f
AF
135%endif
136
137%if %{with python3}
cd0bf674 138%py3_build
e96db9a4
JB
139
140%if %{with tests}
141%{__python3} tests/run.py
142%endif
143%endif
144
145%if %{with doc}
146PYTHONPATH=$(pwd) \
147%{__make} -C doc html
b039b19f 148%endif
5dc968a7 149
150%install
151rm -rf $RPM_BUILD_ROOT
152
b039b19f 153%if %{with python2}
cd0bf674 154%py_install
b039b19f 155
de554ad7 156%{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
5dc968a7 157
158%py_postclean
b039b19f
AF
159%endif
160
161%if %{with python3}
cd0bf674 162%py3_install
b039b19f 163
de554ad7 164%{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
b039b19f
AF
165%endif
166
8f09c9ec
JB
167%if %{with python2}
168ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
169%endif
5dc968a7 170
171%clean
172rm -rf $RPM_BUILD_ROOT
173
b039b19f 174%if %{with python2}
5dc968a7 175%files
176%defattr(644,root,root,755)
e96db9a4 177%doc AUTHORS CHANGES LICENSE README.rst TODO
b039b19f
AF
178%attr(755,root,root) %{_bindir}/pygmentize
179%attr(755,root,root) %{_bindir}/pygmentize-2
5dc968a7 180%{py_sitescriptdir}/%{module}
8f09c9ec 181%{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
b039b19f
AF
182%endif
183
184%if %{with python3}
185%files -n python3-%{module}
186%defattr(644,root,root,755)
e96db9a4 187%doc AUTHORS CHANGES LICENSE README.rst TODO
b039b19f
AF
188%attr(755,root,root) %{_bindir}/pygmentize-3
189%{py3_sitescriptdir}/%{module}
8f09c9ec 190%{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
b039b19f 191%endif
e96db9a4
JB
192
193%if %{with doc}
194%files apidocs
195%defattr(644,root,root,755)
196%doc doc/_build/html/{_static,docs,*.html,*.js}
197%endif
This page took 0.312277 seconds and 4 git commands to generate.