3 %define module pygments
5 Summary: A generic syntax highlighter
10 Group: Development/Languages/Python
11 Source0: http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
12 # Source0-md5: d77ac8c93a7fb27545f2522abe9cc462
13 URL: http://pygments.org/
16 BuildRequires: python-devel
17 BuildRequires: python-modules
20 BuildRequires: python3
21 BuildRequires: python3-2to3
22 BuildRequires: python3-devel
23 BuildRequires: python3-distribute
24 BuildRequires: python3-modules
26 BuildRequires: rpm-pythonprov
27 %pyrequires_eq python-modules
28 Obsoletes: python-Pygments
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 Pygments is a generic syntax highlighter for general use in all kinds
34 of software such as forum systems, wikis or other applications that
35 need to prettify source code. Highlights are
36 - a wide range of common languages and markup formats is supported
37 - special attention is paid to details that increase highlighting
39 - support for new languages and formats are added easily; most
40 languages use a simple regex-based lexing mechanism
41 - a number of output formats is available, among them HTML, RTF, LaTeX
43 - it is usable as a command-line tool and as a library
44 - ... and it highlights even Brainf*ck!
46 %package -n python3-%{module}
47 Summary: Generic syntax highlighter
48 Group: Development/Languages/Python
50 %description -n python3-%{module}
51 Pygments is a generic syntax highlighter for general use in all kinds
52 of software such as forum systems, wikis or other applications that
53 need to prettify source code. Highlights are
54 - a wide range of common languages and markup formats is supported
55 - special attention is paid to details that increase highlighting
57 - support for new languages and formats are added easily; most
58 languages use a simple regex-based lexing mechanism
59 - a number of output formats is available, among them HTML, RTF, LaTeX
61 - it is usable as a command-line tool and as a library
62 - ... and it highlights even Brainf*ck!
65 %setup -q -n Pygments-%{version}
69 %{__python} setup.py build -b build-2
73 %{__python3} setup.py build -b build-3
77 rm -rf $RPM_BUILD_ROOT
80 %{__python} setup.py \
84 --root=$RPM_BUILD_ROOT
86 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
88 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
89 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
95 %{__python3} setup.py \
99 --root=$RPM_BUILD_ROOT
101 mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
106 ln -s pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
109 rm -rf $RPM_BUILD_ROOT
113 %defattr(644,root,root,755)
114 %doc PKG-INFO TODO AUTHORS
115 %attr(755,root,root) %{_bindir}/pygmentize
116 %attr(755,root,root) %{_bindir}/pygmentize-2
117 %{py_sitescriptdir}/%{module}
118 %if "%{py_ver}" > "2.4"
119 %{py_sitescriptdir}/*.egg-info
124 %files -n python3-%{module}
125 %defattr(644,root,root,755)
126 %doc PKG-INFO TODO AUTHORS
127 %attr(755,root,root) %{_bindir}/pygmentize-3
128 %{py3_sitescriptdir}/%{module}
129 %{py3_sitescriptdir}/*.egg-info