]>
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 |
4fb39907 | 11 | Release: 6 |
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/ |
2b1ed122 | 19 | BuildRequires: rpmbuild(macros) >= 1.710 |
0cfd7bce | 20 | %if %{with python2} |
2d23140c | 21 | BuildRequires: python |
21987620 | 22 | BuildRequires: python-devel >= 1:2.6 |
2d23140c | 23 | BuildRequires: python-modules |
343e28d9 | 24 | BuildRequires: python-setuptools |
0cfd7bce | 25 | %endif |
26 | %if %{with python3} | |
2d23140c | 27 | BuildRequires: python3 |
28 | BuildRequires: python3-2to3 | |
29 | BuildRequires: python3-devel | |
2d23140c | 30 | BuildRequires: python3-modules |
343e28d9 | 31 | BuildRequires: python3-setuptools |
0cfd7bce | 32 | %endif |
2d23140c | 33 | BuildRequires: rpm-pythonprov |
ef989146 | 34 | Requires: python-modules |
343e28d9 | 35 | Requires: python-setuptools |
ef989146 | 36 | Provides: python-Pygments = %{version}-%{release} |
e986ca66 | 37 | Obsoletes: python-Pygments |
5dc968a7 | 38 | BuildArch: noarch |
39 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
40 | ||
41 | %description | |
2d23140c | 42 | Pygments is a generic syntax highlighter for general use in all kinds |
43 | of software such as forum systems, wikis or other applications that | |
8f09c9ec | 44 | need to prettify source code. Highlights are: |
5dc968a7 | 45 | - a wide range of common languages and markup formats is supported |
2d23140c | 46 | - special attention is paid to details that increase highlighting |
47 | quality | |
48 | - support for new languages and formats are added easily; most | |
49 | languages use a simple regex-based lexing mechanism | |
50 | - a number of output formats is available, among them HTML, RTF, LaTeX | |
51 | and ANSI sequences | |
5dc968a7 | 52 | - it is usable as a command-line tool and as a library |
53 | - ... and it highlights even Brainf*ck! | |
54 | ||
8f09c9ec JB |
55 | %description -l pl.UTF-8 |
56 | Pygments to moduł Pythona do podświetlania składni ogólnego | |
57 | przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy | |
58 | forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu | |
59 | źródłowego. Zalety Pygments to: | |
60 | - obsługiwany szeroki zakres popularnych języków i formatów znaczników | |
61 | - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość | |
62 | podświetlania | |
63 | - łatwa obsługa nowych języków i formatów; większość języków | |
64 | wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia | |
65 | regularne | |
66 | - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i | |
67 | sekwencje ANSI | |
68 | - możliwość używania z linii poleceń oraz jako biblioteki | |
69 | - ...a także - podświetla nawet Brainf*cka! | |
70 | ||
b039b19f | 71 | %package -n python3-%{module} |
8f09c9ec JB |
72 | Summary: Generic syntax highlighter as Python 3.x module |
73 | Summary(pl.UTF-8): Moduł Pythona 3.x do ogólnego podświetlania składni | |
b039b19f | 74 | Group: Development/Languages/Python |
8f09c9ec | 75 | Requires: python3-modules |
343e28d9 | 76 | Requires: python3-setuptools |
b039b19f AF |
77 | |
78 | %description -n python3-%{module} | |
2d23140c | 79 | Pygments is a generic syntax highlighter for general use in all kinds |
80 | of software such as forum systems, wikis or other applications that | |
81 | need to prettify source code. Highlights are | |
b039b19f | 82 | - a wide range of common languages and markup formats is supported |
2d23140c | 83 | - special attention is paid to details that increase highlighting |
84 | quality | |
85 | - support for new languages and formats are added easily; most | |
86 | languages use a simple regex-based lexing mechanism | |
87 | - a number of output formats is available, among them HTML, RTF, LaTeX | |
88 | and ANSI sequences | |
b039b19f AF |
89 | - it is usable as a command-line tool and as a library |
90 | - ... and it highlights even Brainf*ck! | |
91 | ||
8f09c9ec JB |
92 | %description -n python3-%{module} -l pl.UTF-8 |
93 | Pygments to moduł Pythona do podświetlania składni ogólnego | |
94 | przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy | |
95 | forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu | |
96 | źródłowego. Zalety Pygments to: | |
97 | - obsługiwany szeroki zakres popularnych języków i formatów znaczników | |
98 | - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość | |
99 | podświetlania | |
100 | - łatwa obsługa nowych języków i formatów; większość języków | |
101 | wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia | |
102 | regularne | |
103 | - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i | |
104 | sekwencje ANSI | |
105 | - możliwość używania z linii poleceń oraz jako biblioteki | |
106 | - ...a także - podświetla nawet Brainf*cka! | |
107 | ||
5dc968a7 | 108 | %prep |
109 | %setup -q -n Pygments-%{version} | |
971b9c53 | 110 | %patch0 -p1 |
5dc968a7 | 111 | |
112 | %build | |
b039b19f | 113 | %if %{with python2} |
cd0bf674 | 114 | %py_build |
b039b19f AF |
115 | %endif |
116 | ||
117 | %if %{with python3} | |
cd0bf674 | 118 | %py3_build |
b039b19f | 119 | %endif |
5dc968a7 | 120 | |
121 | %install | |
122 | rm -rf $RPM_BUILD_ROOT | |
123 | ||
b039b19f | 124 | %if %{with python2} |
cd0bf674 | 125 | %py_install |
b039b19f AF |
126 | |
127 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2} | |
5dc968a7 | 128 | |
e986ca66 | 129 | %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} |
130 | %py_comp $RPM_BUILD_ROOT%{py_sitedir} | |
5dc968a7 | 131 | %py_postclean |
b039b19f AF |
132 | %endif |
133 | ||
134 | %if %{with python3} | |
cd0bf674 | 135 | %py3_install |
b039b19f AF |
136 | |
137 | mv $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3} | |
b039b19f AF |
138 | %endif |
139 | ||
8f09c9ec JB |
140 | %if %{with python2} |
141 | ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize | |
142 | %endif | |
5dc968a7 | 143 | |
144 | %clean | |
145 | rm -rf $RPM_BUILD_ROOT | |
146 | ||
b039b19f | 147 | %if %{with python2} |
5dc968a7 | 148 | %files |
149 | %defattr(644,root,root,755) | |
8f09c9ec | 150 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
151 | %attr(755,root,root) %{_bindir}/pygmentize |
152 | %attr(755,root,root) %{_bindir}/pygmentize-2 | |
5dc968a7 | 153 | %{py_sitescriptdir}/%{module} |
8f09c9ec | 154 | %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f AF |
155 | %endif |
156 | ||
157 | %if %{with python3} | |
158 | %files -n python3-%{module} | |
159 | %defattr(644,root,root,755) | |
8f09c9ec | 160 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
161 | %attr(755,root,root) %{_bindir}/pygmentize-3 |
162 | %{py3_sitescriptdir}/%{module} | |
8f09c9ec | 163 | %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f | 164 | %endif |