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
23 BuildRequires: python3
24 BuildRequires: python3-2to3
25 BuildRequires: python3-devel
26 BuildRequires: python3-distribute
27 BuildRequires: python3-modules
29 BuildRequires: rpm-pythonprov
30 %pyrequires_eq python-modules
31 Provides: python-Pygments
32 Obsoletes: python-Pygments
34 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37 Pygments is a generic syntax highlighter for general use in all kinds
38 of software such as forum systems, wikis or other applications that
39 need to prettify source code. Highlights are:
40 - a wide range of common languages and markup formats is supported
41 - special attention is paid to details that increase highlighting
43 - support for new languages and formats are added easily; most
44 languages use a simple regex-based lexing mechanism
45 - a number of output formats is available, among them HTML, RTF, LaTeX
47 - it is usable as a command-line tool and as a library
48 - ... and it highlights even Brainf*ck!
50 %description -l pl.UTF-8
51 Pygments to moduł Pythona do podświetlania składni ogólnego
52 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
53 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
54 źródłowego. Zalety Pygments to:
55 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
56 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
58 - łatwa obsługa nowych języków i formatów; większość języków
59 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
61 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
63 - możliwość używania z linii poleceń oraz jako biblioteki
64 - ...a także - podświetla nawet Brainf*cka!
66 %package -n python3-%{module}
67 Summary: Generic syntax highlighter as Python 3.x module
68 Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni
69 Group: Development/Languages/Python
70 Requires: python3-modules
72 %description -n python3-%{module}
73 Pygments is a generic syntax highlighter for general use in all kinds
74 of software such as forum systems, wikis or other applications that
75 need to prettify source code. Highlights are
76 - a wide range of common languages and markup formats is supported
77 - special attention is paid to details that increase highlighting
79 - support for new languages and formats are added easily; most
80 languages use a simple regex-based lexing mechanism
81 - a number of output formats is available, among them HTML, RTF, LaTeX
83 - it is usable as a command-line tool and as a library
84 - ... and it highlights even Brainf*ck!
86 %description -n python3-%{module} -l pl.UTF-8
87 Pygments to moduł Pythona do podświetlania składni ogólnego
88 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
89 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
90 źródłowego. Zalety Pygments to:
91 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
92 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
94 - łatwa obsługa nowych języków i formatów; większość języków
95 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
97 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
99 - możliwość używania z linii poleceń oraz jako biblioteki
100 - ...a także - podświetla nawet Brainf*cka!
103 %setup -q -n Pygments-%{version}
107 %{__python} setup.py build -b build-2
111 %{__python3} setup.py build -b build-3
115 rm -rf $RPM_BUILD_ROOT
118 %{__python} setup.py \
122 --root=$RPM_BUILD_ROOT
124 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
126 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
127 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
132 %{__python3} setup.py \
136 --root=$RPM_BUILD_ROOT
138 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
142 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
146 rm -rf $RPM_BUILD_ROOT
150 %defattr(644,root,root,755)
151 %doc AUTHORS CHANGES LICENSE TODO
152 %attr(755,root,root) %{_bindir}/pygmentize
153 %attr(755,root,root) %{_bindir}/pygmentize-2
154 %{py_sitescriptdir}/%{module}
155 %if "%{py_ver}" > "2.4"
156 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
161 %files -n python3-%{module}
162 %defattr(644,root,root,755)
163 %doc AUTHORS CHANGES LICENSE TODO
164 %attr(755,root,root) %{_bindir}/pygmentize-3
165 %{py3_sitescriptdir}/%{module}
166 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info