3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
6 %define module pygments
7 Summary: A generic syntax highlighter as Python 2.x module
8 Summary(pl.UTF-8): Moduł Pythona 2.x do ogólnego podświetlania składni
13 Group: Development/Languages/Python
14 Source0: http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
15 # Source0-md5: a18feedf6ffd0b0cc8c8b0fbdb2027b1
16 URL: http://pygments.org/
19 BuildRequires: python-devel
20 BuildRequires: python-modules
21 BuildRequires: python-setuptools > 7.0
24 BuildRequires: python3
25 BuildRequires: python3-2to3
26 BuildRequires: python3-devel
27 BuildRequires: python3-setuptools > 7.0
28 BuildRequires: python3-modules
30 BuildRequires: rpm-pythonprov
31 Requires: python-setuptools > 7.0
32 Requires: python-modules
33 Provides: python-Pygments = %{version}-%{release}
34 Obsoletes: python-Pygments
36 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39 Pygments is a generic syntax highlighter for general use in all kinds
40 of software such as forum systems, wikis or other applications that
41 need to prettify source code. Highlights are:
42 - a wide range of common languages and markup formats is supported
43 - special attention is paid to details that increase highlighting
45 - support for new languages and formats are added easily; most
46 languages use a simple regex-based lexing mechanism
47 - a number of output formats is available, among them HTML, RTF, LaTeX
49 - it is usable as a command-line tool and as a library
50 - ... and it highlights even Brainf*ck!
52 %description -l pl.UTF-8
53 Pygments to moduł Pythona do podświetlania składni ogólnego
54 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
55 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
56 źródłowego. Zalety Pygments to:
57 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
58 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
60 - łatwa obsługa nowych języków i formatów; większość języków
61 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
63 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
65 - możliwość używania z linii poleceń oraz jako biblioteki
66 - ...a także - podświetla nawet Brainf*cka!
68 %package -n python3-%{module}
69 Summary: Generic syntax highlighter as Python 3.x module
70 Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni
71 Group: Development/Languages/Python
72 Requires: python3-setuptools > 7.0
73 Requires: python3-modules
75 %description -n python3-%{module}
76 Pygments is a generic syntax highlighter for general use in all kinds
77 of software such as forum systems, wikis or other applications that
78 need to prettify source code. Highlights are
79 - a wide range of common languages and markup formats is supported
80 - special attention is paid to details that increase highlighting
82 - support for new languages and formats are added easily; most
83 languages use a simple regex-based lexing mechanism
84 - a number of output formats is available, among them HTML, RTF, LaTeX
86 - it is usable as a command-line tool and as a library
87 - ... and it highlights even Brainf*ck!
89 %description -n python3-%{module} -l pl.UTF-8
90 Pygments to moduł Pythona do podświetlania składni ogólnego
91 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
92 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
93 źródłowego. Zalety Pygments to:
94 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
95 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
97 - łatwa obsługa nowych języków i formatów; większość języków
98 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
100 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
102 - możliwość używania z linii poleceń oraz jako biblioteki
103 - ...a także - podświetla nawet Brainf*cka!
106 %setup -q -n Pygments-%{version}
110 %{__python} setup.py build -b build-2
114 %{__python3} setup.py build -b build-3
118 rm -rf $RPM_BUILD_ROOT
121 %{__python} setup.py \
125 --root=$RPM_BUILD_ROOT
127 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
129 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
130 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
135 %{__python3} setup.py \
139 --root=$RPM_BUILD_ROOT
141 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
145 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
149 rm -rf $RPM_BUILD_ROOT
153 %defattr(644,root,root,755)
154 %doc AUTHORS CHANGES LICENSE TODO
155 %attr(755,root,root) %{_bindir}/pygmentize
156 %attr(755,root,root) %{_bindir}/pygmentize-2
157 %{py_sitescriptdir}/%{module}
158 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
162 %files -n python3-%{module}
163 %defattr(644,root,root,755)
164 %doc AUTHORS CHANGES LICENSE TODO
165 %attr(755,root,root) %{_bindir}/pygmentize-3
166 %{py3_sitescriptdir}/%{module}
167 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info