added enhancements to the spec from Gareth Armstrong
This commit is contained in:
parent
d30218c903
commit
59ce0a5685
@ -1,31 +1,41 @@
|
|||||||
%global with_python3 1
|
%global with_python3 1
|
||||||
|
|
||||||
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
|
||||||
|
%global upstream_name Pygments
|
||||||
|
|
||||||
Name: python-pygments
|
Name: python-pygments
|
||||||
Version: 1.3.1
|
Version: 1.3.1
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: A syntax highlighting engine written in Python
|
Summary: A syntax highlighting engine written in Python
|
||||||
|
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: http://pygments.org/
|
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)
|
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: python-devel, python-setuptools
|
BuildRequires: python2-devel >= 2.4, python-setuptools, python-nose
|
||||||
Requires: python-setuptools, python-imaging
|
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
BuildRequires: python3-devel, python3-setuptools
|
BuildRequires: python3-devel, python3-setuptools
|
||||||
%endif # if with_python3
|
%endif # if with_python3
|
||||||
|
Requires: python-setuptools, python-imaging
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Pygments is a syntax highlighting engine written in Python. That means, it
|
Pygments is a generic syntax highlighter for general use in all kinds
|
||||||
will take source code (or other markup) in a supported language and output
|
of software such as forum systems, wikis or other applications that
|
||||||
a processed version (in different formats) containing syntax highlighting
|
need to prettify source code. Highlights are:
|
||||||
markup.
|
|
||||||
|
* 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}
|
%if 0%{?with_python3}
|
||||||
%package -n python3-pygments
|
%package -n python3-pygments
|
||||||
@ -34,10 +44,19 @@ Group: Development/Libraries
|
|||||||
Requires: python3-setuptools
|
Requires: python3-setuptools
|
||||||
|
|
||||||
%description -n python3-pygments
|
%description -n python3-pygments
|
||||||
Pygments is a syntax highlighting engine written in Python. That means, it
|
Pygments is a generic syntax highlighter for general use in all kinds
|
||||||
will take source code (or other markup) in a supported language and output
|
of software such as forum systems, wikis or other applications that
|
||||||
a processed version (in different formats) containing syntax highlighting
|
need to prettify source code. Highlights are:
|
||||||
markup.
|
|
||||||
|
* 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
|
%endif # if with_python3
|
||||||
|
|
||||||
|
|
||||||
@ -50,6 +69,7 @@ cp -a . %{py3dir}
|
|||||||
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%{__python} setup.py build
|
%{__python} setup.py build
|
||||||
%{__sed} -i 's/\r//' LICENSE
|
%{__sed} -i 's/\r//' LICENSE
|
||||||
@ -60,6 +80,7 @@ pushd %{py3dir}
|
|||||||
popd
|
popd
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
@ -71,18 +92,33 @@ pushd %{py3dir}
|
|||||||
popd
|
popd
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
|
|
||||||
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
|
%{__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
|
||||||
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
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
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc AUTHORS CHANGES docs/ LICENSE TODO
|
%doc AUTHORS CHANGES docs/html docs/reST LICENSE TODO
|
||||||
# For noarch packages: sitelib
|
# For noarch packages: sitelib
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/*
|
||||||
%{_bindir}/pygmentize
|
%{_bindir}/pygmentize
|
||||||
@ -91,11 +127,19 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%if 0%{?with_python3}
|
%if 0%{?with_python3}
|
||||||
%files -n python3-pygments
|
%files -n python3-pygments
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc AUTHORS CHANGES docs/ LICENSE TODO
|
%doc AUTHORS CHANGES docs/html docs/reST LICENSE TODO
|
||||||
%{python3_sitelib}/*
|
%{python3_sitelib}/*
|
||||||
%endif # with_python3
|
%endif # with_python3
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* 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
|
* Fri Apr 23 2010 Steve 'Ashcrow' Milner <me@stevemilner.org> - 1.3.1-4
|
||||||
- switched with_python3 back to 1
|
- switched with_python3 back to 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user