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