]>
Commit | Line | Data |
---|---|---|
b039b19f | 1 | # |
8f09c9ec JB |
2 | # Conditional build: |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
6d0d5676 | 5 | |
8f09c9ec JB |
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 | |
5dc968a7 | 9 | Name: python-%{module} |
50783b25 | 10 | Version: 1.6 |
c3b79ca2 | 11 | Release: 2 |
5dc968a7 | 12 | License: BSD |
13 | Group: Development/Languages/Python | |
14 | Source0: http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz | |
50783b25 | 15 | # Source0-md5: a18feedf6ffd0b0cc8c8b0fbdb2027b1 |
1fcda2a5 | 16 | URL: http://pygments.org/ |
0cfd7bce | 17 | %if %{with python2} |
2d23140c | 18 | BuildRequires: python |
5dc968a7 | 19 | BuildRequires: python-devel |
2d23140c | 20 | BuildRequires: python-modules |
0cfd7bce | 21 | %endif |
22 | %if %{with python3} | |
2d23140c | 23 | BuildRequires: python3 |
24 | BuildRequires: python3-2to3 | |
25 | BuildRequires: python3-devel | |
26 | BuildRequires: python3-distribute | |
27 | BuildRequires: python3-modules | |
0cfd7bce | 28 | %endif |
2d23140c | 29 | BuildRequires: rpm-pythonprov |
5dc968a7 | 30 | %pyrequires_eq python-modules |
4d013986 | 31 | Provides: python-Pygments |
e986ca66 | 32 | Obsoletes: python-Pygments |
5dc968a7 | 33 | BuildArch: noarch |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %description | |
2d23140c | 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 | |
8f09c9ec | 39 | need to prettify source code. Highlights are: |
5dc968a7 | 40 | - a wide range of common languages and markup formats is supported |
2d23140c | 41 | - special attention is paid to details that increase highlighting |
42 | quality | |
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 | |
46 | and ANSI sequences | |
5dc968a7 | 47 | - it is usable as a command-line tool and as a library |
48 | - ... and it highlights even Brainf*ck! | |
49 | ||
8f09c9ec JB |
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ść | |
57 | podświetlania | |
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 | |
60 | regularne | |
61 | - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i | |
62 | sekwencje ANSI | |
63 | - możliwość używania z linii poleceń oraz jako biblioteki | |
64 | - ...a także - podświetla nawet Brainf*cka! | |
65 | ||
b039b19f | 66 | %package -n python3-%{module} |
8f09c9ec JB |
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 | |
b039b19f | 69 | Group: Development/Languages/Python |
8f09c9ec | 70 | Requires: python3-modules |
b039b19f AF |
71 | |
72 | %description -n python3-%{module} | |
2d23140c | 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 | |
b039b19f | 76 | - a wide range of common languages and markup formats is supported |
2d23140c | 77 | - special attention is paid to details that increase highlighting |
78 | quality | |
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 | |
82 | and ANSI sequences | |
b039b19f AF |
83 | - it is usable as a command-line tool and as a library |
84 | - ... and it highlights even Brainf*ck! | |
85 | ||
8f09c9ec JB |
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ść | |
93 | podświetlania | |
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 | |
96 | regularne | |
97 | - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i | |
98 | sekwencje ANSI | |
99 | - możliwość używania z linii poleceń oraz jako biblioteki | |
100 | - ...a także - podświetla nawet Brainf*cka! | |
101 | ||
5dc968a7 | 102 | %prep |
103 | %setup -q -n Pygments-%{version} | |
104 | ||
105 | %build | |
b039b19f AF |
106 | %if %{with python2} |
107 | %{__python} setup.py build -b build-2 | |
108 | %endif | |
109 | ||
110 | %if %{with python3} | |
111 | %{__python3} setup.py build -b build-3 | |
112 | %endif | |
5dc968a7 | 113 | |
114 | %install | |
115 | rm -rf $RPM_BUILD_ROOT | |
116 | ||
b039b19f AF |
117 | %if %{with python2} |
118 | %{__python} setup.py \ | |
119 | build -b build-2 \ | |
120 | install \ | |
121 | --optimize=2 \ | |
122 | --root=$RPM_BUILD_ROOT | |
123 | ||
124 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2} | |
5dc968a7 | 125 | |
e986ca66 | 126 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
127 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
5dc968a7 | 128 | %py_postclean |
b039b19f AF |
129 | %endif |
130 | ||
131 | %if %{with python3} | |
132 | %{__python3} setup.py \ | |
133 | build -b build-3 \ | |
134 | install \ | |
135 | --optimize=2 \ | |
136 | --root=$RPM_BUILD_ROOT | |
137 | ||
138 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3} | |
b039b19f AF |
139 | %endif |
140 | ||
8f09c9ec JB |
141 | %if %{with python2} |
142 | ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize | |
143 | %endif | |
5dc968a7 | 144 | |
145 | %clean | |
146 | rm -rf $RPM_BUILD_ROOT | |
147 | ||
b039b19f | 148 | %if %{with python2} |
5dc968a7 | 149 | %files |
150 | %defattr(644,root,root,755) | |
8f09c9ec | 151 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
152 | %attr(755,root,root) %{_bindir}/pygmentize |
153 | %attr(755,root,root) %{_bindir}/pygmentize-2 | |
5dc968a7 | 154 | %{py_sitescriptdir}/%{module} |
e986ca66 | 155 | %if "%{py_ver}" > "2.4" |
8f09c9ec | 156 | %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f | 157 | %endif |
e986ca66 | 158 | %endif |
b039b19f AF |
159 | |
160 | %if %{with python3} | |
161 | %files -n python3-%{module} | |
162 | %defattr(644,root,root,755) | |
8f09c9ec | 163 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
164 | %attr(755,root,root) %{_bindir}/pygmentize-3 |
165 | %{py3_sitescriptdir}/%{module} | |
8f09c9ec | 166 | %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f | 167 | %endif |