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 #Source0Download: https://pypi.python.org/pypi/Pygments
15 Source0: http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
16 # Source0-md5: 238587a1370d62405edabd0794b3ec4a
18 URL: http://pygments.org/
21 BuildRequires: python-devel >= 1:2.6
22 BuildRequires: python-modules
23 BuildRequires: python-setuptools
26 BuildRequires: python3
27 BuildRequires: python3-2to3
28 BuildRequires: python3-devel
29 BuildRequires: python3-modules
30 BuildRequires: python3-setuptools
32 BuildRequires: rpm-pythonprov
33 Requires: python-modules
34 Requires: python-setuptools
35 Provides: python-Pygments = %{version}-%{release}
36 Obsoletes: python-Pygments
38 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
41 Pygments is a generic syntax highlighter for general use in all kinds
42 of software such as forum systems, wikis or other applications that
43 need to prettify source code. Highlights are:
44 - a wide range of common languages and markup formats is supported
45 - special attention is paid to details that increase highlighting
47 - support for new languages and formats are added easily; most
48 languages use a simple regex-based lexing mechanism
49 - a number of output formats is available, among them HTML, RTF, LaTeX
51 - it is usable as a command-line tool and as a library
52 - ... and it highlights even Brainf*ck!
54 %description -l pl.UTF-8
55 Pygments to moduł Pythona do podświetlania składni ogólnego
56 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
57 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
58 źródłowego. Zalety Pygments to:
59 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
60 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
62 - łatwa obsługa nowych języków i formatów; większość języków
63 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
65 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
67 - możliwość używania z linii poleceń oraz jako biblioteki
68 - ...a także - podświetla nawet Brainf*cka!
70 %package -n python3-%{module}
71 Summary: Generic syntax highlighter as Python 3.x module
72 Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni
73 Group: Development/Languages/Python
74 Requires: python3-modules
75 Requires: python3-setuptools
77 %description -n python3-%{module}
78 Pygments is a generic syntax highlighter for general use in all kinds
79 of software such as forum systems, wikis or other applications that
80 need to prettify source code. Highlights are
81 - a wide range of common languages and markup formats is supported
82 - special attention is paid to details that increase highlighting
84 - support for new languages and formats are added easily; most
85 languages use a simple regex-based lexing mechanism
86 - a number of output formats is available, among them HTML, RTF, LaTeX
88 - it is usable as a command-line tool and as a library
89 - ... and it highlights even Brainf*ck!
91 %description -n python3-%{module} -l pl.UTF-8
92 Pygments to moduł Pythona do podświetlania składni ogólnego
93 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
94 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
95 źródłowego. Zalety Pygments to:
96 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
97 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
99 - łatwa obsługa nowych języków i formatów; większość języków
100 wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
102 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
104 - możliwość używania z linii poleceń oraz jako biblioteki
105 - ...a także - podświetla nawet Brainf*cka!
108 %setup -q -n Pygments-%{version}
113 %{__python} setup.py build -b build-2
117 %{__python3} setup.py build -b build-3
121 rm -rf $RPM_BUILD_ROOT
124 %{__python} setup.py \
128 --root=$RPM_BUILD_ROOT
130 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
132 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
133 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
138 %{__python3} setup.py \
142 --root=$RPM_BUILD_ROOT
144 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
148 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
152 rm -rf $RPM_BUILD_ROOT
156 %defattr(644,root,root,755)
157 %doc AUTHORS CHANGES LICENSE TODO
158 %attr(755,root,root) %{_bindir}/pygmentize
159 %attr(755,root,root) %{_bindir}/pygmentize-2
160 %{py_sitescriptdir}/%{module}
161 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
165 %files -n python3-%{module}
166 %defattr(644,root,root,755)
167 %doc AUTHORS CHANGES LICENSE TODO
168 %attr(755,root,root) %{_bindir}/pygmentize-3
169 %{py3_sitescriptdir}/%{module}
170 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info