Fix python main package having dependencies for the python2.6 subpackage

Fix places that used the default python instead of python26
Attempt to make byte compilation more robust in case we add python3 to EPEL5
Run unittests on python3 in F15+
This commit is contained in:
Toshio Kuratomi 2011-09-12 17:43:19 -07:00
parent e4d4c1846a
commit 63ac05e5b7

View File

@ -11,8 +11,10 @@
%if 0%{?with_python26} %if 0%{?with_python26}
%global __python26 %{_bindir}/python2.6 %global __python26 %{_bindir}/python2.6
%global py26dir %{_builddir}/python26-%{name}-%{version}-%{release} %global py26dir %{_builddir}/python26-%{name}-%{version}-%{release}
%global python26_sitelib %{_libdir}/python2.6/site-packages %{!?python26_sitelib: %global python26_sitelib %(%{__python26} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
#Disable byte compileing and do ourselves later. # Disable byte compiling and do it with our script copied from Fedora 14/EL6
# FIXME:: ATM, it looks like byte compilation will either be broken for the py2.4 or py2.6 subpackage.
# Unless a fix is discovered, I'd advise making a separate package for python26 module
%endif %endif
@ -20,8 +22,8 @@
Name: python-pygments Name: python-pygments
Version: 1.4 Version: 1.4
Release: 1%{?dist} Release: 2%{?dist}
Summary: A syntax highlighting engine written in Python Summary: Syntax highlighting engine written in Python
Group: Development/Libraries Group: Development/Libraries
License: BSD License: BSD
@ -33,12 +35,13 @@ BuildArch: noarch
BuildRequires: python2-devel >= 2.4, python-setuptools, python-nose BuildRequires: python2-devel >= 2.4, python-setuptools, python-nose
%if 0%{?with_python3} %if 0%{?with_python3}
BuildRequires: python3-devel, python3-setuptools BuildRequires: python3-devel, python3-setuptools
%if 0%{?fedora} >= 15
BuildRequires: python3-nose
%endif
%endif # if with_python3 %endif # if with_python3
Requires: python-setuptools, python-imaging Requires: python-setuptools, python-imaging
%if 0%{?with_python26} %if 0%{?with_python26}
BuildRequires: python26-devel, python26-distribute BuildRequires: python26-devel, python26-distribute
Requires: python26-distribute, python26-imaging
Requires: python(abi) = 2.6
%endif %endif
@ -59,7 +62,7 @@ need to prettify source code. Highlights are:
%if 0%{?with_python3} %if 0%{?with_python3}
%package -n python3-pygments %package -n python3-pygments
Summary: A syntax highlighting engine written in Python 3 Summary: Syntax highlighting engine written in Python 3
Group: Development/Libraries Group: Development/Libraries
Requires: python3-setuptools Requires: python3-setuptools
@ -84,6 +87,8 @@ need to prettify source code. Highlights are:
Summary: A syntax highlighting engine written in Python 2.6 Summary: A syntax highlighting engine written in Python 2.6
Group: Development/Libraries Group: Development/Libraries
Requires: python26-distribute Requires: python26-distribute
Requires: python26-imaging
Requires: python(abi) = 2.6
%description -n python26-pygments %description -n python26-pygments
Pygments is a generic syntax highlighter for general use in all kinds Pygments is a generic syntax highlighter for general use in all kinds
@ -157,6 +162,11 @@ popd
%{__python} -O -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} -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 %{__python26} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"10"', "%{python26_sitelib}", 1)' > /dev/null
%if 0%{?with_python3}
%{__python3} -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"10"', "%{python3_sitelib}", 1)' > /dev/null
%{__python3} -O -c 'import compileall; compileall.compile_dir("'"$RPM_BUILD_ROOT"'", '"10"', "%{python3_sitelib}", 1)' > /dev/null
%endif
%endif %endif
@ -199,6 +209,12 @@ popd
%changelog %changelog
* Sat Sep 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.4-2
- Fix python main package having dependencies for the python2.6 subpackage
- Fix places that used the default python instead of python26
- Attempt to make byte compilation more robust in case we add python3 to EPEL5
- Run unittests on python3 in F15+
* Fri Jun 24 2011 Steve Milner <smilner@fedoraproject.org> - 1.4-1 * Fri Jun 24 2011 Steve Milner <smilner@fedoraproject.org> - 1.4-1
- update for upstream release - update for upstream release
- Add python2.6 support done by Steve Traylen <steve.traylen@cern.ch>. BZ#662755. - Add python2.6 support done by Steve Traylen <steve.traylen@cern.ch>. BZ#662755.