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