]> git.pld-linux.org Git - packages/python-pygments.git/blob - python-pygments.spec
78243927170c5ef8e890c4e599db5ad7dd6aa81d
[packages/python-pygments.git] / python-pygments.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  doc     # Sphinx documentation
6 %bcond_without  tests   # unit tests
7
8 %define module  pygments
9 Summary:        A generic syntax highlighter as Python 2.x module
10 Summary(pl.UTF-8):      Moduł Pythona 2.x do ogólnego podświetlania składni
11 Name:           python-%{module}
12 Version:        2.2.0
13 Release:        3
14 License:        BSD
15 Group:          Development/Languages/Python
16 #Source0Download: https://pypi.org/simple/Pygments/
17 Source0:        https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
18 # Source0-md5:  13037baca42f16917cbd5ad2fab50844
19 Patch0:         rpmspec.patch
20 Patch1:         %{name}-py3.7.patch
21 URL:            http://pygments.org/
22 BuildRequires:  rpmbuild(macros) >= 1.714
23 %if %{with python2}
24 BuildRequires:  python >= 1:2.6
25 BuildRequires:  python-devel >= 1:2.6
26 BuildRequires:  python-modules >= 1:2.6
27 BuildRequires:  python-setuptools
28 %endif
29 %if %{with python3}
30 BuildRequires:  python3 >= 1:3.2
31 BuildRequires:  python3-2to3 >= 1:3.2
32 BuildRequires:  python3-devel >= 1:3.2
33 BuildRequires:  python3-modules >= 1:3.2
34 BuildRequires:  python3-setuptools
35 %endif
36 BuildRequires:  rpm-pythonprov
37 %{?with_doc:BuildRequires:      sphinx-pdg}
38 Requires:       python-modules >= 1:2.6
39 Requires:       python-setuptools
40 Provides:       python-Pygments = %{version}-%{release}
41 Obsoletes:      python-Pygments
42 BuildArch:      noarch
43 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
44
45 %description
46 Pygments is a generic syntax highlighter for general use in all kinds
47 of software such as forum systems, wikis or other applications that
48 need to prettify source code. Highlights are:
49 - a wide range of common languages and markup formats is supported
50 - special attention is paid to details that increase highlighting
51   quality
52 - support for new languages and formats are added easily; most
53   languages use a simple regex-based lexing mechanism
54 - a number of output formats is available, among them HTML, RTF, LaTeX
55   and ANSI sequences
56 - it is usable as a command-line tool and as a library
57 - ... and it highlights even Brainf*ck!
58
59 %description -l pl.UTF-8
60 Pygments to moduł Pythona do podświetlania składni ogólnego
61 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
62 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
63 źródłowego. Zalety Pygments to:
64 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
65 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
66   podświetlania
67 - łatwa obsługa nowych języków i formatów; większość języków
68   wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
69   regularne
70 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
71   sekwencje ANSI
72 - możliwość używania z linii poleceń oraz jako biblioteki
73 - ...a także - podświetla nawet Brainf*cka!
74
75 %package -n python3-%{module}
76 Summary:        Generic syntax highlighter as Python 3.x module
77 Summary(pl.UTF-8):      Moduł Pythona 3.x do ogólnego podświetlania składni
78 Group:          Development/Languages/Python
79 Requires:       python3-modules >= 1:3.2
80 Requires:       python3-setuptools
81
82 %description -n python3-%{module}
83 Pygments is a generic syntax highlighter for general use in all kinds
84 of software such as forum systems, wikis or other applications that
85 need to prettify source code. Highlights are
86 - a wide range of common languages and markup formats is supported
87 - special attention is paid to details that increase highlighting
88   quality
89 - support for new languages and formats are added easily; most
90   languages use a simple regex-based lexing mechanism
91 - a number of output formats is available, among them HTML, RTF, LaTeX
92   and ANSI sequences
93 - it is usable as a command-line tool and as a library
94 - ... and it highlights even Brainf*ck!
95
96 %description -n python3-%{module} -l pl.UTF-8
97 Pygments to moduł Pythona do podświetlania składni ogólnego
98 przeznaczenia we wszelkiego rodzaju programach, takich jaka systemy
99 forów, wiki i inne plikacje wymagające ładnego wyświetlania kodu
100 źródłowego. Zalety Pygments to:
101 - obsługiwany szeroki zakres popularnych języków i formatów znaczników
102 - zwrócenie szczególnej uwagi na szczegóły zwiększające jakość
103   podświetlania
104 - łatwa obsługa nowych języków i formatów; większość języków
105   wykorzystuje prosty mechanizm analizy leksykalnej oparty o wyrażenia
106   regularne
107 - dostępność wielu formatów wyjściowych, m.in. HTML, RTF, LaTeX i
108   sekwencje ANSI
109 - możliwość używania z linii poleceń oraz jako biblioteki
110 - ...a także - podświetla nawet Brainf*cka!
111
112 %package apidocs
113 Summary:        API documentation for Python Pygments module
114 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona Pygments
115 Group:          Documentation
116
117 %description apidocs
118 API documentation for Python Pygments module.
119
120 %description apidocs -l pl.UTF-8
121 Dokumentacja API modułu Pythona Pygments.
122
123 %prep
124 %setup -q -n Pygments-%{version}
125 %patch0 -p1
126 %patch1 -p1
127
128 %build
129 %if %{with python2}
130 %py_build
131
132 %if %{with tests}
133 %{__python} tests/run.py
134 %endif
135 %endif
136
137 %if %{with python3}
138 %py3_build
139
140 %if %{with tests}
141 %{__python3} tests/run.py
142 %endif
143 %endif
144
145 %if %{with doc}
146 PYTHONPATH=$(pwd) \
147 %{__make} -C doc html
148 %endif
149
150 %install
151 rm -rf $RPM_BUILD_ROOT
152
153 %if %{with python2}
154 %py_install
155
156 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-2}
157
158 %py_postclean
159 %endif
160
161 %if %{with python3}
162 %py3_install
163
164 %{__mv} $RPM_BUILD_ROOT%{_bindir}/pygmentize{,-3}
165 %endif
166
167 %if %{with python2}
168 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
169 %endif
170
171 %clean
172 rm -rf $RPM_BUILD_ROOT
173
174 %if %{with python2}
175 %files
176 %defattr(644,root,root,755)
177 %doc AUTHORS CHANGES LICENSE README.rst TODO
178 %attr(755,root,root) %{_bindir}/pygmentize
179 %attr(755,root,root) %{_bindir}/pygmentize-2
180 %{py_sitescriptdir}/%{module}
181 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
182 %endif
183
184 %if %{with python3}
185 %files -n python3-%{module}
186 %defattr(644,root,root,755)
187 %doc AUTHORS CHANGES LICENSE README.rst TODO
188 %attr(755,root,root) %{_bindir}/pygmentize-3
189 %{py3_sitescriptdir}/%{module}
190 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
191 %endif
192
193 %if %{with doc}
194 %files apidocs
195 %defattr(644,root,root,755)
196 %doc doc/_build/html/{_static,docs,*.html,*.js}
197 %endif
This page took 0.081693 seconds and 2 git commands to generate.