Fix python3 dep issue

This commit is contained in:
Steve Milner 2017-03-06 10:26:49 -05:00
parent c6c2cd0974
commit e6735957bc

View File

@ -28,20 +28,18 @@ Summary: Syntax highlighting engine written in Python
Group: Development/Libraries
License: BSD
URL: http://pygments.org/
Source0: http://pypi.python.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
Source0: https://pypi.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python2-devel >= 2.4, python-setuptools, python-nose, python-sphinx
%if 0%{?with_python3}
BuildRequires: python3-devel, python3-setuptools
%if 0%{?fedora} >= 15
BuildRequires: python3-nose
%endif
BuildRequires: python3-devel, python3-setuptools, python3-nose
%endif # if with_python3
Requires: python-setuptools
%if 0%{?with_python26}
BuildRequires: python26-devel, python26-distribute
BuildRequires: python26-devel, python26-distributea
Requires: python26-setuptools
%endif
@ -133,15 +131,7 @@ popd
%install
rm -rf $RPM_BUILD_ROOT
# 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
# Run the Python 2.6 build first so that the Python 2.6 version of
# /usr/bin/pygmentize "wins":
%if 0%{?with_python26}
pushd %{py26dir}
@ -149,6 +139,7 @@ pushd %{py26dir}
popd
%endif # with_python26
# Python2 version
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
%{__python} setup.py build_sphinx
pushd doc
@ -157,6 +148,15 @@ mv pygmentize.1 $RPM_BUILD_ROOT%{_mandir}/man1/pygmentize.1
popd
cp -r doc/docs doc/reST
# Run the Python 3 build last so that the Python 3 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
%clean
rm -rf $RPM_BUILD_ROOT
@ -206,8 +206,11 @@ popd
%changelog
* Thu Mar 2 2017 Steve Milner <smilner@redhat.com> - 2.2.0-2
* Thu Mar 6 2017 Steve Milner <smilner@redhat.com> - 2.2.0-2
- Update bin to come back into line with Fedora standards
- Python3 package now houses the pygmentize binary
- Fixed Source0 url to point to pypi.org
- Made python3-nose a hard BuildRequirement for python3
* Thu Mar 2 2017 Steve Milner <smilner@redhat.com> - 2.2.0-1
- Update for upstream release.