Added python3 module

This commit is contained in:
Denis Silakov 2014-04-17 01:02:16 +04:00
parent 5ba174edcc
commit e06c47516c

View file

@ -2,15 +2,17 @@
%define module pygments
Summary: Syntax highlighting package written in Python
Name: python-%{module}
Version: 1.6
Release: 5
Release: 6
Group: Development/Python
License: BSD
Url: http://pygments.org/
Source0: http://pypi.python.org/packages/source/P/%{tarname}/%{tarname}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python-setuptools
BuildRequires: python3-distribute
BuildRequires: python-devel
Requires: python-pkg-resources
@ -28,24 +30,71 @@ prettify source code. Highlights are:
* it is usable as a command-line tool and as a library
* ... and it highlights even Brainf*ck!
%package -n python3-%{module}
Summary: Python documentation generator
Group: Development/Python
Requires: python3-pkg-resources
%description -n python3-%{module}
Pygments is a syntax highlighting package written in Python. It 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, increasing quality by a fair amount
* support for new languages and formats are added easily
* a number of output formats, presently HTML, LaTeX, RTF, SVG and ANSI
sequences
* it is usable as a command-line tool and as a library
* ... and it highlights even Brainf*ck!
%prep
%setup -qn %{tarname}-%{version}
%setup -qc
tar xzf %{SOURCE0}
mv %{tarname}-%{version} python2
cp -r python2 python3
%build
%{__python} setup.py build
pushd python2
python setup.py build
popd
pushd python3
python3 setup.py build
popd
%install
PYTHONDONTWRITEBYTECODE= %{__python} setup.py install --skip-build --root=%{buildroot}
pushd python3
PYTHONDONTWRITEBYTECODE= python3 setup.py install --skip-build --root=%{buildroot}
mv %{buildroot}%{_bindir}/pygmentize %{buildroot}%{_bindir}/py3gmentize
mv docs/build html
mkdir -p %{buildroot}%{_mandir}/man1
sed -i 's/\/usr\/share\/doc\/python-pygments\//\/usr\/share\/doc\/python3-pygments\/html\//' docs/pygmentize.1
install -m 644 docs/pygmentize.1 %{buildroot}%{_mandir}/man1/py3gmentize.1
popd
pushd python2
PYTHONDONTWRITEBYTECODE= python setup.py install --skip-build --root=%{buildroot}
mv docs/build html
mkdir -p %{buildroot}%{_mandir}/man1
sed -i 's/\/usr\/share\/doc\/python-pygments\//\/usr\/share\/doc\/python-pygments\/html\//' docs/pygmentize.1
install -m 644 docs/pygmentize.1 %{buildroot}%{_mandir}/man1
popd
%files
%doc AUTHORS CHANGES LICENSE TODO html/
%doc python2/AUTHORS python2/CHANGES python2/LICENSE python2/TODO python2/html/
%{_bindir}/pygmentize
%{py_sitedir}/pygments/*
%{py_sitedir}/Pygments-*
%{py_puresitedir}/pygments/*
%{py_puresitedir}/Pygments-*
%{_mandir}/man1/pygmentize.*
%files -n python3-%{module}
%doc python3/AUTHORS python3/CHANGES python3/LICENSE python3/TODO python3/html/
%{_bindir}/py3gmentize
%{py3_puresitedir}/pygments/*
%{py3_puresitedir}/Pygments-*
%{_mandir}/man1/py3gmentize.*