source: projects/specs/trunk/p/python-pygments/python-pygments-vl.spec @ 10602

Revision 10602, 8.0 KB checked in by tomop, 8 years ago (diff)

python-pygments-2.1.3-1

Line 
1%{!?__python3:%global __python3 /usr/bin/python3}
2%{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")}
3%{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")}
4%{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
5%{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")}
6%{!?__python2: %global __python2 /usr/bin/python2}
7%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
8%define py2_setup setup.py
9%define py2_shbang_opts -s
10%define py2_build() %{expand:\
11 CFLAGS="%{optflags}" %{__python2} %{py2_setup} %{?py2_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?1}\
12}
13%define py2_install() %{expand:\
14 CFLAGS="%{optflags}" %{__python2} %{py2_setup} %{?py2_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
15}
16%define py3_setup setup.py
17%define py3_shbang_opts -s
18%define py3_build() %{expand:\
19 CFLAGS="%{optflags}" %{__python3} %{py3_setup} %{?py3_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\
20}
21%define py3_install() %{expand:\
22 CFLAGS="%{optflags}" %{__python3} %{py3_setup} %{?py3_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\
23}
24%define py3dir %{_builddir}/python3-%{name}-%{version}-%{release}
25
26
27%global with_python3 1
28
29%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
30%global upstream_name Pygments
31
32Name:           python-pygments
33Version:        2.1.3
34Release:        1%{?_dist_release}
35Summary:        A syntax highlighting engine written in Python
36
37Group:          Development/Libraries
38License:        BSD
39URL:            http://pygments.org/
40Source0:        http://pypi.python.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
41BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
42
43BuildArch:      noarch
44BuildRequires:  python-devel >= 2.4, python-setuptools, python-nose
45%if 0%{?with_python3}
46BuildRequires:  python3-devel, python3-setuptools
47%endif # if with_python3
48Requires:       python-setuptools, python-imaging
49
50Vendor: Project Vine
51Distribution: Vine Linux
52
53%description
54Pygments is a generic syntax highlighter for general use in all kinds
55of software such as forum systems, wikis or other applications that
56need to prettify source code. Highlights are:
57
58  * a wide range of common languages and markup formats is supported
59  * special attention is paid to details that increase highlighting
60    quality
61  * support for new languages and formats are added easily; most
62    languages use a simple regex-based lexing mechanism
63  * a number of output formats is available, among them HTML, RTF,
64    LaTeX and ANSI sequences
65  * it is usable as a command-line tool and as a library
66  * ... and it highlights even Brainf*ck!
67
68%if 0%{?with_python3}
69%package -n python3-pygments
70Summary:        A syntax highlighting engine written in Python 3
71Group:          Development/Libraries
72Requires:       python3-setuptools
73
74%description -n python3-pygments
75Pygments is a generic syntax highlighter for general use in all kinds
76of software such as forum systems, wikis or other applications that
77need to prettify source code. Highlights are:
78
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,
85    LaTeX and ANSI sequences
86  * it is usable as a command-line tool and as a library
87  * ... and it highlights even Brainf*ck!
88%endif # if with_python3
89
90
91%prep
92%setup -q -n Pygments-%{version}
93
94%if 0%{?with_python3}
95%__rm -rf %{py3dir}
96%__cp -a . %{py3dir}
97find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
98%endif # with_python3
99
100
101%build
102%{__python} setup.py build
103%{__sed} -i 's/\r//' LICENSE
104
105%if 0%{?with_python3}
106pushd %{py3dir}
107%{__python3} setup.py build
108popd
109%endif # with_python3
110
111
112%install
113%__rm -rf $RPM_BUILD_ROOT
114
115# Run the Python 3 build first so that the Python 2 version of
116# /usr/bin/pygmentize "wins":
117%if 0%{?with_python3}
118pushd %{py3dir}
119%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
120popd
121%endif # with_python3
122
123%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
124pushd doc
125%__install -d %{buildroot}%{_mandir}/man1
126%__mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
127popd
128cp -r doc/docs doc/reST
129
130
131%clean
132%__rm -rf $RPM_BUILD_ROOT
133
134
135%check
136%__make test
137
138# nose is not Python3 ready yet
139%if 0%{?with_python3}
140pushd %{py3dir}
141make test
142popd
143%endif # with_python3
144
145
146%files
147%defattr(-,root,root,-)
148%license LICENSE
149%doc AUTHORS CHANGES doc/reST TODO
150# For noarch packages: sitelib
151%{python_sitelib}/*
152%{_bindir}/pygmentize
153%lang(en) %{_mandir}/man1/pygmentize.1.gz
154
155%if 0%{?with_python3}
156%files -n python3-pygments
157%defattr(-,root,root,-)
158%license LICENSE
159%doc AUTHORS CHANGES doc/reST TODO
160%{python3_sitelib}/*
161%endif # with_python3
162
163
164%changelog
165* Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.1.3-1
166- new upstream release.
167
168* Sun Jan 12 2014 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.3.1-3
169- rebuild with VineSeed environment
170
171* Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> - 1.3.1-2
172- rebuild with python-2.7.2
173
174* Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> - 1.3.1-1
175- initial build based on Fedora development
176
177* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-6
178- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
179
180* Thu May  6 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 1.3.1-5
181- Enforce that Pygments requires Python 2.4 or later via an explicit BR
182- Minor tweaks to spec file
183- Deliver html and reST doc files to specifically named directories
184- Align description with that of http://pygments.org/
185- Add %%check section for Python2 and add BR on python-nose
186
187* Fri Apr 23 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-4
188- switched with_python3 back to 1
189
190* Fri Apr 23 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-3
191- add python3 subpackage (BZ#537244), ignoring soft-dep on imaging for now
192
193* Tue Apr 13 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-2
194- added python-imaging as a dependency per BZ#581663.
195
196* Sat Mar  6 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-1
197- Updated for release.
198
199* Tue Sep 29 2009 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.1.1-1
200- Updated for release.
201
202* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-5
203- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
204
205* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0-4
206- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
207
208* Sun Dec 21 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.0-3
209- Updated for release.
210
211* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.0-2
212- Rebuild for Python 2.6
213
214* Thu Nov 27 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.0-1
215- Updated for upstream 1.0.
216
217* Sun Sep 14 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.11.1-1
218- Updated for upstream 0.11.
219
220* Mon Jul 21 2008 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.10-1
221- Updated for upstream 0.10.
222
223* Thu Nov 29 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.9-2
224- Added python-setuptools as a Requires per bz#403601.
225
226* Mon Nov 12 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.9-1
227- Updated for upstream 0.9.
228
229* Fri Aug 17 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.8.1-2
230- Removed the dos2unix build dependency.
231
232* Thu Jun 28 2007 Steve 'Ashcrow' Milner <me@stevemilner.org> - 0.8.1-1
233- Initial packaging for Fedora.
Note: See TracBrowser for help on using the repository browser.