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