]>
Commit | Line | Data |
---|---|---|
b039b19f AF |
1 | %bcond_without python2 |
2 | %bcond_without python3 | |
3 | %define module pygments | |
4 | # | |
5dc968a7 | 5 | Summary: Generic syntax highlighter |
6 | Name: python-%{module} | |
b039b19f | 7 | Version: 1.3.1 |
5dc968a7 | 8 | Release: 1 |
9 | License: BSD | |
10 | Group: Development/Languages/Python | |
11 | Source0: http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz | |
b039b19f | 12 | # Source0-md5: 54be67c04834f13d7e255e1797d629a5 |
1fcda2a5 | 13 | URL: http://pygments.org/ |
2d23140c | 14 | BuildRequires: python |
5dc968a7 | 15 | BuildRequires: python-devel |
2d23140c | 16 | BuildRequires: python-modules |
17 | BuildRequires: python3 | |
18 | BuildRequires: python3-2to3 | |
19 | BuildRequires: python3-devel | |
20 | BuildRequires: python3-distribute | |
21 | BuildRequires: python3-modules | |
22 | BuildRequires: rpm-pythonprov | |
5dc968a7 | 23 | %pyrequires_eq python-modules |
24 | BuildArch: noarch | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
2d23140c | 28 | Pygments is a generic syntax highlighter for general use in all kinds |
29 | of software such as forum systems, wikis or other applications that | |
30 | need to prettify source code. Highlights are | |
5dc968a7 | 31 | - a wide range of common languages and markup formats is supported |
2d23140c | 32 | - special attention is paid to details that increase highlighting |
33 | quality | |
34 | - support for new languages and formats are added easily; most | |
35 | languages use a simple regex-based lexing mechanism | |
36 | - a number of output formats is available, among them HTML, RTF, LaTeX | |
37 | and ANSI sequences | |
5dc968a7 | 38 | - it is usable as a command-line tool and as a library |
39 | - ... and it highlights even Brainf*ck! | |
40 | ||
b039b19f AF |
41 | %package -n python3-%{module} |
42 | Summary: Generic syntax highlighter | |
43 | Group: Development/Languages/Python | |
44 | ||
45 | %description -n python3-%{module} | |
2d23140c | 46 | Pygments is a generic syntax highlighter for general use in all kinds |
47 | of software such as forum systems, wikis or other applications that | |
48 | need to prettify source code. Highlights are | |
b039b19f | 49 | - a wide range of common languages and markup formats is supported |
2d23140c | 50 | - special attention is paid to details that increase highlighting |
51 | quality | |
52 | - support for new languages and formats are added easily; most | |
53 | languages use a simple regex-based lexing mechanism | |
54 | - a number of output formats is available, among them HTML, RTF, LaTeX | |
55 | and ANSI sequences | |
b039b19f AF |
56 | - it is usable as a command-line tool and as a library |
57 | - ... and it highlights even Brainf*ck! | |
58 | ||
5dc968a7 | 59 | %prep |
60 | %setup -q -n Pygments-%{version} | |
61 | ||
62 | %build | |
b039b19f AF |
63 | %if %{with python2} |
64 | %{__python} setup.py build -b build-2 | |
65 | %endif | |
66 | ||
67 | %if %{with python3} | |
68 | %{__python3} setup.py build -b build-3 | |
69 | %endif | |
5dc968a7 | 70 | |
71 | %install | |
72 | rm -rf $RPM_BUILD_ROOT | |
73 | ||
b039b19f AF |
74 | %if %{with python2} |
75 | %{__python} setup.py \ | |
76 | build -b build-2 \ | |
77 | install \ | |
78 | --optimize=2 \ | |
79 | --root=$RPM_BUILD_ROOT | |
80 | ||
81 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2} | |
5dc968a7 | 82 | |
83 | %py_postclean | |
b039b19f AF |
84 | %endif |
85 | ||
86 | %if %{with python3} | |
87 | %{__python3} setup.py \ | |
88 | build -b build-3 \ | |
89 | install \ | |
90 | --optimize=2 \ | |
91 | --root=$RPM_BUILD_ROOT | |
92 | ||
93 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3} | |
94 | ||
95 | %py3_postclean | |
96 | %endif | |
97 | ||
98 | ln -s pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize | |
5dc968a7 | 99 | |
100 | %clean | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
b039b19f | 103 | %if %{with python2} |
5dc968a7 | 104 | %files |
105 | %defattr(644,root,root,755) | |
106 | %doc PKG-INFO TODO AUTHORS | |
b039b19f AF |
107 | %attr(755,root,root) %{_bindir}/pygmentize |
108 | %attr(755,root,root) %{_bindir}/pygmentize-2 | |
5dc968a7 | 109 | %{py_sitescriptdir}/%{module} |
110 | %{py_sitescriptdir}/*Pygments*.egg* | |
b039b19f AF |
111 | %endif |
112 | ||
113 | %if %{with python3} | |
114 | %files -n python3-%{module} | |
115 | %defattr(644,root,root,755) | |
116 | %doc PKG-INFO TODO AUTHORS | |
117 | %attr(755,root,root) %{_bindir}/pygmentize-3 | |
118 | %{py3_sitescriptdir}/%{module} | |
119 | %{py3_sitescriptdir}/*Pygments*.egg* | |
120 | %endif |