File python-setuptools.spec of Package python-setuptools

# spec file for package python-setuptools
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

Name:           python-setuptools
Version:        5.4.1
Release:        0
Summary:        Easily download, build, install, upgrade, and uninstall Python packages
License:        Python-2.0 or ZPL-2.0
Group:          Development/Languages/Python
Source1:        psfl.txt
Source2:        zpl.txt
Patch1:         setuptools-5.4.1-create-sitedir.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
BuildRequires:  python-xml
# needed for SLE
Requires:       python
Requires:       python-xml
Requires(post): update-alternatives
Requires(postun): update-alternatives
# NOTE(saschpe): Distribute was merged into 0.7.x, so even though distribute
# 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()")}
BuildArch:      noarch

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.

%setup -q -n setuptools-%{version}
%patch1 -p1
find . -type f -name "*.orig" -delete

python build

python 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

update-alternatives \
    --install %{_bindir}/easy_install easy_install %{_bindir}/easy_install-%{py_ver} 20

if [ $1 -eq 0 ] ; then
    update-alternatives --remove easy_install %{_bindir}/easy_install-%{py_ver}

%doc CHANGES.txt README.txt
%ghost %{_sysconfdir}/alternatives/easy_install

openSUSE Build Service is sponsored by