diff --git a/SOURCES/easy_install-fips-mode.patch b/SOURCES/easy_install-fips-mode.patch new file mode 100644 index 0000000..82a64bc --- /dev/null +++ b/SOURCES/easy_install-fips-mode.patch @@ -0,0 +1,16 @@ +diff --git a/setuptools/package_index.py b/setuptools/package_index.py +index 9c9d76a..b641d21 100644 +--- a/setuptools/package_index.py ++++ b/setuptools/package_index.py +@@ -232,7 +232,10 @@ class HashChecker(ContentChecker): + + def __init__(self, hash_name, expected): + self.hash_name = hash_name +- self.hash = hashlib.new(hash_name) ++ if hash_name == 'md5': ++ self.hash = hashlib.new(hash_name, usedforsecurity=False) ++ else: ++ self.hash = hashlib.new(hash_name) + self.expected = expected + + @classmethod diff --git a/SOURCES/work-properly-with-path-separators.patch b/SOURCES/work-properly-with-path-separators.patch new file mode 100644 index 0000000..0b8bb75 --- /dev/null +++ b/SOURCES/work-properly-with-path-separators.patch @@ -0,0 +1,28 @@ +From 18f0d032b806f70dd1adbcab107dda875c61ba0b Mon Sep 17 00:00:00 2001 +From: Petr Vobornik +Date: Tue, 25 Oct 2016 16:23:45 +0200 +Subject: [PATCH] Work properly with path separators + +--- + setuptools/command/build_py.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/setuptools/command/build_py.py b/setuptools/command/build_py.py +index 8751acd493cf5c3c45022f29940ee2beda3bb6cd..0b5c3cfa994d21af2a03f2c50f1e5d166fe2bffc 100644 +--- a/setuptools/command/build_py.py ++++ b/setuptools/command/build_py.py +@@ -120,7 +120,10 @@ class build_py(_build_py, Mixin2to3): + build_dir = os.path.join(*([self.build_lib] + package.split('.'))) + + # Length of path to strip from found files +- plen = len(src_dir)+1 ++ plen = len(src_dir) ++ # Remove path seperator ++ if plen: ++ plen += 1 + + # Strip directory from globbed filenames + filenames = [ +-- +2.7.4 + diff --git a/SPECS/python-setuptools.spec b/SPECS/python-setuptools.spec index 2259b0c..ab78c92 100644 --- a/SPECS/python-setuptools.spec +++ b/SPECS/python-setuptools.spec @@ -2,7 +2,7 @@ Name: python-setuptools Version: 0.9.8 -Release: 4%{?dist} +Release: 7%{?dist} Summary: Easily build and distribute Python packages Group: Applications/System @@ -17,6 +17,13 @@ Patch0: python-setuptools-0.9.8-use-ssl-match-hostname-from-backports.pa # Restore proxy support in SSL connections Patch1: restore-proxy-support-SSL-connection.patch +# Fix path separator handling in build +# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1388549 +Patch2: work-properly-with-path-separators.patch + +# Fix easy_install in FIPS mode +Patch3: easy_install-fips-mode.patch + BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-backports-ssl_match_hostname @@ -30,6 +37,9 @@ Obsoletes: python-setuptools-devel < 0.6.7-1 # Provide this since some people will request distribute by name Provides: python-distribute = %{version}-%{release} +# Provide the python2 namespace for the package +Provides: python2-setuptools = %{version}-%{release} + %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 @@ -47,6 +57,8 @@ sed -i '1s|^#!python|#!%{__python}|' setuptools/command/easy_install.py %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build @@ -72,6 +84,18 @@ LANG=en_US.utf8 %{__python} setup.py test %{_bindir}/easy_install-2.* %changelog +* Wed Feb 15 2017 Charalampos Stratakis - 0.9.8-7 +- Fix easy_install in fips mode +Resolves: rhbz#966970 + +* Wed Feb 01 2017 Charalampos Stratakis - 0.9.8-6 +- Provide the python2-setuptools name +Resolves: rhbz#1259474 + +* Tue Oct 25 2016 Petr Vobornik - 0.9.8-5 +- Fix path separator handling in build +Resolves: rhbz#1388549 + * Tue Jun 30 2015 Matej Stuchlik - 0.9.8-4 - Restore proxy support in SSL connections Resolves: rhbz#1121007