]>
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} |
4ebe1c4c | 10 | Version: 2.0.2 |
a62d2070 | 11 | Release: 3 |
5dc968a7 | 12 | License: BSD |
13 | Group: Development/Languages/Python | |
61a1fd7f | 14 | #Source0Download: https://pypi.python.org/pypi/Pygments |
5dc968a7 | 15 | Source0: http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz |
4ebe1c4c | 16 | # Source0-md5: 238587a1370d62405edabd0794b3ec4a |
971b9c53 | 17 | Patch0: rpmspec.patch |
1fcda2a5 | 18 | URL: http://pygments.org/ |
0cfd7bce | 19 | %if %{with python2} |
2d23140c | 20 | BuildRequires: python |
21987620 | 21 | BuildRequires: python-devel >= 1:2.6 |
2d23140c | 22 | BuildRequires: python-modules |
343e28d9 | 23 | BuildRequires: python-setuptools |
0cfd7bce | 24 | %endif |
25 | %if %{with python3} | |
2d23140c | 26 | BuildRequires: python3 |
27 | BuildRequires: python3-2to3 | |
28 | BuildRequires: python3-devel | |
2d23140c | 29 | BuildRequires: python3-modules |
343e28d9 | 30 | BuildRequires: python3-setuptools |
0cfd7bce | 31 | %endif |
2d23140c | 32 | BuildRequires: rpm-pythonprov |
ef989146 | 33 | Requires: python-modules |
343e28d9 | 34 | Requires: python-setuptools |
ef989146 | 35 | Provides: python-Pygments = %{version}-%{release} |
e986ca66 | 36 | Obsoletes: python-Pygments |
5dc968a7 | 37 | BuildArch: noarch |
38 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
39 | ||
40 | %description | |
2d23140c | 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 | |
8f09c9ec | 43 | need to prettify source code. Highlights are: |
5dc968a7 | 44 | - a wide range of common languages and markup formats is supported |
2d23140c | 45 | - special attention is paid to details that increase highlighting |
46 | quality | |
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 | |
50 | and ANSI sequences | |
5dc968a7 | 51 | - it is usable as a command-line tool and as a library |
52 | - ... and it highlights even Brainf*ck! | |
53 | ||
8f09c9ec JB |
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ść | |
61 | podświetlania | |
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 | |
64 | regularne | |
65 | - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i | |
66 | sekwencje ANSI | |
67 | - możliwość używania z linii poleceń oraz jako biblioteki | |
68 | - ...a także - podświetla nawet Brainf*cka! | |
69 | ||
b039b19f | 70 | %package -n python3-%{module} |
8f09c9ec JB |
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 | |
b039b19f | 73 | Group: Development/Languages/Python |
8f09c9ec | 74 | Requires: python3-modules |
343e28d9 | 75 | Requires: python3-setuptools |
b039b19f AF |
76 | |
77 | %description -n python3-%{module} | |
2d23140c | 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 | |
b039b19f | 81 | - a wide range of common languages and markup formats is supported |
2d23140c | 82 | - special attention is paid to details that increase highlighting |
83 | quality | |
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 | |
87 | and ANSI sequences | |
b039b19f AF |
88 | - it is usable as a command-line tool and as a library |
89 | - ... and it highlights even Brainf*ck! | |
90 | ||
8f09c9ec JB |
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ść | |
98 | podświetlania | |
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 | |
101 | regularne | |
102 | - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i | |
103 | sekwencje ANSI | |
104 | - możliwość używania z linii poleceń oraz jako biblioteki | |
105 | - ...a także - podświetla nawet Brainf*cka! | |
106 | ||
5dc968a7 | 107 | %prep |
108 | %setup -q -n Pygments-%{version} | |
971b9c53 | 109 | %patch0 -p1 |
5dc968a7 | 110 | |
111 | %build | |
b039b19f AF |
112 | %if %{with python2} |
113 | %{__python} setup.py build -b build-2 | |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
117 | %{__python3} setup.py build -b build-3 | |
118 | %endif | |
5dc968a7 | 119 | |
120 | %install | |
121 | rm -rf $RPM_BUILD_ROOT | |
122 | ||
b039b19f AF |
123 | %if %{with python2} |
124 | %{__python} setup.py \ | |
125 | build -b build-2 \ | |
126 | install \ | |
127 | --optimize=2 \ | |
128 | --root=$RPM_BUILD_ROOT | |
129 | ||
130 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2} | |
5dc968a7 | 131 | |
e986ca66 | 132 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
133 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
5dc968a7 | 134 | %py_postclean |
b039b19f AF |
135 | %endif |
136 | ||
137 | %if %{with python3} | |
138 | %{__python3} setup.py \ | |
139 | build -b build-3 \ | |
140 | install \ | |
141 | --optimize=2 \ | |
142 | --root=$RPM_BUILD_ROOT | |
143 | ||
144 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3} | |
b039b19f AF |
145 | %endif |
146 | ||
8f09c9ec JB |
147 | %if %{with python2} |
148 | ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize | |
149 | %endif | |
5dc968a7 | 150 | |
151 | %clean | |
152 | rm -rf $RPM_BUILD_ROOT | |
153 | ||
b039b19f | 154 | %if %{with python2} |
5dc968a7 | 155 | %files |
156 | %defattr(644,root,root,755) | |
8f09c9ec | 157 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
158 | %attr(755,root,root) %{_bindir}/pygmentize |
159 | %attr(755,root,root) %{_bindir}/pygmentize-2 | |
5dc968a7 | 160 | %{py_sitescriptdir}/%{module} |
8f09c9ec | 161 | %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f AF |
162 | %endif |
163 | ||
164 | %if %{with python3} | |
165 | %files -n python3-%{module} | |
166 | %defattr(644,root,root,755) | |
8f09c9ec | 167 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
168 | %attr(755,root,root) %{_bindir}/pygmentize-3 |
169 | %{py3_sitescriptdir}/%{module} | |
8f09c9ec | 170 | %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f | 171 | %endif |