]> git.pld-linux.org Git - packages/python-pygments.git/blob - python-pygments.spec
improvements to rpmspec lexer
[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:        2
12 License:        BSD
13 Group:          Development/Languages/Python
14 Source0:        http://pypi.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
15 # Source0-md5:  238587a1370d62405edabd0794b3ec4a
16 Patch0:         rpmspec.patch
17 URL:            http://pygments.org/
18 %if %{with python2}
19 BuildRequires:  python
20 BuildRequires:  python-devel >= 1:2.6
21 BuildRequires:  python-modules
22 BuildRequires:  python-setuptools
23 %endif
24 %if %{with python3}
25 BuildRequires:  python3
26 BuildRequires:  python3-2to3
27 BuildRequires:  python3-devel
28 BuildRequires:  python3-modules
29 BuildRequires:  python3-setuptools
30 %endif
31 BuildRequires:  rpm-pythonprov
32 Requires:       python-modules
33 Requires:       python-setuptools
34 Provides:       python-Pygments = %{version}-%{release}
35 Obsoletes:      python-Pygments
36 BuildArch:      noarch
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
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
42 need to prettify source code. Highlights are:
43 - a wide range of common languages and markup formats is supported
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
50 - it is usable as a command-line tool and as a library
51 - ... and it highlights even Brainf*ck!
52
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
69 %package -n python3-%{module}
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
72 Group:          Development/Languages/Python
73 Requires:       python3-modules
74 Requires:       python3-setuptools
75
76 %description -n python3-%{module}
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
80 - a wide range of common languages and markup formats is supported
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
87 - it is usable as a command-line tool and as a library
88 - ... and it highlights even Brainf*ck!
89
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
106 %prep
107 %setup -q -n Pygments-%{version}
108 %patch0 -p1
109
110 %build
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
118
119 %install
120 rm -rf $RPM_BUILD_ROOT
121
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}
130
131 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
132 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
133 %py_postclean
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}
144 %endif
145
146 %if %{with python2}
147 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
148 %endif
149
150 %clean
151 rm -rf $RPM_BUILD_ROOT
152
153 %if %{with python2}
154 %files
155 %defattr(644,root,root,755)
156 %doc AUTHORS CHANGES LICENSE TODO
157 %attr(755,root,root) %{_bindir}/pygmentize
158 %attr(755,root,root) %{_bindir}/pygmentize-2
159 %{py_sitescriptdir}/%{module}
160 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
161 %endif
162
163 %if %{with python3}
164 %files -n python3-%{module}
165 %defattr(644,root,root,755)
166 %doc AUTHORS CHANGES LICENSE TODO
167 %attr(755,root,root) %{_bindir}/pygmentize-3
168 %{py3_sitescriptdir}/%{module}
169 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
170 %endif
This page took 0.782503 seconds and 4 git commands to generate.