Merge branch 'master' into el5
This commit is contained in:
commit
e5b5371bcf
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
Pygments-1.3.1.tar.gz
|
||||
/Pygments-1.4.tar.gz
|
||||
|
@ -1,58 +1,232 @@
|
||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||
%if 0%{?fedora} > 12 || 0%{?rhel} > 6
|
||||
%global with_python3 1
|
||||
%else
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
||||
%endif
|
||||
|
||||
%if 0%{?el5}
|
||||
%global with_python26 1
|
||||
%endif
|
||||
|
||||
%if 0%{?with_python26}
|
||||
%global __python26 %{_bindir}/python2.6
|
||||
%global py26dir %{_builddir}/python26-%{name}-%{version}-%{release}
|
||||
%global python26_sitelib %{_libdir}/python2.6/site-packages
|
||||
#Disable byte compileing and do ourselves later.
|
||||
%endif
|
||||
|
||||
|
||||
%global upstream_name Pygments
|
||||
|
||||
Name: python-pygments
|
||||
Version: 1.3.1
|
||||
Release: 2%{?dist}
|
||||
Version: 1.4
|
||||
Release: 1%{?dist}
|
||||
Summary: A syntax highlighting engine written in Python
|
||||
|
||||
Group: Development/Libraries
|
||||
License: BSD
|
||||
URL: http://pygments.org/
|
||||
Source0: http://cheeseshop.python.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz
|
||||
Source0: http://pypi.python.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python-devel, python-setuptools
|
||||
BuildRequires: python2-devel >= 2.4, python-setuptools, python-nose
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel, python3-setuptools
|
||||
%endif # if with_python3
|
||||
Requires: python-setuptools, python-imaging
|
||||
%if 0%{?with_python26}
|
||||
BuildRequires: python26-devel, python26-distribute
|
||||
Requires: python26-distribute, python26-imaging
|
||||
Requires: python(abi) = 2.6
|
||||
%endif
|
||||
|
||||
|
||||
%description
|
||||
Pygments is a syntax highlighting engine written in Python. That means, it
|
||||
will take source code (or other markup) in a supported language and output
|
||||
a processed version (in different formats) containing syntax highlighting
|
||||
markup.
|
||||
Pygments is a generic syntax highlighter for general use in all kinds
|
||||
of software such as forum systems, wikis or other applications that
|
||||
need to prettify source code. Highlights are:
|
||||
|
||||
* a wide range of common languages and markup formats is supported
|
||||
* special attention is paid to details that increase highlighting
|
||||
quality
|
||||
* support for new languages and formats are added easily; most
|
||||
languages use a simple regex-based lexing mechanism
|
||||
* a number of output formats is available, among them HTML, RTF,
|
||||
LaTeX and ANSI sequences
|
||||
* it is usable as a command-line tool and as a library
|
||||
* ... and it highlights even Brainf*ck!
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-pygments
|
||||
Summary: A syntax highlighting engine written in Python 3
|
||||
Group: Development/Libraries
|
||||
Requires: python3-setuptools
|
||||
|
||||
%description -n python3-pygments
|
||||
Pygments is a generic syntax highlighter for general use in all kinds
|
||||
of software such as forum systems, wikis or other applications that
|
||||
need to prettify source code. Highlights are:
|
||||
|
||||
* a wide range of common languages and markup formats is supported
|
||||
* special attention is paid to details that increase highlighting
|
||||
quality
|
||||
* support for new languages and formats are added easily; most
|
||||
languages use a simple regex-based lexing mechanism
|
||||
* a number of output formats is available, among them HTML, RTF,
|
||||
LaTeX and ANSI sequences
|
||||
* it is usable as a command-line tool and as a library
|
||||
* ... and it highlights even Brainf*ck!
|
||||
%endif # if with_python3
|
||||
|
||||
%if 0%{?with_python26}
|
||||
%package -n python26-pygments
|
||||
Summary: A syntax highlighting engine written in Python 2.6
|
||||
Group: Development/Libraries
|
||||
Requires: python26-distribute
|
||||
|
||||
%description -n python26-pygments
|
||||
Pygments is a generic syntax highlighter for general use in all kinds
|
||||
of software such as forum systems, wikis or other applications that
|
||||
need to prettify source code. Highlights are:
|
||||
%endif #end of python2.6
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -n Pygments-%{version}
|
||||
|
||||
%if 0%{?with_python3}
|
||||
rm -rf %{py3dir}
|
||||
cp -a . %{py3dir}
|
||||
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
||||
%endif # with_python3
|
||||
|
||||
%if 0%{?with_python26}
|
||||
rm -rf %{py26dir}
|
||||
cp -a . %{py26dir}
|
||||
find %{py26dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python26}|'
|
||||
%endif # with_python26
|
||||
|
||||
|
||||
%build
|
||||
%{__python} setup.py build
|
||||
%{__sed} -i 's/\r//' LICENSE
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py build
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%if 0%{?with_python26}
|
||||
pushd %{py26dir}
|
||||
%{__python26} setup.py build
|
||||
popd
|
||||
%endif # with_python26
|
||||
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
|
||||
|
||||
# Run the Python 3 build first so that the Python 2 version of
|
||||
# /usr/bin/pygmentize "wins":
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
# Run the Python 2.6 build first so that the Python 2 version of
|
||||
# /usr/bin/pygmentize "wins":
|
||||
%if 0%{?with_python26}
|
||||
pushd %{py26dir}
|
||||
%{__python26} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
popd
|
||||
%endif # with_python26
|
||||
|
||||
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
||||
mv docs/pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
|
||||
pushd docs
|
||||
install -d %{buildroot}%{_mandir}/man1
|
||||
mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
|
||||
mv build html
|
||||
mv src reST
|
||||
popd
|
||||
|
||||
%if 0%{?with_python26}
|
||||
%{__python} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"10"', "%{python_sitelib}", 1)' > /dev/null
|
||||
%{__python} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"10"', "%{python_sitelib}", 1)' > /dev/null
|
||||
%{__python26} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"10"', "%{python26_sitelib}", 1)' > /dev/null
|
||||
%{__python26} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"10"', "%{python26_sitelib}", 1)' > /dev/null
|
||||
%endif
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%check
|
||||
make test
|
||||
|
||||
# nose is not Python3 ready yet
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
#make test
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS CHANGES docs/ LICENSE TODO
|
||||
%doc AUTHORS CHANGES docs/html docs/reST LICENSE TODO
|
||||
# For noarch packages: sitelib
|
||||
%{python_sitelib}/*
|
||||
%{_bindir}/pygmentize
|
||||
%lang(en) %{_mandir}/man1/pygmentize.1.gz
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-pygments
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS CHANGES docs/html docs/reST LICENSE TODO
|
||||
%{python3_sitelib}/*
|
||||
%endif # with_python3
|
||||
|
||||
%if 0%{?with_python26}
|
||||
%files -n python26-pygments
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS CHANGES docs/ LICENSE TODO
|
||||
%{python26_sitelib}/*
|
||||
%endif # with_python26
|
||||
|
||||
|
||||
%changelog
|
||||
* Fri Jun 24 2011 Steve Milner <smilner@fedoraproject.org> - 1.4-1
|
||||
- update for upstream release
|
||||
- Add python2.6 support done by Steve Traylen <steve.traylen@cern.ch>. BZ#662755.
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.1-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Wed Aug 25 2010 Thomas Spura <tomspur@fedoraproject.org> - 1.3.1-7
|
||||
- update to most recent python guidelines
|
||||
- rebuild with python3.2
|
||||
http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
|
||||
|
||||
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
|
||||
|
||||
* Thu May 6 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 1.3.1-5
|
||||
- Enforce that Pygments requires Python 2.4 or later via an explicit BR
|
||||
- Minor tweaks to spec file
|
||||
- Deliver html and reST doc files to specifically named directories
|
||||
- Align description with that of http://pygments.org/
|
||||
- Add %%check section for Python2 and add BR on python-nose
|
||||
|
||||
* Fri Apr 23 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-4
|
||||
- switched with_python3 back to 1
|
||||
|
||||
* Fri Apr 23 2010 David Malcolm <dmalcolm@redhat.com> - 1.3.1-3
|
||||
- add python3 subpackage (BZ#537244), ignoring soft-dep on imaging for now
|
||||
|
||||
* Sat Apr 13 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-2
|
||||
- added python-imaging as a dependency per BZ#581663.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user