diff --git a/python-setuptools.changes b/python-setuptools.changes index 95b0813..773e96e 100644 --- a/python-setuptools.changes +++ b/python-setuptools.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Feb 16 15:58:12 UTC 2017 - jmatejek@suse.com + +- update for multipython build + ------------------------------------------------------------------- Mon Dec 12 12:57:12 UTC 2016 - hpj@urpla.net diff --git a/python-setuptools.spec b/python-setuptools.spec index cda39b6..7ab7f8b 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -16,10 +16,10 @@ # +%{?!python_module:%define python_module() python-%1 python3-%1} Name: python-setuptools Version: 28.3.0 Release: 0 -Url: http://pypi.python.org/pypi/setuptools Summary: Easily download, build, install, upgrade, and uninstall Python packages License: Python-2.0 or ZPL-2.0 Group: Development/Languages/Python @@ -31,9 +31,9 @@ Patch1: setuptools-5.4.1-create-sitedir.patch Patch3: fix-sle11-test-failure.patch # PATCH-FIX-UPSTREAM better handling of certificate store in SUSE Patch4: setuptools-certpath.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: python-devel -BuildRequires: python-xml +BuildRequires: %{python_module devel} +BuildRequires: %{python_module xml} +BuildRequires: python-rpm-macros # needed for SLE Requires: python Requires: python-six @@ -45,17 +45,18 @@ Requires(postun): update-alternatives # obsoletes setuptools < 0.6.45, current setuptools obsoletes distribute again Provides: python-distribute = %{version} Obsoletes: python-distribute < %{version} -%if 0%{?suse_version} && 0%{?suse_version} <= 1110 -%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} -%else +%if 0%{?suse_version} > 1110 BuildArch: noarch %endif +%python_subpackages + %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. + %prep %setup -q -n setuptools-%{version} %patch1 -p1 @@ -77,14 +78,11 @@ chmod -x README.rst sed -r -i '1s@^#!/.*$@@' pkg_resources/_vendor/appdirs.py setuptools/command/easy_install.py %build -python setup.py build +%python_build %install -python setup.py install --prefix=%{_prefix} --root=%{buildroot} -rm %{buildroot}%{_bindir}/easy_install -mkdir -p %{buildroot}%{_sysconfdir}/alternatives -touch %{buildroot}%{_sysconfdir}/alternatives/easy_install -ln -sf %{_sysconfdir}/alternatives/easy_install %{buildroot}/%{_bindir}/easy_install +%python_install +%prepare_alternative easy_install # Can not run testsuite as this introduces build cycle #%check @@ -92,23 +90,19 @@ ln -sf %{_sysconfdir}/alternatives/easy_install %{buildroot}/%{_bindir}/easy_ins #python setup.py ptr --addopts='-rxs' %post -update-alternatives \ - --install %{_bindir}/easy_install easy_install %{_bindir}/easy_install-%{py_ver} 20 +%python_install_alternative easy_install %postun -if [ $1 -eq 0 ] ; then - update-alternatives --remove easy_install %{_bindir}/easy_install-%{py_ver} -fi +%python_uninstall_alternative easy_install -%files +%files %python_files %defattr(-,root,root,-) %doc CHANGES.rst README.rst -%{_bindir}/easy_install -%{_bindir}/easy_install-%{py_ver} -%ghost %{_sysconfdir}/alternatives/easy_install +%python_alternative %{_bindir}/easy_install %{python_sitelib}/setuptools -%{python_sitelib}/setuptools-%{version}-py%{py_ver}.egg-info +%{python_sitelib}/setuptools-%{version}-py%{python_version}.egg-info %{python_sitelib}/easy_install.py* +%pycache_only %{python_sitelib}/__pycache__/easy_install.* %dir %{python_sitelib}/pkg_resources %{python_sitelib}/pkg_resources/*