]>
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} |
ad49381b | 10 | Version: 2.2.0 |
de554ad7 | 11 | Release: 1 |
5dc968a7 | 12 | License: BSD |
13 | Group: Development/Languages/Python | |
de554ad7 | 14 | #Source0Download: https://pypi.python.org/simple/Pygments |
ad49381b JB |
15 | Source0: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz |
16 | # Source0-md5: 13037baca42f16917cbd5ad2fab50844 | |
971b9c53 | 17 | Patch0: rpmspec.patch |
1fcda2a5 | 18 | URL: http://pygments.org/ |
de554ad7 | 19 | BuildRequires: rpmbuild(macros) >= 1.714 |
0cfd7bce | 20 | %if %{with python2} |
de554ad7 | 21 | BuildRequires: python >= 1:2.6 |
21987620 | 22 | BuildRequires: python-devel >= 1:2.6 |
de554ad7 | 23 | BuildRequires: python-modules >= 1:2.6 |
343e28d9 | 24 | BuildRequires: python-setuptools |
0cfd7bce | 25 | %endif |
26 | %if %{with python3} | |
de554ad7 JB |
27 | BuildRequires: python3 >= 1:3.2 |
28 | BuildRequires: python3-2to3 >= 1:3.2 | |
29 | BuildRequires: python3-devel >= 1:3.2 | |
30 | BuildRequires: python3-modules >= 1:3.2 | |
343e28d9 | 31 | BuildRequires: python3-setuptools |
0cfd7bce | 32 | %endif |
2d23140c | 33 | BuildRequires: rpm-pythonprov |
de554ad7 | 34 | Requires: python-modules >= 1:2.6 |
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 |
de554ad7 | 75 | Requires: python3-modules >= 1:3.2 |
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 | 126 | |
de554ad7 | 127 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2} |
5dc968a7 | 128 | |
129 | %py_postclean | |
b039b19f AF |
130 | %endif |
131 | ||
132 | %if %{with python3} | |
cd0bf674 | 133 | %py3_install |
b039b19f | 134 | |
de554ad7 | 135 | %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3} |
b039b19f AF |
136 | %endif |
137 | ||
8f09c9ec JB |
138 | %if %{with python2} |
139 | ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize | |
140 | %endif | |
5dc968a7 | 141 | |
142 | %clean | |
143 | rm -rf $RPM_BUILD_ROOT | |
144 | ||
b039b19f | 145 | %if %{with python2} |
5dc968a7 | 146 | %files |
147 | %defattr(644,root,root,755) | |
8f09c9ec | 148 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
149 | %attr(755,root,root) %{_bindir}/pygmentize |
150 | %attr(755,root,root) %{_bindir}/pygmentize-2 | |
5dc968a7 | 151 | %{py_sitescriptdir}/%{module} |
8f09c9ec | 152 | %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f AF |
153 | %endif |
154 | ||
155 | %if %{with python3} | |
156 | %files -n python3-%{module} | |
157 | %defattr(644,root,root,755) | |
8f09c9ec | 158 | %doc AUTHORS CHANGES LICENSE TODO |
b039b19f AF |
159 | %attr(755,root,root) %{_bindir}/pygmentize-3 |
160 | %{py3_sitescriptdir}/%{module} | |
8f09c9ec | 161 | %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info |
b039b19f | 162 | %endif |