Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
20e1a94070 | ||
|
4ba5cd636d | ||
|
c3b89607eb | ||
|
14219a6283 | ||
|
1997fb6284 | ||
|
ab66e7908c | ||
|
d6301e5668 | ||
|
2349df0ebf | ||
|
6eb82a3e17 |
@ -1,6 +1,9 @@
|
||||
%if 0%{?fedora}
|
||||
%global with_python2 0
|
||||
%global with_python3 1
|
||||
|
||||
%{?scl:%global py3dir %{_builddir}/python3-%{name}-%{version}-%{release}}
|
||||
|
||||
# This controls whether setuptools is build as a wheel or not,
|
||||
# simplifying Python 3.4 bootstraping process
|
||||
%global build_wheel 1
|
||||
@ -8,25 +11,28 @@
|
||||
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
|
||||
%endif
|
||||
|
||||
%{?scl:%scl_package python-setuptools}
|
||||
%{!?scl:%global pkg_name %{name}}
|
||||
|
||||
%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
|
||||
%global python2_wheelname %{srcname}-*-py2.py3-none-any.whl
|
||||
%global python2_record %{python2_sitelib}/%{srcname}-*.dist-info/RECORD
|
||||
%if 0%{?with_python3}
|
||||
%global python3_wheelname %python2_wheelname
|
||||
%global python3_record %{python3_sitelib}/%{srcname}-%{version}.dist-info/RECORD
|
||||
%global python3_record %{python3_sitelib}/%{srcname}-*.dist-info/RECORD
|
||||
%endif
|
||||
%endif
|
||||
|
||||
Name: python-setuptools
|
||||
Name: %{?scl_prefix}python-setuptools
|
||||
Version: 2.0
|
||||
Release: 4%{?dist}
|
||||
Release: 0.8.20140630hg2381b1160889%{?dist}
|
||||
Summary: Easily build and distribute Python packages
|
||||
|
||||
Group: Applications/System
|
||||
License: Python or ZPLv2.0
|
||||
URL: http://pypi.python.org/pypi/%{srcname}
|
||||
Source0: http://pypi.python.org/packages/source/s/%{srcname}/%{srcname}-%{version}.tar.gz
|
||||
Source0: python3-nightly-setuptools-2381b1160889.tar
|
||||
Source1: psfl.txt
|
||||
Source2: zpl.txt
|
||||
|
||||
@ -34,35 +40,39 @@ 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
|
||||
#Requires: python-backports-ssl_match_hostname
|
||||
#BuildRequires: python-backports-ssl_match_hostname
|
||||
%if 0%{?with_python2}
|
||||
BuildRequires: python2-devel
|
||||
%if 0%{?build_wheel}
|
||||
BuildRequires: python-pip
|
||||
BuildRequires: python-wheel
|
||||
%endif
|
||||
%endif # if with_python2
|
||||
%if 0%{?with_python3}
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: %{?scl_prefix}python3-devel
|
||||
%if 0%{?build_wheel}
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: python3-wheel
|
||||
BuildRequires: %{?scl_prefix}python3-pip
|
||||
BuildRequires: %{?scl_prefix}python3-wheel
|
||||
%endif
|
||||
%endif # if with_python3
|
||||
# For unittests
|
||||
BuildRequires: subversion
|
||||
|
||||
%if 0%{?with_python2}
|
||||
# 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
|
||||
Provides: %{?scl_prefix}python-setuptools-devel = %{version}-%{release}
|
||||
Obsoletes: %{?scl_prefix}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
|
||||
Provides: %{?scl_prefix}python-distribute = %{version}-%{release}
|
||||
Obsoletes: %{?scl_prefix}python-distribute < 0.6.36-2
|
||||
%endif # if with_python2
|
||||
|
||||
%description
|
||||
Setuptools is a collection of enhancements to the Python distutils that allow
|
||||
@ -73,7 +83,7 @@ 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
|
||||
%package -n %{?scl_prefix}python3-setuptools
|
||||
Summary: Easily build and distribute Python 3 packages
|
||||
Group: Applications/System
|
||||
|
||||
@ -81,7 +91,7 @@ Group: Applications/System
|
||||
# has been present since python3-3.2. We do not ship python3-3.0 or
|
||||
# python3-3.1 anywhere
|
||||
|
||||
%description -n python3-setuptools
|
||||
%description -n %{?scl_prefix}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.
|
||||
@ -92,7 +102,7 @@ execute the software that requires pkg_resources.py.
|
||||
%endif # with_python3
|
||||
|
||||
%prep
|
||||
%setup -q -n %{srcname}-%{version}
|
||||
%setup -q -n python3-nightly-%{srcname}
|
||||
|
||||
find -name '*.txt' -exec chmod -x \{\} \;
|
||||
find . -name '*.orig' -exec rm \{\} \;
|
||||
@ -107,16 +117,21 @@ done
|
||||
popd
|
||||
%endif # with_python3
|
||||
|
||||
%if 0%{?with_python2}
|
||||
for file in setuptools/command/easy_install.py ; do
|
||||
sed -i '1s|^#!python|#!%{__python}|' $file
|
||||
done
|
||||
%endif # with_python2
|
||||
|
||||
%build
|
||||
%{?scl:scl enable %{scl} - << \EOF}
|
||||
%if 0%{?with_python2}
|
||||
%if 0%{?build_wheel}
|
||||
%{__python} setup.py bdist_wheel
|
||||
%else
|
||||
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
|
||||
%endif
|
||||
%endif # with_python2
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
@ -127,10 +142,13 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
|
||||
%endif
|
||||
popd
|
||||
%endif # with_python3
|
||||
%{?scl:EOF}
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%{?scl:scl enable %{scl} - << \EOF}
|
||||
|
||||
# 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).
|
||||
@ -140,9 +158,11 @@ pushd %{py3dir}
|
||||
%if 0%{?build_wheel}
|
||||
pip3 install -I dist/%{python3_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
|
||||
|
||||
%if 0%{?with_python2}
|
||||
# TODO: we have to remove this by hand now, but it'd be nice if we wouldn't have to
|
||||
# (pip install wheel doesn't overwrite)
|
||||
rm %{buildroot}%{_bindir}/easy_install
|
||||
%endif # with_python2
|
||||
|
||||
sed -i '/\/usr\/bin\/easy_install,/d' %{buildroot}%{python3_record}
|
||||
%else
|
||||
@ -154,12 +174,12 @@ rm -rf %{buildroot}%{python3_sitelib}/setuptools/tests
|
||||
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%{?with_python2}
|
||||
%if 0%{?build_wheel}
|
||||
pip2 install -I dist/%{python2_wheelname} --root %{buildroot} --strip-file-prefix %{buildroot}
|
||||
%else
|
||||
@ -171,39 +191,65 @@ rm -rf %{buildroot}%{python_sitelib}/setuptools/tests
|
||||
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
|
||||
%endif # with_python2
|
||||
|
||||
install -p -m 0644 %{SOURCE1} %{SOURCE2} .
|
||||
%{?scl:EOF}
|
||||
|
||||
%check
|
||||
%{?scl:scl enable %{scl} - << \EOF}
|
||||
%if 0%{?with_python2}
|
||||
%{__python} setup.py test
|
||||
%endif # with_python2
|
||||
|
||||
%if 0%{?with_python3}
|
||||
pushd %{py3dir}
|
||||
%{__python3} setup.py test
|
||||
popd
|
||||
%endif # with_python3
|
||||
%{?scl:EOF}
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
|
||||
%if 0%{?with_python2}
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
%doc *.txt docs
|
||||
%{python_sitelib}/*
|
||||
%{_bindir}/easy_install
|
||||
%{_bindir}/easy_install-2.*
|
||||
%endif # with_python2
|
||||
|
||||
%if 0%{?with_python3}
|
||||
%files -n python3-setuptools
|
||||
%files -n %{?scl_prefix}python3-setuptools
|
||||
%defattr(-,root,root,-)
|
||||
%doc psfl.txt zpl.txt docs
|
||||
%doc *.txt docs
|
||||
%{python3_sitelib}/*
|
||||
|
||||
%if ! 0%{?with_python2}
|
||||
%{_bindir}/easy_install
|
||||
%endif # !with_python2
|
||||
|
||||
%{_bindir}/easy_install-3.*
|
||||
%endif # with_python3
|
||||
|
||||
%changelog
|
||||
* Mon Jun 30 2014 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.8.20140630hg2381b1160889
|
||||
- Update to hg: 2381b1160889
|
||||
|
||||
* Sun Jun 29 2014 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.7.20140629hg989c1f4044c6
|
||||
- Update to hg: 989c1f4044c6
|
||||
|
||||
* Fri Jun 27 2014 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.6.20140625hgb54ae9c52355
|
||||
- Bootstrapping
|
||||
|
||||
* Wed Jun 25 2014 Miro Hrončok <mhroncok@redhat.com> - 2.0-0.5.20140625hgb54ae9c52355
|
||||
- Update to hg: b54ae9c52355
|
||||
|
||||
* Fri Apr 25 2014 Matej Stuchlik <mstuchli@redhat.com> - 2.0-4
|
||||
- Rebuild as wheel for Python 3.4
|
||||
|
||||
@ -351,7 +397,7 @@ rm -rf %{buildroot}
|
||||
|
||||
* Thu Feb 04 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-3
|
||||
- First build with python3 support enabled.
|
||||
|
||||
|
||||
* Fri Jan 29 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.10-2
|
||||
- Really disable the python3 portion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user