Keep this python35 only
This commit is contained in:
parent
68adb7b463
commit
6eb82a3e17
@ -1,27 +1,17 @@
|
||||
%if 0%{?fedora}
|
||||
%global with_python3 1
|
||||
|
||||
# This controls whether setuptools is build as a wheel or not,
|
||||
# simplifying Python 3.4 bootstraping process
|
||||
%global build_wheel 1
|
||||
%else
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
||||
%endif
|
||||
%global build_wheel 0
|
||||
|
||||
%global srcname setuptools
|
||||
%if 0%{?build_wheel}
|
||||
%global python2_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
|
||||
%global python2_record %{python2_sitelib}/%{srcname}-%{version}.dist-info/RECORD
|
||||
%if 0%{?with_python3}
|
||||
%global python3_wheelname %python2_wheelname
|
||||
%global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD
|
||||
%endif
|
||||
%global python3_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
|
||||
%global python3_record %{python35_sitelib}/%{srcname}-%{version}.dist-info/RECORD
|
||||
%endif
|
||||
|
||||
Name: python-setuptools
|
||||
Name: python35-setuptools
|
||||
Version: 2.0
|
||||
Release: 4%{?dist}
|
||||
Summary: Easily build and distribute Python packages
|
||||
Release: 5%{?dist}
|
||||
Summary: Easily build and distribute Python 3 packages
|
||||
|
||||
Group: Applications/System
|
||||
License: Python or ZPLv2.0
|
||||
@ -34,54 +24,15 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildArch: noarch
|
||||
# Require this so that we use a system copy of the match_hostname() function
|
||||
Requires: python-backports-ssl_match_hostname
|
||||
BuildRequires: python-backports-ssl_match_hostname
|
||||
BuildRequires: python2-devel
|
||||
BuildRequires: python35-devel
|
||||
%if 0%{?build_wheel}
|
||||
BuildRequires: python-pip
|
||||
BuildRequires: python-wheel
|
||||
BuildRequires: python35-pip
|
||||
BuildRequires: python35-wheel
|
||||
%endif
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
%if 0%{?build_wheel}
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-wheel
|
||||
%endif
|
||||
%endif # if with_python3
|
||||
# For unittests
|
||||
BuildRequires: subversion
|
||||
|
||||
# Legacy: We removed this subpackage once easy_install no longer depended on
|
||||
# python-devel
|
||||
# Planning on removing for F21
|
||||
# https://lists.fedoraproject.org/pipermail/devel/2013-November/191344.html
|
||||
Provides: python-setuptools-devel = %{version}-%{release}
|
||||
Obsoletes: python-setuptools-devel < 0.6.7-1
|
||||
|
||||
# We're now back to setuptools as the package.
|
||||
# Keep the python-distribute name active for a few releases. Eventually we'll
|
||||
# want to get rid of the Provides and just keep the Obsoletes
|
||||
Provides: python-distribute = %{version}-%{release}
|
||||
Obsoletes: python-distribute < 0.6.36-2
|
||||
|
||||
%description
|
||||
Setuptools is a collection of enhancements to the Python distutils that allow
|
||||
you to more easily build and distribute Python packages, especially ones that
|
||||
have dependencies on other packages.
|
||||
|
||||
This package also contains the runtime components of setuptools, necessary to
|
||||
execute the software that requires pkg_resources.py.
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%package -n python3-setuptools
|
||||
Summary: Easily build and distribute Python 3 packages
|
||||
Group: Applications/System
|
||||
|
||||
# Note: Do not need to Require python3-backports-ssl_match_hostname because it
|
||||
# has been present since python3-3.2. We do not ship python3-3.0 or
|
||||
# python3-3.1 anywhere
|
||||
|
||||
%description -n python3-setuptools
|
||||
Setuptools is a collection of enhancements to the Python 3 distutils that allow
|
||||
you to more easily build and distribute Python 3 packages, especially ones that
|
||||
have dependencies on other packages.
|
||||
@ -89,54 +40,26 @@ have dependencies on other packages.
|
||||
This package also contains the runtime components of setuptools, necessary to
|
||||
execute the software that requires pkg_resources.py.
|
||||
|
||||
%endif # with_python3
|
||||
|
||||
%prep
|
||||
%setup -q -n %{srcname}-%{version}
|
||||
|
||||
find -name '*.txt' -exec chmod -x \{\} \;
|
||||
find . -name '*.orig' -exec rm \{\} \;
|
||||
|
||||
%if 0%{?with_python3}
|
||||
rm -rf %{py3dir}
|
||||
cp -a . %{py3dir}
|
||||
pushd %{py3dir}
|
||||
for file in setuptools/command/easy_install.py ; do
|
||||
sed -i '1s|^#!python|#!%{__python3}|' $file
|
||||
done
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
for file in setuptools/command/easy_install.py ; do
|
||||
sed -i '1s|^#!python|#!%{__python}|' $file
|
||||
sed -i '1s|^#!python|#!%{__python35}|' $file
|
||||
done
|
||||
|
||||
%build
|
||||
%if 0%{?build_wheel}
|
||||
%{__python} setup.py bdist_wheel
|
||||
%{__python35} setup.py bdist_wheel
|
||||
%else
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python35} setup.py build
|
||||
%endif
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%if 0%{?build_wheel}
|
||||
%{__python3} setup.py bdist_wheel
|
||||
%else
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
||||
%endif
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
# Must do the python3 install first because the scripts in /usr/bin are
|
||||
# overwritten with every setup.py install (and we want the python2 version
|
||||
# to be the default for now).
|
||||
# Change to defaulting to python3 version in F22
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%if 0%{?build_wheel}
|
||||
pip3 install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
|
||||
|
||||
@ -146,43 +69,20 @@ rm %{buildroot}%{_bindir}/easy_install
|
||||
|
||||
sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
|
||||
%else
|
||||
%{__python3} setup.py install --skip-build --root %{buildroot}
|
||||
%{__python35} setup.py install --skip-build --root %{buildroot}
|
||||
%endif
|
||||
|
||||
rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
|
||||
rm -rf %{buildroot}%{python35_sitelib}/setuptools/tests
|
||||
%if 0%{?build_wheel}
|
||||
sed -i '/^setuptools\/tests\//d' %{buildroot}%{python3_record}
|
||||
%endif
|
||||
|
||||
install -p -m 0644 %{SOURCE1} %{SOURCE2} %{py3dir}
|
||||
find %{buildroot}%{python3_sitelib} -name '*.exe' | xargs rm -f
|
||||
chmod +x %{buildroot}%{python3_sitelib}/setuptools/command/easy_install.py
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%if 0%{?build_wheel}
|
||||
pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
|
||||
%else
|
||||
%{__python} setup.py install --skip-build --root %{buildroot}
|
||||
%endif
|
||||
|
||||
rm -rf %{buildroot}%{python_sitelib}/setuptools/tests
|
||||
%if 0%{?build_wheel}
|
||||
sed -i '/^setuptools\/tests\//d' %{buildroot}%{python2_record}
|
||||
%endif
|
||||
|
||||
install -p -m 0644 %{SOURCE1} %{SOURCE2} .
|
||||
find %{buildroot}%{python_sitelib} -name '*.exe' | xargs rm -f
|
||||
chmod +x %{buildroot}%{python_sitelib}/setuptools/command/easy_install.py
|
||||
find %{buildroot}%{python35_sitelib} -name '*.exe' | xargs rm -f
|
||||
chmod +x %{buildroot}%{python35_sitelib}/setuptools/command/easy_install.py
|
||||
|
||||
%check
|
||||
%{__python} setup.py test
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py test
|
||||
popd
|
||||
%endif # with_python3
|
||||
%{__python35} setup.py test
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
@ -190,20 +90,14 @@ rm -rf %{buildroot}
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc *.txt docs
|
||||
%{python_sitelib}/*
|
||||
%{_bindir}/easy_install
|
||||
%{_bindir}/easy_install-2.*
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-setuptools
|
||||
%defattr(-,root,root,-)
|
||||
%doc psfl.txt zpl.txt docs
|
||||
%{python3_sitelib}/*
|
||||
%{python35_sitelib}/*
|
||||
%{_bindir}/easy_install-3.*
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Sat Jun 07 2014 Miro Hrončok <mhroncok@redhat.com> - 2.0-5
|
||||
- Keep this only for Python 3.5
|
||||
|
||||
* Fri Apr 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.0-4
|
||||
- Rebuild as wheel for Python 3.4
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user