]> git.pld-linux.org Git - packages/python-pygments.git/blob - python-pygments.spec
just any setuptools can do
[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:        1.6
11 Release:        6
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:  a18feedf6ffd0b0cc8c8b0fbdb2027b1
16 URL:            http://pygments.org/
17 %if %{with python2}
18 BuildRequires:  python
19 BuildRequires:  python-devel
20 BuildRequires:  python-modules
21 BuildRequires:  python-setuptools
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3
25 BuildRequires:  python3-2to3
26 BuildRequires:  python3-devel
27 BuildRequires:  python3-modules
28 BuildRequires:  python3-setuptools
29 %endif
30 BuildRequires:  rpm-pythonprov
31 Requires:       python-modules
32 Requires:       python-setuptools
33 Provides:       python-Pygments = %{version}-%{release}
34 Obsoletes:      python-Pygments
35 BuildArch:      noarch
36 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
37
38 %description
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
41 need to prettify source code. Highlights are:
42 - a wide range of common languages and markup formats is supported
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
49 - it is usable as a command-line tool and as a library
50 - ... and it highlights even Brainf*ck!
51
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
68 %package -n python3-%{module}
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
71 Group:          Development/Languages/Python
72 Requires:       python3-modules
73 Requires:       python3-setuptools
74
75 %description -n python3-%{module}
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
79 - a wide range of common languages and markup formats is supported
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
86 - it is usable as a command-line tool and as a library
87 - ... and it highlights even Brainf*ck!
88
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
105 %prep
106 %setup -q -n Pygments-%{version}
107
108 %build
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
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119
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}
128
129 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
130 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
131 %py_postclean
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}
142 %endif
143
144 %if %{with python2}
145 ln -sf pygmentize-2 $RPM_BUILD_ROOT%{_bindir}/pygmentize
146 %endif
147
148 %clean
149 rm -rf $RPM_BUILD_ROOT
150
151 %if %{with python2}
152 %files
153 %defattr(644,root,root,755)
154 %doc AUTHORS CHANGES LICENSE TODO
155 %attr(755,root,root) %{_bindir}/pygmentize
156 %attr(755,root,root) %{_bindir}/pygmentize-2
157 %{py_sitescriptdir}/%{module}
158 %{py_sitescriptdir}/Pygments-%{version}-py*.egg-info
159 %endif
160
161 %if %{with python3}
162 %files -n python3-%{module}
163 %defattr(644,root,root,755)
164 %doc AUTHORS CHANGES LICENSE TODO
165 %attr(755,root,root) %{_bindir}/pygmentize-3
166 %{py3_sitescriptdir}/%{module}
167 %{py3_sitescriptdir}/Pygments-%{version}-py*.egg-info
168 %endif
This page took 0.08822 seconds and 4 git commands to generate.