From 7601087c691931e8771ac10336aac9e9600e526e Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Wed, 25 Feb 2015 10:15:06 +0100 Subject: [PATCH] Backport upstream patches for building python{2,3} bindings --- ...Remove-unused-libraries-for-pysss.so.patch | 34 ++ 0002-BUILD-Remove-unused-variables.patch | 26 + ...-Remove-detection-of-type-Py_ssize_t.patch | 57 ++ ...ve-python-wrapper-sss_python_set_new.patch | 86 +++ ...ve-python-wrapper-sss_python_set_add.patch | 93 +++ ...-python-wrapper-sss_python_set_check.patch | 79 +++ ...atibility-macro-PyModule_AddIntMacro.patch | 45 ++ ...on-wrapper-sss_python_unicode_from_s.patch | 160 ++++++ ...se-python-config-for-detection-FLAGS.patch | 133 +++++ ...e-new-convention-for-python-packages.patch | 71 +++ ...python-bindings-to-separate-packages.patch | 83 +++ ...ibility-to-build-python-2-3-bindings.patch | 532 ++++++++++++++++++ ...-tests-with-all-supported-python-ver.patch | 146 +++++ ...Replace-python_-macros-with-python2_.patch | 91 +++ ...hon3-bindings-on-available-platforms.patch | 378 +++++++++++++ sssd.spec | 15 + 16 files changed, 2029 insertions(+) create mode 100644 0001-BUILD-Remove-unused-libraries-for-pysss.so.patch create mode 100644 0002-BUILD-Remove-unused-variables.patch create mode 100644 0003-BUILD-Remove-detection-of-type-Py_ssize_t.patch create mode 100644 0004-UTIL-Remove-python-wrapper-sss_python_set_new.patch create mode 100644 0005-UTIL-Remove-python-wrapper-sss_python_set_add.patch create mode 100644 0006-UTIL-Remove-python-wrapper-sss_python_set_check.patch create mode 100644 0007-UTIL-Remove-compatibility-macro-PyModule_AddIntMacro.patch create mode 100644 0008-UTIL-Remove-python-wrapper-sss_python_unicode_from_s.patch create mode 100644 0009-BUILD-Use-python-config-for-detection-FLAGS.patch create mode 100644 0010-SPEC-Use-new-convention-for-python-packages.patch create mode 100644 0011-SPEC-Move-python-bindings-to-separate-packages.patch create mode 100644 0012-BUILD-Add-possibility-to-build-python-2-3-bindings.patch create mode 100644 0013-TESTS-Run-python-tests-with-all-supported-python-ver.patch create mode 100644 0014-SPEC-Replace-python_-macros-with-python2_.patch create mode 100644 0015-SPEC-Build-python3-bindings-on-available-platforms.patch diff --git a/0001-BUILD-Remove-unused-libraries-for-pysss.so.patch b/0001-BUILD-Remove-unused-libraries-for-pysss.so.patch new file mode 100644 index 0000000..a193e13 --- /dev/null +++ b/0001-BUILD-Remove-unused-libraries-for-pysss.so.patch @@ -0,0 +1,34 @@ +From 12098bc18511c9becb375302f29ab87b94352f43 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 17:40:07 +0100 +Subject: [PATCH 01/15] BUILD: Remove unused libraries for pysss.so + +Reviewed-by: Stephen Gallagher +--- + Makefile.am | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 29d148c4a0cbda6882b4a619d6c71d2efcc8fb43..176c193d97389f14da6f202fef46579b2e2a2e59 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -443,15 +443,9 @@ SSSD_LIBS = \ + + PYTHON_BINDINGS_LIBS = \ + $(TALLOC_LIBS) \ +- $(TEVENT_LIBS) \ + $(POPT_LIBS) \ + $(LDB_LIBS) \ +- $(DBUS_LIBS) \ +- $(PCRE_LIBS) \ +- $(DHASH_LIBS) \ +- $(SSS_CRYPT_LIBS) \ +- $(OPENLDAP_LIBS) \ +- $(TDB_LIBS) ++ $(NULL) + + TOOLS_LIBS = \ + $(LTLIBINTL) \ +-- +2.1.0 + diff --git a/0002-BUILD-Remove-unused-variables.patch b/0002-BUILD-Remove-unused-variables.patch new file mode 100644 index 0000000..ff4475d --- /dev/null +++ b/0002-BUILD-Remove-unused-variables.patch @@ -0,0 +1,26 @@ +From f8b0f5158332b5c8ae5828512e3fd5f1d64851a8 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 18:46:16 +0100 +Subject: [PATCH 02/15] BUILD: Remove unused variables + +Reviewed-by: Stephen Gallagher +--- + src/external/python.m4 | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/external/python.m4 b/src/external/python.m4 +index a1bd87a0ee3a56ddd25c4aba7687ffc7540b4ec2..241de9fd0e401c40f8136861e7c7070c8a50cddd 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -37,8 +37,6 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS], + AC_MSG_CHECKING(for headers required to compile python extensions) + + dnl deduce PYTHON_INCLUDES +- py_prefix=`$PYTHON -c "import sys; print(sys.prefix)"` +- py_exec_prefix=`$PYTHON -c "import sys; print(sys.exec_prefix)"` + PYTHON_INCLUDES=-I`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"` + + AC_SUBST(PYTHON_INCLUDES) +-- +2.1.0 + diff --git a/0003-BUILD-Remove-detection-of-type-Py_ssize_t.patch b/0003-BUILD-Remove-detection-of-type-Py_ssize_t.patch new file mode 100644 index 0000000..306116c --- /dev/null +++ b/0003-BUILD-Remove-detection-of-type-Py_ssize_t.patch @@ -0,0 +1,57 @@ +From d262610c969e0a3d8c3ad5a7deecc4d0519c6845 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 19:16:30 +0100 +Subject: [PATCH 03/15] BUILD: Remove detection of type Py_ssize_t + +The type Py_ssize_t is defined in python >= 2.6 + +Reviewed-by: Stephen Gallagher +--- + src/external/python.m4 | 5 ----- + src/util/sss_python.h | 14 -------------- + 2 files changed, 19 deletions(-) + +diff --git a/src/external/python.m4 b/src/external/python.m4 +index 241de9fd0e401c40f8136861e7c7070c8a50cddd..858af3c197603fcda100eddcffc396dad674a9e6 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -62,11 +62,6 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" + LIBS="$LIBS $PYTHON_LIBS" + +- AC_CHECK_TYPE(Py_ssize_t, +- [ AC_DEFINE_UNQUOTED(HAVE_PY_SSIZE_T, 1, [Native Py_ssize_t type]) ], +- [], +- [[#include ]]) +- + AC_CHECK_FUNCS([PySet_New PySet_Add PyErr_NewExceptionWithDoc]) + AC_CHECK_DECLS([PySet_Check, PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include ]]) + +diff --git a/src/util/sss_python.h b/src/util/sss_python.h +index 828bd22ec44fe9493bfaa246b072777b70c7b585..cf8c848482d82e0060cbfe748c05bd09c7492c4f 100644 +--- a/src/util/sss_python.h ++++ b/src/util/sss_python.h +@@ -25,20 +25,6 @@ + #define PYNUMBER_ASLONG(what) PyInt_AsLong(what) + #endif + +-/* Py_ssize_t compatibility for python < 2.5 as per +- * http://www.python.org/dev/peps/pep-0353/ */ +-#ifndef HAVE_PY_SSIZE_T +-typedef int Py_ssize_t; +-#endif +- +-#ifndef PY_SSIZE_T_MAX +-#define PY_SSIZE_T_MAX INT_MAX +-#endif +- +-#ifndef PY_SSIZE_T_MIN +-#define PY_SSIZE_T_MIN INT_MIN +-#endif +- + /* Wrappers providing the subset of C API for python's set objects we use */ + PyObject *sss_python_set_new(void); + int sss_python_set_add(PyObject *set, PyObject *key); +-- +2.1.0 + diff --git a/0004-UTIL-Remove-python-wrapper-sss_python_set_new.patch b/0004-UTIL-Remove-python-wrapper-sss_python_set_new.patch new file mode 100644 index 0000000..d55a643 --- /dev/null +++ b/0004-UTIL-Remove-python-wrapper-sss_python_set_new.patch @@ -0,0 +1,86 @@ +From 51308d75c1d128ca6ff90bb5a50aab7720781948 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 19:19:55 +0100 +Subject: [PATCH 04/15] UTIL: Remove python wrapper sss_python_set_new + +The function PySet_New is available in python >= 2.6 + +Reviewed-by: Stephen Gallagher +--- + src/external/python.m4 | 2 +- + src/python/pyhbac.c | 4 ++-- + src/util/sss_python.c | 10 ---------- + src/util/sss_python.h | 1 - + 4 files changed, 3 insertions(+), 14 deletions(-) + +diff --git a/src/external/python.m4 b/src/external/python.m4 +index 858af3c197603fcda100eddcffc396dad674a9e6..440d2f97740e43c31c9a530daecb7c5ded92a0dd 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -62,7 +62,7 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" + LIBS="$LIBS $PYTHON_LIBS" + +- AC_CHECK_FUNCS([PySet_New PySet_Add PyErr_NewExceptionWithDoc]) ++ AC_CHECK_FUNCS([PySet_Add PyErr_NewExceptionWithDoc]) + AC_CHECK_DECLS([PySet_Check, PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include ]]) + + CPPFLAGS="$save_CPPFLAGS" +diff --git a/src/python/pyhbac.c b/src/python/pyhbac.c +index c46f7c6b300df9eb82fa411673da3d77504080cd..58d906d138464c9f25e6b513ad41b985b510baa2 100644 +--- a/src/python/pyhbac.c ++++ b/src/python/pyhbac.c +@@ -303,7 +303,7 @@ HbacRuleElement_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + return NULL; + } + +- self->category = sss_python_set_new(); ++ self->category = PySet_New(NULL); + self->names = PyList_New(0); + self->groups = PyList_New(0); + if (!self->names || !self->groups || !self->category) { +@@ -945,7 +945,7 @@ py_hbac_rule_validate(HbacRuleObject *self, PyObject *args) + } + + py_is_valid = PyBool_FromLong(is_valid); +- py_missing = sss_python_set_new(); ++ py_missing = PySet_New(NULL); + if (!py_missing || !py_is_valid) { + PyErr_NoMemory(); + goto fail; +diff --git a/src/util/sss_python.c b/src/util/sss_python.c +index 19717a55c986b6831234addfbf91a529d652f592..dad2a46d86f4243fb4a2d1fad94e49f66db23f0c 100644 +--- a/src/util/sss_python.c ++++ b/src/util/sss_python.c +@@ -21,16 +21,6 @@ + #include "src/util/sss_python.h" + #include "config.h" + +-PyObject * +-sss_python_set_new(void) +-{ +-#ifdef HAVE_PYSET_NEW +- return PySet_New(NULL); +-#else +- return PyObject_CallObject((PyObject *) &PySet_Type, NULL); +-#endif +-} +- + int + sss_python_set_add(PyObject *set, PyObject *key) + { +diff --git a/src/util/sss_python.h b/src/util/sss_python.h +index cf8c848482d82e0060cbfe748c05bd09c7492c4f..6851a64e816ccf3bb84321bbeb9946ad2fbfbc41 100644 +--- a/src/util/sss_python.h ++++ b/src/util/sss_python.h +@@ -26,7 +26,6 @@ + #endif + + /* Wrappers providing the subset of C API for python's set objects we use */ +-PyObject *sss_python_set_new(void); + int sss_python_set_add(PyObject *set, PyObject *key); + bool sss_python_set_check(PyObject *set); + +-- +2.1.0 + diff --git a/0005-UTIL-Remove-python-wrapper-sss_python_set_add.patch b/0005-UTIL-Remove-python-wrapper-sss_python_set_add.patch new file mode 100644 index 0000000..ad8c001 --- /dev/null +++ b/0005-UTIL-Remove-python-wrapper-sss_python_set_add.patch @@ -0,0 +1,93 @@ +From a54cfca2362b2fb7a7b6ecc90881c3de6bb3556f Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 19:23:44 +0100 +Subject: [PATCH 05/15] UTIL: Remove python wrapper sss_python_set_add + +The function PySet_Add is available in python >= 2.6 + +Reviewed-by: Stephen Gallagher +--- + src/external/python.m4 | 2 +- + src/python/pyhbac.c | 4 ++-- + src/util/sss_python.c | 17 ----------------- + src/util/sss_python.h | 1 - + 4 files changed, 3 insertions(+), 21 deletions(-) + +diff --git a/src/external/python.m4 b/src/external/python.m4 +index 440d2f97740e43c31c9a530daecb7c5ded92a0dd..e3812a50406e7f6e2b2f143f3022ee07431ac120 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -62,7 +62,7 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" + LIBS="$LIBS $PYTHON_LIBS" + +- AC_CHECK_FUNCS([PySet_Add PyErr_NewExceptionWithDoc]) ++ AC_CHECK_FUNCS([PyErr_NewExceptionWithDoc]) + AC_CHECK_DECLS([PySet_Check, PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include ]]) + + CPPFLAGS="$save_CPPFLAGS" +diff --git a/src/python/pyhbac.c b/src/python/pyhbac.c +index 58d906d138464c9f25e6b513ad41b985b510baa2..11cd40656bbeaf93c2b1717483e716ba45a78a69 100644 +--- a/src/python/pyhbac.c ++++ b/src/python/pyhbac.c +@@ -388,7 +388,7 @@ HbacRuleElement_init(HbacRuleElement *self, PyObject *args, PyObject *kwargs) + return -1; + } + +- if (sss_python_set_add(self->category, tmp) != 0) { ++ if (PySet_Add(self->category, tmp) != 0) { + Py_DECREF(tmp); + return -1; + } +@@ -962,7 +962,7 @@ py_hbac_rule_validate(HbacRuleObject *self, PyObject *args) + goto fail; + } + +- if (sss_python_set_add(py_missing, py_attr) != 0) { ++ if (PySet_Add(py_missing, py_attr) != 0) { + /* If the set-add succeeded, it would steal the reference */ + Py_DECREF(py_attr); + goto fail; +diff --git a/src/util/sss_python.c b/src/util/sss_python.c +index dad2a46d86f4243fb4a2d1fad94e49f66db23f0c..56850782a64314db70286ef67d76ae1227d8625f 100644 +--- a/src/util/sss_python.c ++++ b/src/util/sss_python.c +@@ -21,23 +21,6 @@ + #include "src/util/sss_python.h" + #include "config.h" + +-int +-sss_python_set_add(PyObject *set, PyObject *key) +-{ +-#ifdef HAVE_PYSET_ADD +- return PySet_Add(set, key); +-#else +- PyObject *pyret; +- int ret; +- +- pyret = PyObject_CallMethod(set, sss_py_const_p(char, "add"), +- sss_py_const_p(char, "O"), key); +- ret = (pyret == NULL) ? -1 : 0; +- Py_XDECREF(pyret); +- return ret; +-#endif +-} +- + bool + sss_python_set_check(PyObject *set) + { +diff --git a/src/util/sss_python.h b/src/util/sss_python.h +index 6851a64e816ccf3bb84321bbeb9946ad2fbfbc41..1ff13c4ef4380ff791cf3cfbe12845fb26b3b873 100644 +--- a/src/util/sss_python.h ++++ b/src/util/sss_python.h +@@ -26,7 +26,6 @@ + #endif + + /* Wrappers providing the subset of C API for python's set objects we use */ +-int sss_python_set_add(PyObject *set, PyObject *key); + bool sss_python_set_check(PyObject *set); + + /* Unicode compatibility */ +-- +2.1.0 + diff --git a/0006-UTIL-Remove-python-wrapper-sss_python_set_check.patch b/0006-UTIL-Remove-python-wrapper-sss_python_set_check.patch new file mode 100644 index 0000000..0c7ef19 --- /dev/null +++ b/0006-UTIL-Remove-python-wrapper-sss_python_set_check.patch @@ -0,0 +1,79 @@ +From 6176976f2a895cca5eba9f714c6a6607f61aa8aa Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 19:30:39 +0100 +Subject: [PATCH 06/15] UTIL: Remove python wrapper sss_python_set_check + +The macro PySet_Check is defined in python >= 2.6 + +Reviewed-by: Stephen Gallagher +--- + src/external/python.m4 | 2 +- + src/python/pyhbac.c | 2 +- + src/util/sss_python.c | 10 ---------- + src/util/sss_python.h | 3 --- + 4 files changed, 2 insertions(+), 15 deletions(-) + +diff --git a/src/external/python.m4 b/src/external/python.m4 +index e3812a50406e7f6e2b2f143f3022ee07431ac120..e93f850092b0f54565e138b3235b9c29f89e5444 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -63,7 +63,7 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + LIBS="$LIBS $PYTHON_LIBS" + + AC_CHECK_FUNCS([PyErr_NewExceptionWithDoc]) +- AC_CHECK_DECLS([PySet_Check, PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include ]]) ++ AC_CHECK_DECLS([PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include ]]) + + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" +diff --git a/src/python/pyhbac.c b/src/python/pyhbac.c +index 11cd40656bbeaf93c2b1717483e716ba45a78a69..bbdf2b9fb75e2be0d46749faa6aaf0698a5d5ebb 100644 +--- a/src/python/pyhbac.c ++++ b/src/python/pyhbac.c +@@ -452,7 +452,7 @@ hbac_rule_element_set_category(HbacRuleElement *self, + + CHECK_ATTRIBUTE_DELETE(category, "category"); + +- if (!sss_python_set_check(category)) { ++ if (!PySet_Check(category)) { + PyErr_Format(PyExc_TypeError, "The category must be a set type\n"); + return -1; + } +diff --git a/src/util/sss_python.c b/src/util/sss_python.c +index 56850782a64314db70286ef67d76ae1227d8625f..ba78bf9689c903713229395a49e5f3686e5e6f10 100644 +--- a/src/util/sss_python.c ++++ b/src/util/sss_python.c +@@ -21,16 +21,6 @@ + #include "src/util/sss_python.h" + #include "config.h" + +-bool +-sss_python_set_check(PyObject *set) +-{ +-#if HAVE_DECL_PYSET_CHECK +- return PySet_Check(set); +-#else +- return PyObject_TypeCheck(set, &PySet_Type); +-#endif +-} +- + PyObject * + sss_python_unicode_from_string(const char *u) + { +diff --git a/src/util/sss_python.h b/src/util/sss_python.h +index 1ff13c4ef4380ff791cf3cfbe12845fb26b3b873..56c25ebb74bffc061688c3c32515d6e0288ac94d 100644 +--- a/src/util/sss_python.h ++++ b/src/util/sss_python.h +@@ -25,9 +25,6 @@ + #define PYNUMBER_ASLONG(what) PyInt_AsLong(what) + #endif + +-/* Wrappers providing the subset of C API for python's set objects we use */ +-bool sss_python_set_check(PyObject *set); +- + /* Unicode compatibility */ + PyObject *sss_python_unicode_from_string(const char *u); + +-- +2.1.0 + diff --git a/0007-UTIL-Remove-compatibility-macro-PyModule_AddIntMacro.patch b/0007-UTIL-Remove-compatibility-macro-PyModule_AddIntMacro.patch new file mode 100644 index 0000000..0dc2c88 --- /dev/null +++ b/0007-UTIL-Remove-compatibility-macro-PyModule_AddIntMacro.patch @@ -0,0 +1,45 @@ +From fb70347a6f68cb7cde82c0d31b66b192b7404a03 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 19:33:44 +0100 +Subject: [PATCH 07/15] UTIL: Remove compatibility macro PyModule_AddIntMacro + +The macro PyModule_AddIntMacro is defined in python >= 2.6 + +Reviewed-by: Stephen Gallagher +--- + src/external/python.m4 | 2 +- + src/util/sss_python.h | 5 ----- + 2 files changed, 1 insertion(+), 6 deletions(-) + +diff --git a/src/external/python.m4 b/src/external/python.m4 +index e93f850092b0f54565e138b3235b9c29f89e5444..ac427268d4ff8828314cefb43ce2af72d34bc295 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -63,7 +63,7 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + LIBS="$LIBS $PYTHON_LIBS" + + AC_CHECK_FUNCS([PyErr_NewExceptionWithDoc]) +- AC_CHECK_DECLS([PyModule_AddIntMacro, PyUnicode_FromString], [], [], [[#include ]]) ++ AC_CHECK_DECLS([PyUnicode_FromString], [], [], [[#include ]]) + + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" +diff --git a/src/util/sss_python.h b/src/util/sss_python.h +index 56c25ebb74bffc061688c3c32515d6e0288ac94d..5521aa5cfd84acffc65edbe76a264b1f2a52e9fd 100644 +--- a/src/util/sss_python.h ++++ b/src/util/sss_python.h +@@ -32,11 +32,6 @@ PyObject *sss_python_unicode_from_string(const char *u); + PyObject * + sss_exception_with_doc(char *name, char *doc, PyObject *base, PyObject *dict); + +-/* PyModule_AddIntMacro() compatibility */ +-#if !HAVE_DECL_PYMODULE_ADDINTMACRO +-#define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, sss_py_const_p(char, #c), c) +-#endif +- + /* Convenience macros */ + #define TYPE_READY(module, type, name) do { \ + if (PyType_Ready(&type) < 0) \ +-- +2.1.0 + diff --git a/0008-UTIL-Remove-python-wrapper-sss_python_unicode_from_s.patch b/0008-UTIL-Remove-python-wrapper-sss_python_unicode_from_s.patch new file mode 100644 index 0000000..20cb64d --- /dev/null +++ b/0008-UTIL-Remove-python-wrapper-sss_python_unicode_from_s.patch @@ -0,0 +1,160 @@ +From 65b439f58285de44c7dcd4a03e0f32a2fb247d82 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 9 Feb 2015 19:38:42 +0100 +Subject: [PATCH 08/15] UTIL: Remove python wrapper + sss_python_unicode_from_string + +The function PyUnicode_FromString is available in python >= 2.6 + +Reviewed-by: Stephen Gallagher +--- + src/external/python.m4 | 3 +-- + src/python/pyhbac.c | 18 +++++++++--------- + src/util/sss_python.c | 10 ---------- + src/util/sss_python.h | 3 --- + 4 files changed, 10 insertions(+), 24 deletions(-) + +diff --git a/src/external/python.m4 b/src/external/python.m4 +index ac427268d4ff8828314cefb43ce2af72d34bc295..d59233aa01ac591cfc86be974d8ae26ebbe4635d 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -54,7 +54,7 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS], + + + dnl Checks for a couple of functions we use that may not be defined +-dnl in some older python versions used e.g. on RHEL5 ++dnl in some older python (< 2.6) versions used e.g. on RHEL6 + AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + [AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) + save_CPPFLAGS="$CPPFLAGS" +@@ -63,7 +63,6 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + LIBS="$LIBS $PYTHON_LIBS" + + AC_CHECK_FUNCS([PyErr_NewExceptionWithDoc]) +- AC_CHECK_DECLS([PyUnicode_FromString], [], [], [[#include ]]) + + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" +diff --git a/src/python/pyhbac.c b/src/python/pyhbac.c +index bbdf2b9fb75e2be0d46749faa6aaf0698a5d5ebb..2ccff6856b5bb5fbbb4803633ae549481ebb6035 100644 +--- a/src/python/pyhbac.c ++++ b/src/python/pyhbac.c +@@ -493,7 +493,7 @@ HbacRuleElement_repr(HbacRuleElement *self) + uint32_t category; + PyObject *o, *format, *args; + +- format = sss_python_unicode_from_string(""); ++ format = PyUnicode_FromString(""); + if (format == NULL) { + return NULL; + } +@@ -651,7 +651,7 @@ HbacRule_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + return NULL; + } + +- self->name = sss_python_unicode_from_string(""); ++ self->name = PyUnicode_FromString(""); + if (self->name == NULL) { + Py_DECREF(self); + PyErr_NoMemory(); +@@ -869,7 +869,7 @@ HbacRule_repr(HbacRuleObject *self) + PyObject *srchosts_repr; + PyObject *o, *format, *args; + +- format = sss_python_unicode_from_string(""); + if (format == NULL) { +@@ -1149,7 +1149,7 @@ HbacRequestElement_new(PyTypeObject *type, PyObject *args, PyObject *kwds) + return NULL; + } + +- self->name = sss_python_unicode_from_string(""); ++ self->name = PyUnicode_FromString(""); + if (self->name == NULL) { + PyErr_NoMemory(); + Py_DECREF(self); +@@ -1291,7 +1291,7 @@ HbacRequestElement_repr(HbacRequestElement *self) + char *strgroups; + PyObject *o, *format, *args; + +- format = sss_python_unicode_from_string(""); ++ format = PyUnicode_FromString(""); + if (format == NULL) { + return NULL; + } +@@ -1609,7 +1609,7 @@ py_hbac_evaluate(HbacRequest *self, PyObject *args) + eres = hbac_evaluate(rules, hbac_req, &info); + switch (eres) { + case HBAC_EVAL_ALLOW: +- self->rule_name = sss_python_unicode_from_string(info->rule_name); ++ self->rule_name = PyUnicode_FromString(info->rule_name); + if (!self->rule_name) { + PyErr_NoMemory(); + goto fail; +@@ -1662,7 +1662,7 @@ HbacRequest_repr(HbacRequest *self) + PyObject *srchost_repr; + PyObject *o, *format, *args; + +- format = sss_python_unicode_from_string(""); + if (format == NULL) { + return NULL; +@@ -1853,7 +1853,7 @@ py_hbac_result_string(PyObject *module, PyObject *args) + return Py_None; + } + +- return sss_python_unicode_from_string(str); ++ return PyUnicode_FromString(str); + } + + PyDoc_STRVAR(py_hbac_error_string__doc__, +@@ -1877,7 +1877,7 @@ py_hbac_error_string(PyObject *module, PyObject *args) + return Py_None; + } + +- return sss_python_unicode_from_string(str); ++ return PyUnicode_FromString(str); + } + + static PyMethodDef pyhbac_module_methods[] = { +diff --git a/src/util/sss_python.c b/src/util/sss_python.c +index ba78bf9689c903713229395a49e5f3686e5e6f10..560effc26d474bdb367784083cb354bb57ead412 100644 +--- a/src/util/sss_python.c ++++ b/src/util/sss_python.c +@@ -22,16 +22,6 @@ + #include "config.h" + + PyObject * +-sss_python_unicode_from_string(const char *u) +-{ +-#ifdef HAVE_PYUNICODE_FROMSTRING +- return PyUnicode_FromString(u); +-#else +- return PyUnicode_DecodeUTF8(u, strlen(u), NULL); +-#endif +-} +- +-PyObject * + sss_exception_with_doc(char *name, char *doc, PyObject *base, PyObject *dict) + { + #ifdef HAVE_PYERR_NEWEXCEPTIONWITHDOC +diff --git a/src/util/sss_python.h b/src/util/sss_python.h +index 5521aa5cfd84acffc65edbe76a264b1f2a52e9fd..7e2bac33656dcbac91bb4f4d32ec9fbc44bb4e52 100644 +--- a/src/util/sss_python.h ++++ b/src/util/sss_python.h +@@ -25,9 +25,6 @@ + #define PYNUMBER_ASLONG(what) PyInt_AsLong(what) + #endif + +-/* Unicode compatibility */ +-PyObject *sss_python_unicode_from_string(const char *u); +- + /* Exceptions compatibility */ + PyObject * + sss_exception_with_doc(char *name, char *doc, PyObject *base, PyObject *dict); +-- +2.1.0 + diff --git a/0009-BUILD-Use-python-config-for-detection-FLAGS.patch b/0009-BUILD-Use-python-config-for-detection-FLAGS.patch new file mode 100644 index 0000000..8320e21 --- /dev/null +++ b/0009-BUILD-Use-python-config-for-detection-FLAGS.patch @@ -0,0 +1,133 @@ +From daeaf3b5d3bd3877f1a5b8cc60f0cf401d09e31f Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Tue, 10 Feb 2015 16:14:59 +0100 +Subject: [PATCH 09/15] BUILD: Use python-config for detection *FLAGS + +The script python-config was not available in older versions of python. +This patch simplify detection of python CFLAGS and LDFLAGS and increase +minimal required version of python to 2.6 + +Reviewed-by: Stephen Gallagher +--- + configure.ac | 6 +++-- + src/external/python.m4 | 63 +++++++++++++++++++++++++------------------------- + 2 files changed, 36 insertions(+), 33 deletions(-) + +diff --git a/configure.ac b/configure.ac +index cdbe6f9bff3822bb80d8d43b593e02c39d729f64..f72e448528edcffb855504a38a179c400f98ac42 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -248,11 +248,13 @@ AM_CONDITIONAL([HAVE_MANPAGES], [test "x$HAVE_MANPAGES" != "x"]) + AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"]) + + if test x$HAVE_PYTHON_BINDINGS != x; then +- AM_PATH_PYTHON([2.4]) ++ AM_PATH_PYTHON([2.6]) ++ AM_PYTHON_CONFIG([python]) + AM_CHECK_PYTHON_HEADERS([], + AC_MSG_ERROR([Could not find python headers])) +- AM_PYTHON_CONFIG + AM_CHECK_PYTHON_COMPAT ++ AC_SUBST([PYTHON_CFLAGS]) ++ AC_SUBST([PYTHON_LIBS]) + fi + + if test x$HAVE_SELINUX != x; then +diff --git a/src/external/python.m4 b/src/external/python.m4 +index d59233aa01ac591cfc86be974d8ae26ebbe4635d..c91e8df17b0371538f02bfeb9cade1ce639074bd 100644 +--- a/src/external/python.m4 ++++ b/src/external/python.m4 +@@ -1,46 +1,33 @@ + dnl Check for python-config and substitute needed CFLAGS and LDFLAGS + dnl Usage: +-dnl AM_PYTHON_CONFIG ++dnl AM_PYTHON_CONFIG(python_with_major_version) ++dnl argument python_with_major_version should be either python2 or python3 ++dnl This function sets the PYTHON_CFLAGS, PYTHON_LIBS and PYTHON_INCLUDES ++dnl variables + + AC_DEFUN([AM_PYTHON_CONFIG], +-[ AC_SUBST(PYTHON_CFLAGS) +- AC_SUBST(PYTHON_LIBS) ++[ ++ AC_PATH_PROG([PYTHON_CONFIG], [python$PYTHON_VERSION-config]) ++ AS_IF([test x"$PYTHON_CONFIG" = x], ++ AC_MSG_ERROR([ ++The program python$PYTHON_VERSION-config was not found in search path. ++Please ensure that it is installed and its directory is included in the search ++path. If you want to build sssd without $1 bindings then specify ++--without-$1-bindings when running configure.])) + +-dnl We need to check for python build flags using distutils.sysconfig +-dnl We cannot use python-config, as it was not available on older +-dnl versions of python +- AC_PATH_PROG(PYTHON, python) +- AC_MSG_CHECKING([for working python]) +- if test -x "$PYTHON"; then +- PYTHON_CFLAGS="`$PYTHON -c \"from distutils import sysconfig; \ +- print('-I' + sysconfig.get_python_inc() + \ +- ' -I' + sysconfig.get_python_inc(plat_specific=True) + ' ' + \ +- sysconfig.get_config_var('BASECFLAGS'))\"`" +- PYTHON_LIBS="`$PYTHON -c \"from distutils import sysconfig; \ +- print(' '.join(sysconfig.get_config_var('LIBS').split() + \ +- sysconfig.get_config_var('SYSLIBS').split()) + \ +- ' ' + sysconfig.get_config_var('BLDLIBRARY') + ' ' + \ +- ' -L' + sysconfig.get_config_var('LIBDIR'))\"`" +- AC_MSG_RESULT([yes]) +- else +- AC_MSG_RESULT([no]) +- AC_MSG_ERROR([Please install python devel package]) +- fi ++ PYTHON_CFLAGS="` $PYTHON_CONFIG --cflags`" ++ PYTHON_LIBS="` $PYTHON_CONFIG --libs`" ++ PYTHON_INCLUDES="` $PYTHON_CONFIG --includes`" + ]) + + dnl Taken from GNOME sources + dnl a macro to check for ability to create python extensions + dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) +-dnl function also defines PYTHON_INCLUDES + AC_DEFUN([AM_CHECK_PYTHON_HEADERS], +-[AC_REQUIRE([AM_PATH_PYTHON]) ++[ ++ AC_REQUIRE([AM_PATH_PYTHON]) + AC_MSG_CHECKING(for headers required to compile python extensions) + +- dnl deduce PYTHON_INCLUDES +- PYTHON_INCLUDES=-I`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'))"` +- +- AC_SUBST(PYTHON_INCLUDES) +- + dnl check if the headers exist: + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +@@ -56,7 +43,8 @@ AC_DEFUN([AM_CHECK_PYTHON_HEADERS], + dnl Checks for a couple of functions we use that may not be defined + dnl in some older python (< 2.6) versions used e.g. on RHEL6 + AC_DEFUN([AM_CHECK_PYTHON_COMPAT], +-[AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) ++[ ++ AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" +@@ -67,3 +55,16 @@ AC_DEFUN([AM_CHECK_PYTHON_COMPAT], + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" + ]) ++ ++dnl Clean variables after detection of python ++AC_DEFUN([SSS_CLEAN_PYTHON_VARIABLES], ++[ ++ unset pyexecdir pkgpyexecdir pythondir pgkpythondir ++ unset PYTHON PYTHON_CFLAGS PYTHON_LIBS PYTHON_INCLUDES ++ unset PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_VERSION PYTHON_CONFIG ++ ++ dnl removed cached variables, required for reusing of AM_PATH_PYTHON ++ unset am_cv_pathless_PYTHON ac_cv_path_PYTHON am_cv_python_version ++ unset am_cv_python_platform am_cv_python_pythondir am_cv_python_pyexecdir ++ unset ac_cv_path_PYTHON_CONFIG ++]) +-- +2.1.0 + diff --git a/0010-SPEC-Use-new-convention-for-python-packages.patch b/0010-SPEC-Use-new-convention-for-python-packages.patch new file mode 100644 index 0000000..750fb18 --- /dev/null +++ b/0010-SPEC-Use-new-convention-for-python-packages.patch @@ -0,0 +1,71 @@ +From 0bb5eeeedf08dcd6b49e24d3480f2bc5b09c38b0 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Tue, 10 Feb 2015 16:33:04 +0100 +Subject: [PATCH 10/15] SPEC: Use new convention for python packages + +Reviewed-by: Stephen Gallagher +--- + contrib/sssd.spec.in | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in +index bea68f1bbceac232f4ca019111b6262dca3380eb..fc87ff2c9a2012683bb0c989c992b8706851148a 100644 +--- a/contrib/sssd.spec.in ++++ b/contrib/sssd.spec.in +@@ -339,14 +339,16 @@ Requires: libipa_hbac = %{version}-%{release} + %description -n libipa_hbac-devel + Utility library to validate FreeIPA HBAC rules for authorization requests + +-%package -n libipa_hbac-python ++%package -n python-libipa_hbac + Summary: Python bindings for the FreeIPA HBAC Evaluator library + Group: Development/Libraries + License: LGPLv3+ + Requires: libipa_hbac = %{version}-%{release} ++Provides: libipa_hbac-python = %{version}-%{release} ++Obsoletes: libipa_hbac-python < 1.12.90 + +-%description -n libipa_hbac-python +-The libipa_hbac-python contains the bindings so that libipa_hbac can be ++%description -n python-libipa_hbac ++The python-libipa_hbac contains the bindings so that libipa_hbac can be + used by Python applications. + + %package -n libsss_nss_idmap +@@ -368,14 +370,16 @@ Requires: libsss_nss_idmap = %{version}-%{release} + %description -n libsss_nss_idmap-devel + Utility library for SID based lookups + +-%package -n libsss_nss_idmap-python ++%package -n python-libsss_nss_idmap + Summary: Python bindings for libsss_nss_idmap + Group: Development/Libraries + License: LGPLv3+ + Requires: libsss_nss_idmap = %{version}-%{release} ++Provides: libsss_nss_idmap-python = %{version}-%{release} ++Obsoletes: libsss_nss_idmap-python < 1.12.90 + +-%description -n libsss_nss_idmap-python +-The libsss_nss_idmap-python contains the bindings so that libsss_nss_idmap can ++%description -n python-libsss_nss_idmap ++The python-libsss_nss_idmap contains the bindings so that libsss_nss_idmap can + be used by Python applications. + + %package dbus +@@ -787,11 +791,11 @@ rm -rf $RPM_BUILD_ROOT + %{_libdir}/libsss_nss_idmap.so + %{_libdir}/pkgconfig/sss_nss_idmap.pc + +-%files -n libsss_nss_idmap-python ++%files -n python-libsss_nss_idmap + %defattr(-,root,root,-) + %{python_sitearch}/pysss_nss_idmap.so + +-%files -n libipa_hbac-python ++%files -n python-libipa_hbac + %defattr(-,root,root,-) + %{python_sitearch}/pyhbac.so + +-- +2.1.0 + diff --git a/0011-SPEC-Move-python-bindings-to-separate-packages.patch b/0011-SPEC-Move-python-bindings-to-separate-packages.patch new file mode 100644 index 0000000..283cc91 --- /dev/null +++ b/0011-SPEC-Move-python-bindings-to-separate-packages.patch @@ -0,0 +1,83 @@ +From 79ff61df76fdf77a5942bc555e9dc584192eebe0 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Tue, 10 Feb 2015 16:50:12 +0100 +Subject: [PATCH 11/15] SPEC: Move python bindings to separate packages + +Some pyhton bindings pysss and pysss_murmur was in package sssd-common. +Therefore package sssd-common had python as a dependency. + +Reviewed-by: Stephen Gallagher +--- + contrib/sssd.spec.in | 35 +++++++++++++++++++++++++++++++++-- + 1 file changed, 33 insertions(+), 2 deletions(-) + +diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in +index fc87ff2c9a2012683bb0c989c992b8706851148a..6d6f0b9294e2150549f36c64a11ace64be8a83cc 100644 +--- a/contrib/sssd.spec.in ++++ b/contrib/sssd.spec.in +@@ -196,6 +196,9 @@ Summary: Userspace tools for use with the SSSD + Group: Applications/System + License: GPLv3+ + Requires: sssd-common = %{version}-%{release} ++# required by sss_obfuscate ++Requires: python-sss = %{version}-%{release} ++Requires: python-sssdconfig = %{version}-%{release} + + %description tools + Provides userspace tools for manipulating users, groups, and nested groups in +@@ -215,6 +218,28 @@ BuildArch: noarch + %description -n python-sssdconfig + Provides python files for manipulation SSSD and IPA configuration files. + ++%package -n python-sss ++Summary: Python bindings for sssd ++Group: Development/Libraries ++License: LGPLv3+ ++Requires: sssd-common = %{version}-%{release} ++ ++%description -n python-sss ++Provides python module for manipulating users, groups, and nested groups in ++SSSD when using id_provider = local in /etc/sssd/sssd.conf. ++ ++Also provides several other useful python bindings: ++ * function for retrieving list of groups user belongs to. ++ * class for obfuscation of passwords ++ ++%package -n python-sss-murmur ++Summary: Python bindings for murmur hash function ++Group: Development/Libraries ++License: LGPLv3+ ++ ++%description -n python-sss-murmur ++Provides python module for calculating the murmur hash version 3 ++ + %package ldap + Summary: The LDAP back end of the SSSD + Group: Applications/System +@@ -637,8 +662,6 @@ rm -rf $RPM_BUILD_ROOT + %{_mandir}/man8/sss_cache.8* + %{_mandir}/man1/sss_ssh_authorizedkeys.1* + %{_mandir}/man1/sss_ssh_knownhostsproxy.1* +-%{python_sitearch}/pysss.so +-%{python_sitearch}/pysss_murmur.so + + %files ldap -f sssd_ldap.lang + %defattr(-,root,root,-) +@@ -755,6 +778,14 @@ rm -rf $RPM_BUILD_ROOT + %dir %{python_sitelib}/SSSDConfig + %{python_sitelib}/SSSDConfig/*.py* + ++%files -n python-sss ++%defattr(-,root,root,-) ++%{python_sitearch}/pysss.so ++ ++%files -n python-sss-murmur ++%defattr(-,root,root,-) ++%{python_sitearch}/pysss_murmur.so ++ + %files -n libsss_idmap + %defattr(-,root,root,-) + %doc src/sss_client/COPYING src/sss_client/COPYING.LESSER +-- +2.1.0 + diff --git a/0012-BUILD-Add-possibility-to-build-python-2-3-bindings.patch b/0012-BUILD-Add-possibility-to-build-python-2-3-bindings.patch new file mode 100644 index 0000000..31d96f2 --- /dev/null +++ b/0012-BUILD-Add-possibility-to-build-python-2-3-bindings.patch @@ -0,0 +1,532 @@ +From a80ec6ff2bdb9367ac7d5c50c3ab7d83877bd7bb Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Tue, 10 Feb 2015 17:22:03 +0100 +Subject: [PATCH 12/15] BUILD: Add possibility to build python{2,3} bindings + +Resolves: +https://fedorahosted.org/sssd/ticket/2574 + +Reviewed-by: Stephen Gallagher +--- + Makefile.am | 196 ++++++++++++++++++++++++++++++++--------- + configure.ac | 49 +++++++++-- + contrib/sssd.spec.in | 4 + + src/conf_macros.m4 | 39 +++++--- + src/tests/pyhbac-test.py | 22 ++++- + src/tests/pysss_murmur-test.py | 22 ++++- + 6 files changed, 267 insertions(+), 65 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 176c193d97389f14da6f202fef46579b2e2a2e59..14ee3dd528f0d89b3e0d2afdb99313e6c570234f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -299,12 +299,22 @@ noinst_LTLIBRARIES = + + pkglib_LTLIBRARIES = + +-if BUILD_PYTHON_BINDINGS +-pyexec_LTLIBRARIES = \ +- pysss.la \ +- pyhbac.la \ +- pysss_murmur.la \ +- pysss_nss_idmap.la ++if BUILD_PYTHON2_BINDINGS ++py2exec_LTLIBRARIES = \ ++ _py2sss.la \ ++ _py2hbac.la \ ++ _py2sss_murmur.la \ ++ _py2sss_nss_idmap.la \ ++ $(NULL) ++endif ++ ++if BUILD_PYTHON3_BINDINGS ++py3exec_LTLIBRARIES = \ ++ _py3sss.la \ ++ _py3hbac.la \ ++ _py3sss_murmur.la \ ++ _py3sss_nss_idmap.la \ ++ $(NULL) + endif + + dist_noinst_SCRIPTS = \ +@@ -2782,58 +2792,109 @@ sssd_pac_plugin_la_LDFLAGS = \ + -avoid-version \ + -module + +-if BUILD_PYTHON_BINDINGS ++# python[23] bindings + pysss_la_SOURCES = \ + $(SSSD_TOOLS_OBJ) \ + src/python/pysss.c +-pysss_la_CFLAGS = \ +- $(AM_CFLAGS) \ +- $(PYTHON_CFLAGS) +-pysss_la_LIBADD = \ +- $(SSSD_INTERNAL_LTLIBS) \ +- $(PYTHON_BINDINGS_LIBS) \ +- $(PYTHON_LIBS) + pysss_la_LDFLAGS = \ + -avoid-version \ + -module + ++_py2sss_la_SOURCES = $(pysss_la_SOURCES) ++_py2sss_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON2_CFLAGS) ++_py2sss_la_LIBADD = \ ++ $(SSSD_INTERNAL_LTLIBS) \ ++ $(PYTHON_BINDINGS_LIBS) \ ++ $(PYTHON2_LIBS) ++_py2sss_la_LDFLAGS = $(pysss_la_LDFLAGS) ++ ++_py3sss_la_SOURCES = $(pysss_la_SOURCES) ++_py3sss_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON3_CFLAGS) ++_py3sss_la_LIBADD = \ ++ $(SSSD_INTERNAL_LTLIBS) \ ++ $(PYTHON_BINDINGS_LIBS) \ ++ $(PYTHON3_LIBS) ++_py3sss_la_LDFLAGS = $(pysss_la_LDFLAGS) ++ ++ + pyhbac_la_SOURCES = \ + src/python/pyhbac.c \ + src/util/sss_python.c +-pyhbac_la_CFLAGS = \ +- $(AM_CFLAGS) \ +- $(PYTHON_CFLAGS) +-pyhbac_la_LIBADD = \ +- $(PYTHON_LIBS) \ +- libipa_hbac.la + pyhbac_la_LDFLAGS = \ + -avoid-version \ + -module + ++_py2hbac_la_SOURCES = $(pyhbac_la_SOURCES) ++_py2hbac_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON2_CFLAGS) ++_py2hbac_la_LIBADD = \ ++ $(PYTHON2_LIBS) \ ++ libipa_hbac.la ++_py2hbac_la_LDFLAGS = $(pyhbac_la_LDFLAGS) ++ ++_py3hbac_la_SOURCES = $(pyhbac_la_SOURCES) ++_py3hbac_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON3_CFLAGS) ++_py3hbac_la_LIBADD = \ ++ $(PYTHON3_LIBS) \ ++ libipa_hbac.la ++_py3hbac_la_LDFLAGS = $(pyhbac_la_LDFLAGS) ++ ++ + pysss_murmur_la_SOURCES = \ + src/python/pysss_murmur.c \ + src/util/murmurhash3.c +-pysss_murmur_la_CFLAGS = \ +- $(AM_CFLAGS) \ +- $(PYTHON_CFLAGS) +-pysss_murmur_la_LIBADD = \ +- $(PYTHON_LIBS) + pysss_murmur_la_LDFLAGS = \ + -avoid-version \ + -module + ++_py2sss_murmur_la_SOURCES = $(pysss_murmur_la_SOURCES) ++_py2sss_murmur_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON2_CFLAGS) ++_py2sss_murmur_la_LIBADD = \ ++ $(PYTHON2_LIBS) ++_py2sss_murmur_la_LDFLAGS = $(pysss_murmur_la_LDFLAGS) ++ ++_py3sss_murmur_la_SOURCES = $(pysss_murmur_la_SOURCES) ++_py3sss_murmur_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON3_CFLAGS) ++_py3sss_murmur_la_LIBADD = \ ++ $(PYTHON3_LIBS) ++_py3sss_murmur_la_LDFLAGS = $(pysss_murmur_la_LDFLAGS) ++ ++ + pysss_nss_idmap_la_SOURCES = \ + src/python/pysss_nss_idmap.c +-pysss_nss_idmap_la_CFLAGS = \ +- $(AM_CFLAGS) \ +- $(PYTHON_CFLAGS) +-pysss_nss_idmap_la_LIBADD = \ +- $(PYTHON_LIBS) \ +- libsss_nss_idmap.la + pysss_nss_idmap_la_LDFLAGS = \ + -avoid-version \ + -module +-endif ++ ++_py2sss_nss_idmap_la_SOURCES = $(pysss_nss_idmap_la_SOURCES) ++_py2sss_nss_idmap_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON2_CFLAGS) ++_py2sss_nss_idmap_la_LIBADD = \ ++ $(PYTHON2_LIBS) \ ++ libsss_nss_idmap.la ++_py2sss_nss_idmap_la_LDFLAGS = $(pysss_nss_idmap_la_LDFLAGS) ++ ++_py3sss_nss_idmap_la_SOURCES = $(pysss_nss_idmap_la_SOURCES) ++_py3sss_nss_idmap_la_CFLAGS = \ ++ $(AM_CFLAGS) \ ++ $(PYTHON3_CFLAGS) ++_py3sss_nss_idmap_la_LIBADD = \ ++ $(PYTHON3_LIBS) \ ++ libsss_nss_idmap.la ++_py3sss_nss_idmap_la_LDFLAGS = $(pysss_nss_idmap_la_LDFLAGS) ++# end of python[23] bindings + + if BUILD_CIFS_IDMAP_PLUGIN + cifs_idmap_sss_la_SOURCES = \ +@@ -2995,17 +3056,51 @@ SSSSCONFIG_MODULES = + endif + + all-local: ldb_mod_test_dir $(SSSDCONFIG_MODULES) +-if BUILD_PYTHON_BINDINGS +- cd $(builddir)/src/config; $(PYTHON) setup.py build --build-base $(abs_builddir)/src/config ++if BUILD_PYTHON2_BINDINGS ++ cd $(builddir)/src/config; \ ++ $(PYTHON2) setup.py build --build-base $(abs_builddir)/src/config ++endif ++if BUILD_PYTHON3_BINDINGS ++ cd $(builddir)/src/config; \ ++ $(PYTHON3) setup.py build --build-base $(abs_builddir)/src/config + endif + + install-exec-hook: installsssddirs +-if BUILD_PYTHON_BINDINGS ++if BUILD_PYTHON2_BINDINGS + if [ "$(DESTDIR)" = "" ]; then \ +- cd $(builddir)/src/config; $(PYTHON) setup.py build --build-base $(abs_builddir)/src/config install $(DISTSETUPOPTS) --prefix=$(PYTHON_PREFIX) --record=$(abs_builddir)/src/config/.files; \ ++ cd $(builddir)/src/config; \ ++ $(PYTHON2) setup.py build --build-base $(abs_builddir)/src/config \ ++ install $(DISTSETUPOPTS) --prefix=$(PYTHON2_PREFIX) \ ++ --record=$(abs_builddir)/src/config/.files2; \ + else \ +- cd $(builddir)/src/config; $(PYTHON) setup.py build --build-base $(abs_builddir)/src/config install $(DISTSETUPOPTS) --prefix=$(PYTHON_PREFIX) --root=$(DESTDIR) --record=$(abs_builddir)/src/config/.files; \ ++ cd $(builddir)/src/config; \ ++ $(PYTHON2) setup.py build --build-base $(abs_builddir)/src/config \ ++ install $(DISTSETUPOPTS) --prefix=$(PYTHON2_PREFIX) \ ++ --record=$(abs_builddir)/src/config/.files2 --root=$(DESTDIR); \ + fi ++ cd $(DESTDIR)$(py2execdir) && \ ++ $(LN_S) _py2sss.so pysss.so ; \ ++ $(LN_S) _py2hbac.so pyhbac.so ; \ ++ $(LN_S) _py2sss_murmur.so pysss_murmur.so ; \ ++ $(LN_S) _py2sss_nss_idmap.so pysss_nss_idmap.so ++endif ++if BUILD_PYTHON3_BINDINGS ++ if [ "$(DESTDIR)" = "" ]; then \ ++ cd $(builddir)/src/config; \ ++ $(PYTHON3) setup.py build --build-base $(abs_builddir)/src/config \ ++ install $(DISTSETUPOPTS) --prefix=$(PYTHON3_PREFIX) \ ++ --record=$(abs_builddir)/src/config/.files3; \ ++ else \ ++ cd $(builddir)/src/config; \ ++ $(PYTHON3) setup.py build --build-base $(abs_builddir)/src/config \ ++ install $(DISTSETUPOPTS) --prefix=$(PYTHON3_PREFIX) \ ++ --record=$(abs_builddir)/src/config/.files3 --root=$(DESTDIR); \ ++ fi ++ cd $(DESTDIR)$(py3execdir) && \ ++ $(LN_S) _py3sss.so pysss.so ; \ ++ $(LN_S) _py3hbac.so pyhbac.so ; \ ++ $(LN_S) _py3sss_murmur.so pysss_murmur.so ; \ ++ $(LN_S) _py3sss_nss_idmap.so pysss_nss_idmap.so + endif + for doc in $(SSSD_DOCS); do \ + $(MKDIR_P) $$doc $(DESTDIR)/$(docdir); \ +@@ -3039,16 +3134,20 @@ install-data-hook: + fi + + uninstall-hook: +- if [ -f $(abs_builddir)/src/config/.files ]; then \ +- cat $(abs_builddir)/src/config/.files | xargs -iq rm -f $(DESTDIR)/q; \ +- rm $(abs_builddir)/src/config/.files ; \ ++ if [ -f $(abs_builddir)/src/config/.files2 ]; then \ ++ cat $(abs_builddir)/src/config/.files2 | xargs -iq rm -f $(DESTDIR)/q; \ ++ rm $(abs_builddir)/src/config/.files2 ; \ ++ fi ++ if [ -f $(abs_builddir)/src/config/.files3 ]; then \ ++ cat $(abs_builddir)/src/config/.files3 | xargs -iq rm -f $(DESTDIR)/q; \ ++ rm $(abs_builddir)/src/config/.files3 ; \ + fi + for doc in $(SSSD_DOCS); do \ + rm -Rf $(DESTDIR)/$(docdir)/$$doc; \ + done; + + clean-local: +-if BUILD_PYTHON_BINDINGS ++if BUILD_PYTHON2_BINDINGS + if [ ! $(srcdir)/src/config/SSSDConfig/ipachangeconf.py -ef $(builddir)/src/config/SSSDConfig/ipachangeconf.py ]; then \ + rm -f $(builddir)/src/config/SSSDConfig/ipachangeconf.py ; \ + fi +@@ -3059,7 +3158,20 @@ if BUILD_PYTHON_BINDINGS + + rm -f $(builddir)/src/config/SSSDConfig/*.pyc + +- cd $(builddir)/src/config; $(PYTHON) setup.py build --build-base $(abs_builddir)/src/config clean --all ++ cd $(builddir)/src/config; $(PYTHON2) setup.py build --build-base $(abs_builddir)/src/config clean --all ++endif ++if BUILD_PYTHON3_BINDINGS ++ if [ ! $(srcdir)/src/config/SSSDConfig/ipachangeconf.py -ef $(builddir)/src/config/SSSDConfig/ipachangeconf.py ]; then \ ++ rm -f $(builddir)/src/config/SSSDConfig/ipachangeconf.py ; \ ++ fi ++ ++ if [ ! $(srcdir)/src/config/SSSDConfig/ipachangeconf.py -ef $(builddir)/src/config/SSSDConfig/ipachangeconf.py ]; then \ ++ rm -f $(builddir)/src/config/SSSDConfig/sssd_upgrade_config.py ; \ ++ fi ++ ++ rm -f $(builddir)/src/config/SSSDConfig/__pycache__/*.pyc ++ ++ cd $(builddir)/src/config; $(PYTHON3) setup.py build --build-base $(abs_builddir)/src/config clean --all + endif + for doc in $(SSSD_DOCS); do \ + rm -Rf $$doc; \ +diff --git a/configure.ac b/configure.ac +index f72e448528edcffb855504a38a179c400f98ac42..e30405f3a17ffd2c9899b6eb17af85ec9bc15234 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -117,7 +117,8 @@ WITH_KRB5_PLUGIN_PATH + WITH_KRB5_RCACHE_DIR + WITH_KRB5AUTHDATA_PLUGIN_PATH + WITH_KRB5_CONF +-WITH_PYTHON_BINDINGS ++WITH_PYTHON2_BINDINGS ++WITH_PYTHON3_BINDINGS + WITH_CIFS_PLUGIN_PATH + WITH_SELINUX + WITH_NSCD +@@ -247,16 +248,52 @@ AM_CONDITIONAL([HAVE_PROFILE_CATALOGS], [test "x$HAVE_PROFILE_CATALOGS" != "x"]) + AM_CONDITIONAL([HAVE_MANPAGES], [test "x$HAVE_MANPAGES" != "x"]) + AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"]) + +-if test x$HAVE_PYTHON_BINDINGS != x; then ++if test x$HAVE_PYTHON2_BINDINGS = x1; then ++ AC_PATH_PROG(PYTHON2, python2) ++ PYTHON=$PYTHON2 + AM_PATH_PYTHON([2.6]) +- AM_PYTHON_CONFIG([python]) ++ AM_PYTHON_CONFIG([python2]) + AM_CHECK_PYTHON_HEADERS([], +- AC_MSG_ERROR([Could not find python headers])) ++ AC_MSG_ERROR([Could not find python2 headers])) + AM_CHECK_PYTHON_COMPAT +- AC_SUBST([PYTHON_CFLAGS]) +- AC_SUBST([PYTHON_LIBS]) ++ ++ AC_SUBST([py2execdir], [$pyexecdir]) ++ AC_SUBST([python2dir], [$pythondir]) ++ AC_SUBST([PYTHON2_CFLAGS], [$PYTHON_CFLAGS]) ++ AC_SUBST([PYTHON2_LIBS], [$PYTHON_LIBS]) ++ AC_SUBST([PYTHON2_INCLUDES], [$PYTHON_INCLUDES]) ++ AC_SUBST([PYTHON2_VERSION], [$PYTHON_VERSION]) ++ AC_SUBST([PYTHON2_PREFIX], [$PYTHON_PREFIX]) ++ AC_SUBST([PYTHON2_EXEC_PREFIX], [$PYTHON_EXEC_PREFIX]) ++ ++ SSS_CLEAN_PYTHON_VARIABLES + fi + ++if test x$HAVE_PYTHON3_BINDINGS = x1; then ++ AC_PATH_PROG(PYTHON3, python3) ++ PYTHON=$PYTHON3 ++ AM_PATH_PYTHON([3.3]) ++ AM_PYTHON_CONFIG([python3]) ++ AM_CHECK_PYTHON_HEADERS([], ++ AC_MSG_ERROR([Could not find python3 headers])) ++ AM_CHECK_PYTHON_COMPAT ++ ++ AC_SUBST([py3execdir], [$pyexecdir]) ++ AC_SUBST([python3dir], [$pythondir]) ++ AC_SUBST([PYTHON3_CFLAGS], [$PYTHON_CFLAGS]) ++ AC_SUBST([PYTHON3_LIBS], [$PYTHON_LIBS]) ++ AC_SUBST([PYTHON3_INCLUDES], [$PYTHON_INCLUDES]) ++ AC_SUBST([PYTHON3_VERSION], [$PYTHON_VERSION]) ++ AC_SUBST([PYTHON3_PREFIX], [$PYTHON_PREFIX]) ++ AC_SUBST([PYTHON3_EXEC_PREFIX], [$PYTHON_EXEC_PREFIX]) ++ ++ SSS_CLEAN_PYTHON_VARIABLES ++fi ++ ++AM_CONDITIONAL([BUILD_PYTHON_BINDINGS], ++ [test x"$with_python2_bindings" = xyes \ ++ -o x"$with_python3_bindings" = xyes]) ++ + if test x$HAVE_SELINUX != x; then + AM_CHECK_SELINUX + AM_CHECK_SELINUX_LOGIN_DIR +diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in +index 6d6f0b9294e2150549f36c64a11ace64be8a83cc..ecbb29dd9222578fdd2c8505770f0345684012f3 100644 +--- a/contrib/sssd.spec.in ++++ b/contrib/sssd.spec.in +@@ -781,10 +781,12 @@ rm -rf $RPM_BUILD_ROOT + %files -n python-sss + %defattr(-,root,root,-) + %{python_sitearch}/pysss.so ++%{python_sitearch}/_py2sss.so + + %files -n python-sss-murmur + %defattr(-,root,root,-) + %{python_sitearch}/pysss_murmur.so ++%{python_sitearch}/_py2sss_murmur.so + + %files -n libsss_idmap + %defattr(-,root,root,-) +@@ -825,10 +827,12 @@ rm -rf $RPM_BUILD_ROOT + %files -n python-libsss_nss_idmap + %defattr(-,root,root,-) + %{python_sitearch}/pysss_nss_idmap.so ++%{python_sitearch}/_py2sss_nss_idmap.so + + %files -n python-libipa_hbac + %defattr(-,root,root,-) + %{python_sitearch}/pyhbac.so ++%{python_sitearch}/_py2hbac.so + + %files libwbclient + %defattr(-,root,root,-) +diff --git a/src/conf_macros.m4 b/src/conf_macros.m4 +index 027490e524f321b9d444395e788aa7476dd916e9..ff49f84421ac6be8a2a5f5840283485ea16d671d 100644 +--- a/src/conf_macros.m4 ++++ b/src/conf_macros.m4 +@@ -360,21 +360,38 @@ AC_DEFUN([WITH_KRB5_CONF], + AC_DEFINE_UNQUOTED([KRB5_CONF_PATH], ["$KRB5_CONF_PATH"], [KRB5 configuration file]) + ]) + +-AC_DEFUN([WITH_PYTHON_BINDINGS], +- [ AC_ARG_WITH([python-bindings], +- [AC_HELP_STRING([--with-python-bindings], +- [Whether to build python bindings [yes]] +- ) ++AC_DEFUN([WITH_PYTHON2_BINDINGS], ++ [ AC_ARG_WITH([python2-bindings], ++ [AC_HELP_STRING([--with-python2-bindings], ++ [Whether to build python2 bindings [yes]]) + ], + [], +- with_python_bindings=yes ++ [with_python2_bindings=yes] + ) +- if test x"$with_python_bindings" = xyes; then +- HAVE_PYTHON_BINDINGS=1 +- AC_SUBST(HAVE_PYTHON_BINDINGS) +- AC_DEFINE_UNQUOTED(HAVE_PYTHON_BINDINGS, 1, [Build with python bindings]) ++ if test x"$with_python2_bindings" = xyes; then ++ AC_SUBST([HAVE_PYTHON2_BINDINGS], [1]) ++ AC_DEFINE_UNQUOTED([HAVE_PYTHON2_BINDINGS], [1], ++ [Build with python2 bindings]) + fi +- AM_CONDITIONAL([BUILD_PYTHON_BINDINGS], [test x"$with_python_bindings" = xyes]) ++ AM_CONDITIONAL([BUILD_PYTHON2_BINDINGS], ++ [test x"$with_python2_bindings" = xyes]) ++ ]) ++ ++AC_DEFUN([WITH_PYTHON3_BINDINGS], ++ [ AC_ARG_WITH([python3-bindings], ++ [AC_HELP_STRING([--with-python3-bindings], ++ [Whether to build python3 bindings [yes]]) ++ ], ++ [], ++ [with_python3_bindings=no] ++ ) ++ if test x"$with_python3_bindings" = xyes; then ++ AC_SUBST([HAVE_PYTHON3_BINDINGS], [1]) ++ AC_DEFINE_UNQUOTED([HAVE_PYTHON3_BINDINGS], [1], ++ [Build with python3 bindings]) ++ fi ++ AM_CONDITIONAL([BUILD_PYTHON3_BINDINGS], ++ [test x"$with_python3_bindings" = xyes]) + ]) + + AC_DEFUN([WITH_SELINUX], +diff --git a/src/tests/pyhbac-test.py b/src/tests/pyhbac-test.py +index 0abc5703dedb2466b4d99718b5b524951b8af95c..83958d7bffcccea375c79166ee7dfca6f9956cff 100755 +--- a/src/tests/pyhbac-test.py ++++ b/src/tests/pyhbac-test.py +@@ -6,10 +6,9 @@ import sys + import os + import copy + import sys ++import errno + +-srcdir = os.getenv('builddir') +-if not srcdir: +- srcdir = "." ++srcdir = os.getenv('builddir') or "." + MODPATH = srcdir + "/.libs" #FIXME - is there a way to get this from libtool? + + if sys.version_info[0] > 2: +@@ -41,6 +40,23 @@ class PyHbacImport(unittest.TestCase): + def testImport(self): + " Import the module and assert it comes from tree " + try: ++ cwd_backup = os.getcwd() ++ ++ try: ++ os.unlink(MODPATH + "/pyhbac.so") ++ except OSError as e: ++ if e.errno == errno.ENOENT: ++ pass ++ else: ++ raise e ++ ++ os.chdir(MODPATH) ++ if sys.version_info[0] > 2: ++ os.symlink("_py3hbac.so", "pyhbac.so") ++ else: ++ os.symlink("_py2hbac.so", "pyhbac.so") ++ os.chdir(cwd_backup) ++ + import pyhbac + except ImportError as e: + print("Could not load the pyhbac module. Please check if it is compiled", file=sys.stderr) +diff --git a/src/tests/pysss_murmur-test.py b/src/tests/pysss_murmur-test.py +index 0b28f45e67cb4b033516a585867085dba7b412e6..faa8bb2d33b9d94d380b8f7045ba45aa06ac4793 100755 +--- a/src/tests/pysss_murmur-test.py ++++ b/src/tests/pysss_murmur-test.py +@@ -23,10 +23,9 @@ import unittest + import sys + import os + import copy ++import errno + +-srcdir = os.getenv('builddir') +-if not srcdir: +- srcdir = "." ++srcdir = os.getenv('builddir') or "." + MODPATH = srcdir + "/.libs" #FIXME - is there a way to get this from libtool? + + def compat_assertItemsEqual(this, expected_seq, actual_seq, msg=None): +@@ -57,6 +56,23 @@ class PySssMurmurImport(unittest.TestCase): + def testImport(self): + " Import the module and assert it comes from tree " + try: ++ cwd_backup = os.getcwd() ++ ++ try: ++ os.unlink(MODPATH + "/pysss_murmur.so") ++ except OSError as e: ++ if e.errno == errno.ENOENT: ++ pass ++ else: ++ raise e ++ ++ os.chdir(MODPATH) ++ if sys.version_info[0] > 2: ++ os.symlink("_py3sss_murmur.so", "pysss_murmur.so") ++ else: ++ os.symlink("_py2sss_murmur.so", "pysss_murmur.so") ++ os.chdir(cwd_backup) ++ + import pysss_murmur + except ImportError as e: + print("Could not load the pysss_murmur module. Please check if it is compiled", file=sys.stderr) +-- +2.1.0 + diff --git a/0013-TESTS-Run-python-tests-with-all-supported-python-ver.patch b/0013-TESTS-Run-python-tests-with-all-supported-python-ver.patch new file mode 100644 index 0000000..3679a9d --- /dev/null +++ b/0013-TESTS-Run-python-tests-with-all-supported-python-ver.patch @@ -0,0 +1,146 @@ +From 63f84d9c9b662bc66ac7125307c1918dc6a671a7 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Mon, 23 Feb 2015 22:56:55 +0100 +Subject: [PATCH 13/15] TESTS: Run python tests with all supported python + versions + +This patch add simple bash wrappers for python tests. +They are executed either with python2 or python3. + +Reviewed-by: Stephen Gallagher +--- + Makefile.am | 23 ++++++++++++++++++----- + src/config/SSSDConfigTest.py2.sh | 5 +++++ + src/config/SSSDConfigTest.py3.sh | 5 +++++ + src/tests/pyhbac-test.py2.sh | 5 +++++ + src/tests/pyhbac-test.py3.sh | 5 +++++ + src/tests/pysss_murmur-test.py2.sh | 5 +++++ + src/tests/pysss_murmur-test.py3.sh | 5 +++++ + 7 files changed, 48 insertions(+), 5 deletions(-) + create mode 100755 src/config/SSSDConfigTest.py2.sh + create mode 100755 src/config/SSSDConfigTest.py3.sh + create mode 100755 src/tests/pyhbac-test.py2.sh + create mode 100755 src/tests/pyhbac-test.py3.sh + create mode 100755 src/tests/pysss_murmur-test.py2.sh + create mode 100755 src/tests/pysss_murmur-test.py3.sh + +diff --git a/Makefile.am b/Makefile.am +index 14ee3dd528f0d89b3e0d2afdb99313e6c570234f..605fd1ff5e479078d579ac7524507546261d469c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -248,13 +248,20 @@ endif # HAVE_CMOCKA + + PYTHON_TESTS = + +-if BUILD_PYTHON_BINDINGS +-PYTHON_TESTS += src/config/SSSDConfigTest.py \ +- src/tests/pyhbac-test.py \ +- src/tests/pysss_murmur-test.py ++if BUILD_PYTHON2_BINDINGS ++PYTHON_TESTS += src/config/SSSDConfigTest.py2.sh \ ++ src/tests/pyhbac-test.py2.sh \ ++ src/tests/pysss_murmur-test.py2.sh \ ++ $(NULL) ++endif ++if BUILD_PYTHON3_BINDINGS ++PYTHON_TESTS += src/config/SSSDConfigTest.py3.sh \ ++ src/tests/pyhbac-test.py3.sh \ ++ src/tests/pysss_murmur-test.py3.sh \ ++ $(NULL) + endif + +-TEST_EXTENSIONS = .py ++TEST_EXTENSIONS = .sh + TESTS = \ + $(PYTHON_TESTS) \ + $(non_interactive_cmocka_based_tests) \ +@@ -323,6 +330,8 @@ dist_noinst_SCRIPTS = \ + src/config/SSSDConfig/ipachangeconf.py \ + src/config/SSSDConfig/__init__.py \ + src/config/SSSDConfigTest.py \ ++ src/config/SSSDConfigTest.py2.sh \ ++ src/config/SSSDConfigTest.py3.sh \ + src/config/SSSDConfig/sssd_upgrade_config.py \ + contrib/rhel/update_debug_levels.py \ + contrib/fedora/bashrc_sssd \ +@@ -333,7 +342,11 @@ dist_noinst_SCRIPTS = \ + contrib/ci/run \ + contrib/ci/valgrind-condense \ + src/tests/pyhbac-test.py \ ++ src/tests/pyhbac-test.py2.sh \ ++ src/tests/pyhbac-test.py3.sh \ + src/tests/pysss_murmur-test.py \ ++ src/tests/pysss_murmur-test.py2.sh \ ++ src/tests/pysss_murmur-test.py3.sh \ + src/tests/python-test.py \ + $(NULL) + +diff --git a/src/config/SSSDConfigTest.py2.sh b/src/config/SSSDConfigTest.py2.sh +new file mode 100755 +index 0000000000000000000000000000000000000000..7bbd82af3997b295d48f8ea6d1d59afd5eaba43f +--- /dev/null ++++ b/src/config/SSSDConfigTest.py2.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++SCRIPT=$(readlink -f "$0") ++SCRIPT_PATH=$(dirname "$SCRIPT") ++exec python2 $SCRIPT_PATH/SSSDConfigTest.py +diff --git a/src/config/SSSDConfigTest.py3.sh b/src/config/SSSDConfigTest.py3.sh +new file mode 100755 +index 0000000000000000000000000000000000000000..89b9f0720473904fe093ee4c065ae01579ee94ef +--- /dev/null ++++ b/src/config/SSSDConfigTest.py3.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++SCRIPT=$(readlink -f "$0") ++SCRIPT_PATH=$(dirname "$SCRIPT") ++exec python3 $SCRIPT_PATH/SSSDConfigTest.py +diff --git a/src/tests/pyhbac-test.py2.sh b/src/tests/pyhbac-test.py2.sh +new file mode 100755 +index 0000000000000000000000000000000000000000..48cd16908eaf9cf2c61f8e5fda1d954f116c68cc +--- /dev/null ++++ b/src/tests/pyhbac-test.py2.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++SCRIPT=$(readlink -f "$0") ++SCRIPT_PATH=$(dirname "$SCRIPT") ++exec python2 $SCRIPT_PATH/pyhbac-test.py +diff --git a/src/tests/pyhbac-test.py3.sh b/src/tests/pyhbac-test.py3.sh +new file mode 100755 +index 0000000000000000000000000000000000000000..862c7b23a87ea9d0b747dca12466175f0fd00b76 +--- /dev/null ++++ b/src/tests/pyhbac-test.py3.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++SCRIPT=$(readlink -f "$0") ++SCRIPT_PATH=$(dirname "$SCRIPT") ++exec python3 $SCRIPT_PATH/pyhbac-test.py +diff --git a/src/tests/pysss_murmur-test.py2.sh b/src/tests/pysss_murmur-test.py2.sh +new file mode 100755 +index 0000000000000000000000000000000000000000..714459786c19b69f738e91df77d9423eba2b72fd +--- /dev/null ++++ b/src/tests/pysss_murmur-test.py2.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++SCRIPT=$(readlink -f "$0") ++SCRIPT_PATH=$(dirname "$SCRIPT") ++exec python2 $SCRIPT_PATH/pysss_murmur-test.py +diff --git a/src/tests/pysss_murmur-test.py3.sh b/src/tests/pysss_murmur-test.py3.sh +new file mode 100755 +index 0000000000000000000000000000000000000000..00b352ad3e15ba7d53885b86129bf76ede7ca4e6 +--- /dev/null ++++ b/src/tests/pysss_murmur-test.py3.sh +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++SCRIPT=$(readlink -f "$0") ++SCRIPT_PATH=$(dirname "$SCRIPT") ++exec python3 $SCRIPT_PATH/pysss_murmur-test.py +-- +2.1.0 + diff --git a/0014-SPEC-Replace-python_-macros-with-python2_.patch b/0014-SPEC-Replace-python_-macros-with-python2_.patch new file mode 100644 index 0000000..97b434b --- /dev/null +++ b/0014-SPEC-Replace-python_-macros-with-python2_.patch @@ -0,0 +1,91 @@ +From dfd30a859fb397afa3346e282f70c07b88010744 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Tue, 10 Feb 2015 18:07:05 +0100 +Subject: [PATCH 14/15] SPEC: Replace python_ macros with python2_ + +Reviewed-by: Stephen Gallagher +--- + contrib/sssd.spec.in | 34 ++++++++++++++++++++-------------- + 1 file changed, 20 insertions(+), 14 deletions(-) + +diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in +index ecbb29dd9222578fdd2c8505770f0345684012f3..0a12fff74101ae4beaa41685bc6a5d13c1795447 100644 +--- a/contrib/sssd.spec.in ++++ b/contrib/sssd.spec.in +@@ -1,8 +1,14 @@ + %global rhel7_minor %(%{__grep} -o "7.[0-9]*" /etc/redhat-release |%{__sed} -s 's/7.//') + ++%if 0%{?rhel} && 0%{?rhel} <= 6 ++%{!?__python2: %global __python2 /usr/bin/python2} ++%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} ++%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} ++%endif ++ + # Fedora and RHEL 6+ + # we don't want to provide private python extension libs +-%define __provides_exclude_from %{python_sitearch}/.*\.so$ ++%define __provides_exclude_from %{python2_sitearch}/.*\.so$ + + %if (0%{?fedora} || 0%{?rhel} >= 7) + %global use_systemd 1 +@@ -528,9 +534,9 @@ rm -Rf ${RPM_BUILD_ROOT}/%{_docdir}/%{name} + + # Older versions of rpmbuild can only handle one -f option + # So we need to append to the sssd*.lang file +-for file in `ls $RPM_BUILD_ROOT/%{python_sitelib}/*.egg-info 2> /dev/null` ++for file in `ls $RPM_BUILD_ROOT/%{python2_sitelib}/*.egg-info 2> /dev/null` + do +- echo %{python_sitelib}/`basename $file` >> python_sssdconfig.lang ++ echo %{python2_sitelib}/`basename $file` >> python2_sssdconfig.lang + done + + touch sssd.lang +@@ -773,20 +779,20 @@ rm -rf $RPM_BUILD_ROOT + %{_mandir}/man8/sss_debuglevel.8* + %{_mandir}/man8/sss_seed.8* + +-%files -n python-sssdconfig -f python_sssdconfig.lang ++%files -n python-sssdconfig -f python2_sssdconfig.lang + %defattr(-,root,root,-) +-%dir %{python_sitelib}/SSSDConfig +-%{python_sitelib}/SSSDConfig/*.py* ++%dir %{python2_sitelib}/SSSDConfig ++%{python2_sitelib}/SSSDConfig/*.py* + + %files -n python-sss + %defattr(-,root,root,-) +-%{python_sitearch}/pysss.so +-%{python_sitearch}/_py2sss.so ++%{python2_sitearch}/pysss.so ++%{python2_sitearch}/_py2sss.so + + %files -n python-sss-murmur + %defattr(-,root,root,-) +-%{python_sitearch}/pysss_murmur.so +-%{python_sitearch}/_py2sss_murmur.so ++%{python2_sitearch}/pysss_murmur.so ++%{python2_sitearch}/_py2sss_murmur.so + + %files -n libsss_idmap + %defattr(-,root,root,-) +@@ -826,13 +832,13 @@ rm -rf $RPM_BUILD_ROOT + + %files -n python-libsss_nss_idmap + %defattr(-,root,root,-) +-%{python_sitearch}/pysss_nss_idmap.so +-%{python_sitearch}/_py2sss_nss_idmap.so ++%{python2_sitearch}/pysss_nss_idmap.so ++%{python2_sitearch}/_py2sss_nss_idmap.so + + %files -n python-libipa_hbac + %defattr(-,root,root,-) +-%{python_sitearch}/pyhbac.so +-%{python_sitearch}/_py2hbac.so ++%{python2_sitearch}/pyhbac.so ++%{python2_sitearch}/_py2hbac.so + + %files libwbclient + %defattr(-,root,root,-) +-- +2.1.0 + diff --git a/0015-SPEC-Build-python3-bindings-on-available-platforms.patch b/0015-SPEC-Build-python3-bindings-on-available-platforms.patch new file mode 100644 index 0000000..ae9fef8 --- /dev/null +++ b/0015-SPEC-Build-python3-bindings-on-available-platforms.patch @@ -0,0 +1,378 @@ +From ee4ce01ae70a318eee764176d924dbc92b789c53 Mon Sep 17 00:00:00 2001 +From: Lukas Slebodnik +Date: Tue, 10 Feb 2015 19:39:45 +0100 +Subject: [PATCH 15/15] SPEC: Build python3 bindings on available platforms + +Resolves: +https://fedorahosted.org/sssd/ticket/2574 + +Reviewed-by: Stephen Gallagher +--- + contrib/ci/configure.sh | 6 ++ + contrib/ci/deps.sh | 1 + + contrib/sssd.spec.in | 144 ++++++++++++++++++++++++++++++++++++++++++++--- + src/conf_macros.m4 | 2 +- + src/tests/dlopen-tests.c | 14 +++-- + 5 files changed, 154 insertions(+), 13 deletions(-) + +diff --git a/contrib/ci/configure.sh b/contrib/ci/configure.sh +index 8af273043a77556a2eee10224ff2a0baaf53d497..d5d4c791a35f3583416efd904ad5804bcbebf4c8 100644 +--- a/contrib/ci/configure.sh ++++ b/contrib/ci/configure.sh +@@ -35,9 +35,15 @@ if [[ "$DISTRO_BRANCH" == -redhat-redhatenterprise*-6.*- ]]; then + CONFIGURE_ARG_LIST+=( + "--disable-cifs-idmap-plugin" + "--with-syslog=syslog" ++ "--without-python3-bindings" + ) + fi + ++if [[ "$DISTRO_BRANCH" == -redhat-redhatenterprise*-7.*- ]]; then ++ CONFIGURE_ARG_LIST+=( ++ "--without-python3-bindings" ++ ) ++fi + declare -r -a CONFIGURE_ARG_LIST + + fi # _CONFIGURE_SH +diff --git a/contrib/ci/deps.sh b/contrib/ci/deps.sh +index 0cdb9962987edddf4dd2fff659e3262bbd50b045..4e0ce1e0328927f42b3849d9c39180b4064a9d4b 100644 +--- a/contrib/ci/deps.sh ++++ b/contrib/ci/deps.sh +@@ -92,6 +92,7 @@ if [[ "$DISTRO_BRANCH" == -debian-* ]]; then + libxml2-utils + make + python-dev ++ python3-dev + samba-dev + systemd + xml-core +diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in +index 0a12fff74101ae4beaa41685bc6a5d13c1795447..7d0fbdc36747671a69eecdff26f49b4fbaedb586 100644 +--- a/contrib/sssd.spec.in ++++ b/contrib/sssd.spec.in +@@ -9,6 +9,7 @@ + # Fedora and RHEL 6+ + # we don't want to provide private python extension libs + %define __provides_exclude_from %{python2_sitearch}/.*\.so$ ++%define __provides_exclude_from %{python3_sitearch}/.*\.so$ + + %if (0%{?fedora} || 0%{?rhel} >= 7) + %global use_systemd 1 +@@ -44,6 +45,12 @@ + %global with_krb5_localauth_plugin 1 + %endif + ++%if (0%{?fedora}) ++ %global with_python3 1 ++%else ++ %global with_python3_option --without-python3-bindings ++%endif ++ + Name: @PACKAGE_NAME@ + Version: @PACKAGE_VERSION@ + Release: 0@PRERELEASE_VERSION@%{?dist} +@@ -65,7 +72,11 @@ Requires: sssd-ipa = %{version}-%{release} + Requires: sssd-common-pac = %{version}-%{release} + Requires: sssd-ad = %{version}-%{release} + Requires: sssd-proxy = %{version}-%{release} ++%if (0%{?with_python3} == 1) ++Requires: python3-sssdconfig = %{version}-%{release} ++%else + Requires: python-sssdconfig = %{version}-%{release} ++%endif + + %global servicename sssd + %global sssdstatedir %{_localstatedir}/lib/sss +@@ -106,6 +117,9 @@ BuildRequires: krb5-devel + %endif + BuildRequires: c-ares-devel + BuildRequires: python-devel ++%if (0%{?with_python3} == 1) ++BuildRequires: python3-devel ++%endif + BuildRequires: check-devel + BuildRequires: doxygen + BuildRequires: libselinux-devel +@@ -203,8 +217,13 @@ Group: Applications/System + License: GPLv3+ + Requires: sssd-common = %{version}-%{release} + # required by sss_obfuscate ++%if (0%{?with_python3} == 1) ++Requires: python3-sss = %{version}-%{release} ++Requires: python3-sssdconfig = %{version}-%{release} ++%else + Requires: python-sss = %{version}-%{release} + Requires: python-sssdconfig = %{version}-%{release} ++%endif + + %description tools + Provides userspace tools for manipulating users, groups, and nested groups in +@@ -222,29 +241,66 @@ License: GPLv3+ + BuildArch: noarch + + %description -n python-sssdconfig +-Provides python files for manipulation SSSD and IPA configuration files. ++Provides python2 files for manipulation SSSD and IPA configuration files. ++ ++%if (0%{?with_python3} == 1) ++%package -n python3-sssdconfig ++Summary: SSSD and IPA configuration file manipulation classes and functions ++Group: Applications/System ++License: GPLv3+ ++BuildArch: noarch ++ ++%description -n python3-sssdconfig ++Provides python3 files for manipulation SSSD and IPA configuration files. ++%endif + + %package -n python-sss +-Summary: Python bindings for sssd ++Summary: Python2 bindings for sssd + Group: Development/Libraries + License: LGPLv3+ + Requires: sssd-common = %{version}-%{release} + + %description -n python-sss +-Provides python module for manipulating users, groups, and nested groups in ++Provides python2 module for manipulating users, groups, and nested groups in + SSSD when using id_provider = local in /etc/sssd/sssd.conf. + +-Also provides several other useful python bindings: ++Also provides several other useful python2 bindings: + * function for retrieving list of groups user belongs to. + * class for obfuscation of passwords + ++%if (0%{?with_python3} == 1) ++%package -n python3-sss ++Summary: Python3 bindings for sssd ++Group: Development/Libraries ++License: LGPLv3+ ++Requires: sssd-common = %{version}-%{release} ++ ++%description -n python3-sss ++Provides python3 module for manipulating users, groups, and nested groups in ++SSSD when using id_provider = local in /etc/sssd/sssd.conf. ++ ++Also provides several other useful python3 bindings: ++ * function for retrieving list of groups user belongs to. ++ * class for obfuscation of passwords ++%endif ++ + %package -n python-sss-murmur +-Summary: Python bindings for murmur hash function ++Summary: Python2 bindings for murmur hash function + Group: Development/Libraries + License: LGPLv3+ + + %description -n python-sss-murmur +-Provides python module for calculating the murmur hash version 3 ++Provides python2 module for calculating the murmur hash version 3 ++ ++%if (0%{?with_python3} == 1) ++%package -n python3-sss-murmur ++Summary: Python3 bindings for murmur hash function ++Group: Development/Libraries ++License: LGPLv3+ ++ ++%description -n python3-sss-murmur ++Provides python3 module for calculating the murmur hash version 3 ++%endif + + %package ldap + Summary: The LDAP back end of the SSSD +@@ -371,7 +427,7 @@ Requires: libipa_hbac = %{version}-%{release} + Utility library to validate FreeIPA HBAC rules for authorization requests + + %package -n python-libipa_hbac +-Summary: Python bindings for the FreeIPA HBAC Evaluator library ++Summary: Python2 bindings for the FreeIPA HBAC Evaluator library + Group: Development/Libraries + License: LGPLv3+ + Requires: libipa_hbac = %{version}-%{release} +@@ -382,6 +438,18 @@ Obsoletes: libipa_hbac-python < 1.12.90 + The python-libipa_hbac contains the bindings so that libipa_hbac can be + used by Python applications. + ++%if (0%{?with_python3} == 1) ++%package -n python3-libipa_hbac ++Summary: Python3 bindings for the FreeIPA HBAC Evaluator library ++Group: Development/Libraries ++License: LGPLv3+ ++Requires: libipa_hbac = %{version}-%{release} ++ ++%description -n python3-libipa_hbac ++The python3-libipa_hbac contains the bindings so that libipa_hbac can be ++used by Python applications. ++%endif ++ + %package -n libsss_nss_idmap + Summary: Library for SID based lookups + Group: Development/Libraries +@@ -402,7 +470,7 @@ Requires: libsss_nss_idmap = %{version}-%{release} + Utility library for SID based lookups + + %package -n python-libsss_nss_idmap +-Summary: Python bindings for libsss_nss_idmap ++Summary: Python2 bindings for libsss_nss_idmap + Group: Development/Libraries + License: LGPLv3+ + Requires: libsss_nss_idmap = %{version}-%{release} +@@ -413,6 +481,18 @@ Obsoletes: libsss_nss_idmap-python < 1.12.90 + The python-libsss_nss_idmap contains the bindings so that libsss_nss_idmap can + be used by Python applications. + ++%if (0%{?with_python3} == 1) ++%package -n python3-libsss_nss_idmap ++Summary: Python3 bindings for libsss_nss_idmap ++Group: Development/Libraries ++License: LGPLv3+ ++Requires: libsss_nss_idmap = %{version}-%{release} ++ ++%description -n python3-libsss_nss_idmap ++The python3-libsss_nss_idmap contains the bindings so that libsss_nss_idmap can ++be used by Python applications. ++%endif ++ + %package dbus + Summary: The D-Bus responder of the SSSD + Group: Applications/System +@@ -495,6 +575,7 @@ autoreconf -ivf + %{with_initscript} \ + %{?with_syslog} \ + %{?with_cifs_utils_plugin_option} \ ++ %{?with_python3_option} \ + %{?experimental} + + make %{?_smp_mflags} all +@@ -509,6 +590,10 @@ unset CK_TIMEOUT_MULTIPLIER + %install + rm -rf $RPM_BUILD_ROOT + ++%if (0%{?with_python3} == 1) ++sed -i -e 's:/usr/bin/python:/usr/bin/python3:' src/tools/sss_obfuscate ++%endif ++ + make install DESTDIR=$RPM_BUILD_ROOT + + # Prepare language files +@@ -539,6 +624,13 @@ do + echo %{python2_sitelib}/`basename $file` >> python2_sssdconfig.lang + done + ++%if (0%{?with_python3} == 1) ++for file in `ls $RPM_BUILD_ROOT/%{python3_sitelib}/*.egg-info 2> /dev/null` ++do ++ echo %{python3_sitelib}/`basename $file` >> python3_sssdconfig.lang ++done ++%endif ++ + touch sssd.lang + touch sssd_tools.lang + touch sssd_client.lang +@@ -784,16 +876,38 @@ rm -rf $RPM_BUILD_ROOT + %dir %{python2_sitelib}/SSSDConfig + %{python2_sitelib}/SSSDConfig/*.py* + ++%if (0%{?with_python3} == 1) ++%files -n python3-sssdconfig -f python3_sssdconfig.lang ++%defattr(-,root,root,-) ++%dir %{python3_sitelib}/SSSDConfig ++%{python3_sitelib}/SSSDConfig/*.py* ++%{python3_sitelib}/SSSDConfig/__pycache__/*.py* ++%endif ++ + %files -n python-sss + %defattr(-,root,root,-) + %{python2_sitearch}/pysss.so + %{python2_sitearch}/_py2sss.so + ++%if (0%{?with_python3} == 1) ++%files -n python3-sss ++%defattr(-,root,root,-) ++%{python3_sitearch}/pysss.so ++%{python3_sitearch}/_py3sss.so ++%endif ++ + %files -n python-sss-murmur + %defattr(-,root,root,-) + %{python2_sitearch}/pysss_murmur.so + %{python2_sitearch}/_py2sss_murmur.so + ++%if (0%{?with_python3} == 1) ++%files -n python3-sss-murmur ++%defattr(-,root,root,-) ++%{python3_sitearch}/pysss_murmur.so ++%{python3_sitearch}/_py3sss_murmur.so ++%endif ++ + %files -n libsss_idmap + %defattr(-,root,root,-) + %doc src/sss_client/COPYING src/sss_client/COPYING.LESSER +@@ -835,11 +949,25 @@ rm -rf $RPM_BUILD_ROOT + %{python2_sitearch}/pysss_nss_idmap.so + %{python2_sitearch}/_py2sss_nss_idmap.so + ++%if (0%{?with_python3} == 1) ++%files -n python3-libsss_nss_idmap ++%defattr(-,root,root,-) ++%{python3_sitearch}/pysss_nss_idmap.so ++%{python3_sitearch}/_py3sss_nss_idmap.so ++%endif ++ + %files -n python-libipa_hbac + %defattr(-,root,root,-) + %{python2_sitearch}/pyhbac.so + %{python2_sitearch}/_py2hbac.so + ++%if (0%{?with_python3} == 1) ++%files -n python3-libipa_hbac ++%defattr(-,root,root,-) ++%{python3_sitearch}/pyhbac.so ++%{python3_sitearch}/_py3hbac.so ++%endif ++ + %files libwbclient + %defattr(-,root,root,-) + %{_libdir}/%{name}/modules/libwbclient.so.* +diff --git a/src/conf_macros.m4 b/src/conf_macros.m4 +index ff49f84421ac6be8a2a5f5840283485ea16d671d..9ed0a4c44c209e88fc896d0cd3040cb572b358c9 100644 +--- a/src/conf_macros.m4 ++++ b/src/conf_macros.m4 +@@ -383,7 +383,7 @@ AC_DEFUN([WITH_PYTHON3_BINDINGS], + [Whether to build python3 bindings [yes]]) + ], + [], +- [with_python3_bindings=no] ++ [with_python3_bindings=yes] + ) + if test x"$with_python3_bindings" = xyes; then + AC_SUBST([HAVE_PYTHON3_BINDINGS], [1]) +diff --git a/src/tests/dlopen-tests.c b/src/tests/dlopen-tests.c +index 5cc6cae693f09adae12df0d2267e0868ae2f74c0..e808f23e7560241e3fc158d71da2dbdbe1543dfc 100644 +--- a/src/tests/dlopen-tests.c ++++ b/src/tests/dlopen-tests.c +@@ -96,10 +96,16 @@ struct so { + { "libdlopen_test_providers.so", { LIBPFX"libdlopen_test_providers.so", + NULL } }, + #ifdef HAVE_PYTHON_BINDINGS +- { "pyhbac.so", { LIBPFX"pyhbac.so", NULL } }, +- { "pysss.so", { LIBPFX"pysss.so", NULL } }, +- { "pysss_murmur.so", { LIBPFX"pysss_murmur.so", NULL } }, +- { "pysss_nss_idmap.so", { LIBPFX"pysss_nss_idmap.so", NULL } }, ++ { "_py2hbac.so", { LIBPFX"_py2hbac.so", NULL } }, ++ { "_py2sss.so", { LIBPFX"_py2sss.so", NULL } }, ++ { "_py2sss_murmur.so", { LIBPFX"_py2sss_murmur.so", NULL } }, ++ { "_py2sss_nss_idmap.so", { LIBPFX"_py2sss_nss_idmap.so", NULL } }, ++#endif ++#ifdef HAVE_PYTHON_BINDINGS ++ { "_py3hbac.so", { LIBPFX"_py3hbac.so", NULL } }, ++ { "_py3sss.so", { LIBPFX"_py3sss.so", NULL } }, ++ { "_py3sss_murmur.so", { LIBPFX"_py3sss_murmur.so", NULL } }, ++ { "_py3sss_nss_idmap.so", { LIBPFX"_py3sss_nss_idmap.so", NULL } }, + #endif + #ifdef HAVE_CONFIG_LIB + { "libsss_config.so", { LIBPFX"libsss_config.so", NULL } }, +-- +2.1.0 + diff --git a/sssd.spec b/sssd.spec index 2c12176..e6f8e2c 100644 --- a/sssd.spec +++ b/sssd.spec @@ -36,6 +36,21 @@ Source0: https://fedorahosted.org/released/sssd/%{name}-%{version}.tar.gz BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) ### Patches ### +Patch0001: 0001-BUILD-Remove-unused-libraries-for-pysss.so.patch +Patch0002: 0002-BUILD-Remove-unused-variables.patch +Patch0003: 0003-BUILD-Remove-detection-of-type-Py_ssize_t.patch +Patch0004: 0004-UTIL-Remove-python-wrapper-sss_python_set_new.patch +Patch0005: 0005-UTIL-Remove-python-wrapper-sss_python_set_add.patch +Patch0006: 0006-UTIL-Remove-python-wrapper-sss_python_set_check.patch +Patch0007: 0007-UTIL-Remove-compatibility-macro-PyModule_AddIntMacro.patch +Patch0008: 0008-UTIL-Remove-python-wrapper-sss_python_unicode_from_s.patch +Patch0009: 0009-BUILD-Use-python-config-for-detection-FLAGS.patch +Patch0010: 0010-SPEC-Use-new-convention-for-python-packages.patch +Patch0011: 0011-SPEC-Move-python-bindings-to-separate-packages.patch +Patch0012: 0012-BUILD-Add-possibility-to-build-python-2-3-bindings.patch +Patch0013: 0013-TESTS-Run-python-tests-with-all-supported-python-ver.patch +Patch0014: 0014-SPEC-Replace-python_-macros-with-python2_.patch +Patch0015: 0015-SPEC-Build-python3-bindings-on-available-platforms.patch ### Dependencies ### Requires: sssd-common = %{version}-%{release}