From 2b8ed0e5e5c9e4284efe8713ddf509e492f82549 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 05:43:09 +0000 Subject: import python-gssapi-1.2.0-2.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..50631d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/python-gssapi-1.2.0.tar.gz diff --git a/.python-gssapi.metadata b/.python-gssapi.metadata new file mode 100644 index 0000000..21f129f --- /dev/null +++ b/.python-gssapi.metadata @@ -0,0 +1 @@ +b1ae3dc59a10f794ab86827089dd2343018bb99d SOURCES/python-gssapi-1.2.0.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/k5test-0.9.1-usr_lib64.patch b/SOURCES/k5test-0.9.1-usr_lib64.patch new file mode 100644 index 0000000..cd65a09 --- /dev/null +++ b/SOURCES/k5test-0.9.1-usr_lib64.patch @@ -0,0 +1,31 @@ +From 833d6c6b7cac7721e6e246b49edc794c19ab5178 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Thu, 24 Mar 2016 14:39:53 -0400 +Subject: [PATCH 1/3] Ensure test suite works with RHEL /usr/lib64 + +Adapted from https://github.com/pythongssapi/k5test/pull/1 +--- + gssapi/tests/_utils.py | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gssapi/tests/_utils.py b/gssapi/tests/_utils.py +index 603be56..57e10e4 100644 +--- a/gssapi/tests/_utils.py ++++ b/gssapi/tests/_utils.py +@@ -75,9 +75,11 @@ def _find_plugin_dir(): + + # if there was no LD_LIBRARY_PATH, or the above failed + if _PLUGIN_DIR is None: +- # if we don't have a LD_LIBRARY_PATH, just search in +- # $prefix/lib ++ lib_dir = os.path.join(get_output('krb5-config --prefix'), 'lib64') ++ _PLUGIN_DIR = _decide_plugin_dir(_find_plugin_dirs_installed(lib_dir)) + ++ # /usr/lib64 has only been observed on RHEL ++ if _PLUGIN_DIR is None: + lib_dir = os.path.join(get_output('krb5-config --prefix'), 'lib') + _PLUGIN_DIR = _decide_plugin_dir(_find_plugin_dirs_installed(lib_dir)) + +-- +1.8.3.1 + diff --git a/SOURCES/python-gssapi-1.2.1-overwrite_cred_store.patch b/SOURCES/python-gssapi-1.2.1-overwrite_cred_store.patch new file mode 100644 index 0000000..4d6093d --- /dev/null +++ b/SOURCES/python-gssapi-1.2.1-overwrite_cred_store.patch @@ -0,0 +1,47 @@ +From fddcbec3d7b5ad50ffd2e66c7203dc200d26a594 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Mon, 28 Mar 2016 22:07:08 -0400 +Subject: [PATCH 3/3] Force overwrite on cred_store tests + +Certain versions of krb5 (>= 1.14 or anything that backported the +patch, including RHEL/Centos/Fedora) object (probably rightly so) to +duplicate credentials already existing in the ccache. Tell those +versions to sit down and shut up. + +This is the third and final commit in a series to enable running our +test suite on RHEL-7. +--- + gssapi/tests/test_high_level.py | 3 ++- + gssapi/tests/test_raw.py | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/gssapi/tests/test_high_level.py b/gssapi/tests/test_high_level.py +index 404ed43..3a9b8a3 100644 +--- a/gssapi/tests/test_high_level.py ++++ b/gssapi/tests/test_high_level.py +@@ -174,7 +174,8 @@ class CredsTestCase(_GSSAPIKerberosTestCase): + deleg_creds = server_ctx.delegated_creds + deleg_creds.shouldnt_be_none() + +- store_res = deleg_creds.store(usage='initiate', set_default=True) ++ store_res = deleg_creds.store(usage='initiate', set_default=True, ++ overwrite=True) + store_res.usage.should_be('initiate') + store_res.mechs.should_include(gb.MechType.kerberos) + +diff --git a/gssapi/tests/test_raw.py b/gssapi/tests/test_raw.py +index 23f2e2c..beebfb3 100644 +--- a/gssapi/tests/test_raw.py ++++ b/gssapi/tests/test_raw.py +@@ -474,7 +474,7 @@ class TestBaseUtilities(_GSSAPIKerberosTestCase): + deleg_creds = server_ctx_resp.delegated_creds + deleg_creds.shouldnt_be_none() + store_res = gb.store_cred(deleg_creds, usage='initiate', +- set_default=True) ++ set_default=True, overwrite=True) + + store_res.shouldnt_be_none() + store_res.usage.should_be('initiate') +-- +1.8.3.1 + diff --git a/SOURCES/python-gssapi-cython_0.19.patch b/SOURCES/python-gssapi-cython_0.19.patch new file mode 100644 index 0000000..6c025c7 --- /dev/null +++ b/SOURCES/python-gssapi-cython_0.19.patch @@ -0,0 +1,88 @@ +From 3b9a02481ff0f98ec9ee40d06d71d2a25d7d0bf3 Mon Sep 17 00:00:00 2001 +From: Robbie Harwood +Date: Thu, 24 Mar 2016 14:46:02 -0400 +Subject: [PATCH 2/3] Work around bug in Cython 0.19 in test suite + +Pre-0.21 Cython seems to incorrectly represent integral types as too +large. However, for our purposes, it is acceptable for them to be +larger than their declared type, as long as they are integral. +--- + gssapi/tests/test_raw.py | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/gssapi/tests/test_raw.py b/gssapi/tests/test_raw.py +index 37f6372..23f2e2c 100644 +--- a/gssapi/tests/test_raw.py ++++ b/gssapi/tests/test_raw.py +@@ -394,8 +394,8 @@ class TestBaseUtilities(_GSSAPIKerberosTestCase): + actual_mechs.shouldnt_be_empty() + actual_mechs.should_include(gb.MechType.kerberos) + +- output_init_ttl.should_be_a(int) +- output_accept_ttl.should_be_a(int) ++ output_init_ttl.should_be_an_integer() ++ output_accept_ttl.should_be_an_integer() + + new_creds.should_be_a(gb.Creds) + +@@ -426,7 +426,7 @@ class TestBaseUtilities(_GSSAPIKerberosTestCase): + actual_mechs.shouldnt_be_empty() + actual_mechs.should_include(gb.MechType.kerberos) + +- output_ttl.should_be_a(int) ++ output_ttl.should_be_an_integer() + # no need to explicitly release any more -- we can just rely on + # __dealloc__ (b/c cython) + +@@ -541,8 +541,8 @@ class TestBaseUtilities(_GSSAPIKerberosTestCase): + actual_mechs.shouldnt_be_empty() + actual_mechs.should_include(gb.MechType.kerberos) + +- output_init_ttl.should_be_a(int) +- output_accept_ttl.should_be_a(int) ++ output_init_ttl.should_be_an_integer() ++ output_accept_ttl.should_be_an_integer() + + new_creds.should_be_a(gb.Creds) + +@@ -618,7 +618,7 @@ class TestBaseUtilities(_GSSAPIKerberosTestCase): + actual_mechs.shouldnt_be_empty() + actual_mechs.should_include(gb.MechType.kerberos) + +- output_ttl.should_be_a(int) ++ output_ttl.should_be_an_integer() + + @_extension_test('password_add', 'Password (add)') + def test_add_cred_with_password(self): +@@ -638,8 +638,8 @@ class TestBaseUtilities(_GSSAPIKerberosTestCase): + actual_mechs.shouldnt_be_empty() + actual_mechs.should_include(gb.MechType.kerberos) + +- output_init_ttl.should_be_a(int) +- output_accept_ttl.should_be_a(int) ++ output_init_ttl.should_be_an_integer() ++ output_accept_ttl.should_be_an_integer() + + new_creds.should_be_a(gb.Creds) + +@@ -1079,7 +1079,7 @@ class TestWrapUnwrap(_GSSAPIKerberosTestCase): + conf.should_be_a(bool) + conf.should_be_true() + +- qop.should_be_a(int) ++ qop.should_be_an_integer() + + init_message[1].value.should_be(init_signed_info) + init_message[2].value.should_be(init_data) +@@ -1111,7 +1111,7 @@ class TestWrapUnwrap(_GSSAPIKerberosTestCase): + conf.should_be_a(bool) + conf.should_be_true() + +- qop.should_be_a(int) ++ qop.should_be_an_integer() + + init_message[1].value.should_be(init_signed_info) + init_message[2].value.should_be(init_data) +-- +1.8.3.1 + diff --git a/SPECS/python-gssapi.spec b/SPECS/python-gssapi.spec new file mode 100644 index 0000000..c3071f0 --- /dev/null +++ b/SPECS/python-gssapi.spec @@ -0,0 +1,148 @@ +# NOTE: tests are disabled since should_be has not yet been packaged. +%global run_tests 0 + +# NOTE: python3 is disabled since python3-Cython is not yet packaged +%global with_python3 0 + +Name: python-gssapi +Version: 1.2.0 +Release: 2%{?dist} +Summary: Python Bindings for GSSAPI (RFC 2743/2744 and extensions) + +License: ISC +URL: https://github.com/pythongssapi/python-gssapi +Source0: https://github.com/pythongssapi/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz + +Patch0: k5test-0.9.1-usr_lib64.patch +Patch1: python-gssapi-cython_0.19.patch +Patch2: python-gssapi-1.2.1-overwrite_cred_store.patch + +BuildRequires: python2-devel +BuildRequires: krb5-devel >= 1.10 +BuildRequires: krb5-libs >= 1.10 +BuildRequires: Cython >= 0.19 +BuildRequires: python-setuptools +Requires: krb5-libs >= 1.10 +Requires: python-six +Requires: python-enum34 +Requires: python-decorator + +%if 0%{?run_tests} +BuildRequires: python-nose +BuildRequires: python-nose-parameterized +BuildRequires: python-shouldbe +BuildRequires: python-tox +BuildRequires: krb5-server >= 1.10 +%endif + +%if 0%{?with_python3} +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-Cython + +%if 0%{?run_tests} +BuildRequires: python3-nose +BuildRequires: python3-nose-parameterized +BuildRequires: python3-should-be +%endif +%endif + +%description +A set of Python bindings to the GSSAPI C library providing both +a high-level pythonic interfaces and a low-level interfaces +which more closely matches RFC 2743. Includes support for +RFC 2743, as well as multiple extensions. + + +%if 0%{?with_python3} +%package -n python3-gssapi +Summary: Python 3 Bindings for GSSAPI (RFC 2743/2744 and extensions) + +Requires: krb5-libs >= 1.10 +Requires: python3-six +Requires: python3-decorator + +%description -n python3-gssapi +A set of Python 3 bindings to the GSSAPI C library providing both +a high-level pythonic interfaces and a low-level interfaces +which more closely matches RFC 2743. Includes support for +RFC 2743, as well as multiple extensions. +%endif + + +%prep +%setup -q + +%patch0 -p1 -b .usr_lib64 +%patch1 -p1 -b .cython_0.19 +%patch2 -p1 -b .overwrite_cred_store + +%if 0%{?with_python3} +rm -rf %{py3dir} +cp -a . %{py3dir} +%endif + + +%build +CFLAGS="%{optflags}" %{__python2} setup.py build + +%if 0%{?with_python3} +pushd %{py3dir} +CFLAGS="%{optflags}" %{__python3} setup.py build +popd +%endif + + +%install +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py install --skip-build --root %{buildroot} + +# fix permissions on shared objects (mock seems to set them +# to 0775, whereas a normal build gives 0755) +find %{buildroot}%{python3_sitearch}/gssapi -name '*.so' \ + -exec chmod 0755 {} \; + +popd +%endif + +%{__python2} setup.py install --skip-build --root %{buildroot} + +# fix permissions on shared objects (mock seems to set them +# to 0775, whereas a normal build gives 0755) +find %{buildroot}%{python2_sitearch}/gssapi -name '*.so' \ + -exec chmod 0755 {} \; + +%check +%if 0%{?run_tests} +%{__python2} setup.py nosetests + +%if 0%{?with_python3} +pushd %{py3dir} +%{__python3} setup.py nosetests +popd +%endif +%endif + + +%files +%doc README.txt +%license LICENSE.txt +%{python2_sitearch}/* + +%if 0%{?with_python3} +%files -n python3-gssapi +%doc README.txt +%license LICENSE.txt +%{python3_sitearch}/* +%endif + + +%changelog +* Mon Apr 04 2016 Robbie Harwood - 1.2.0-2 +- Move python-tox from build requirement to test requirement +- Resolves: #1292139 + +* Mon Mar 28 2016 Robbie Harwood - 1.2.0-1 +- Import upstream version 1.2.0 with patches +- Resolves: #1292139