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: 238587a1370d62405edabd0794b3ec4a
17 URL: http://pygments.org/
20 BuildRequires: python-devel >= 1:2.6
21 BuildRequires: python-modules
22 BuildRequires: python-setuptools
25 BuildRequires: python3
26 BuildRequires: python3-2to3
27 BuildRequires: python3-devel
28 BuildRequires: python3-modules
29 BuildRequires: python3-setuptools
31 BuildRequires: rpm-pythonprov
32 Requires: python-modules
33 Requires: python-setuptools
34 Provides: python-Pygments = %{version}-%{release}
35 Obsoletes: python-Pygments
37 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
40 Pygments is a generic syntax highlighter for general use in all kinds
41 of software such as forum systems, wikis or other applications that
42 need to prettify source code. Highlights are:
43 - a wide range of common languages and markup formats is supported
44 - special attention is paid to details that increase highlighting
46 - support for new languages and formats are added easily; most
47 languages use a simple regex-based lexing mechanism
48 - a number of output formats is available, among them HTML, RTF, LaTeX
50 - it is usable as a command-line tool and as a library
51 - ... and it highlights even Brainf*ck!
53 %description -l pl.UTF-8
54 Pygments to moduł Pythona do podświetlania składni ogólnego
55 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
56 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
57 źródłowego. Zalety Pygments to:
58 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
59 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
61 - łatwa obsługa nowych języków i formatów; większość języków
62 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
64 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
66 - możliwość używania z linii poleceń oraz jako biblioteki
67 - ...a także - podświetla nawet Brainf*cka!
69 %package -n python3-%{module}
70 Summary: Generic syntax highlighter as Python 3.x module
71 Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni
72 Group: Development/Languages/Python
73 Requires: python3-modules
74 Requires: python3-setuptools
76 %description -n python3-%{module}
77 Pygments is a generic syntax highlighter for general use in all kinds
78 of software such as forum systems, wikis or other applications that
79 need to prettify source code. Highlights are
80 - a wide range of common languages and markup formats is supported
81 - special attention is paid to details that increase highlighting
83 - support for new languages and formats are added easily; most
84 languages use a simple regex-based lexing mechanism
85 - a number of output formats is available, among them HTML, RTF, LaTeX
87 - it is usable as a command-line tool and as a library
88 - ... and it highlights even Brainf*ck!
90 %description -n python3-%{module} -l pl.UTF-8
91 Pygments to moduł Pythona do podświetlania składni ogólnego
92 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
93 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
94 źródłowego. Zalety Pygments to:
95 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
96 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
98 - łatwa obsługa nowych języków i formatów; większość języków
99 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
101 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
103 - możliwość używania z linii poleceń oraz jako biblioteki
104 - ...a także - podświetla nawet Brainf*cka!
107 %setup -q -n Pygments-%{version}
112 %{__python} setup.py build -b build-2
116 %{__python3} setup.py build -b build-3
120 rm -rf $RPM_BUILD_ROOT
123 %{__python} setup.py \
127 --root=$RPM_BUILD_ROOT
129 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
131 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
132 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
137 %{__python3} setup.py \
141 --root=$RPM_BUILD_ROOT
143 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
147 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
151 rm -rf $RPM_BUILD_ROOT
155 %defattr(644,root,root,755)
156 %doc AUTHORS CHANGES LICENSE TODO
157 %attr(755,root,root) %{_bindir}/pygmentize
158 %attr(755,root,root) %{_bindir}/pygmentize-2
159 %{py_sitescriptdir}/%{module}
160 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
164 %files -n python3-%{module}
165 %defattr(644,root,root,755)
166 %doc AUTHORS CHANGES LICENSE TODO
167 %attr(755,root,root) %{_bindir}/pygmentize-3
168 %{py3_sitescriptdir}/%{module}
169 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info