From 889706cbc739358c2a0aac2ba6bc054fdc8e048b Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Tue, 10 Feb 2015 19:39:45 +0100 Subject: 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 +++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 143 insertions(+), 8 deletions(-) (limited to 'contrib') diff --git a/contrib/ci/configure.sh b/contrib/ci/configure.sh index 8af273043..d5d4c791a 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 0cdb99629..4e0ce1e03 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 caf308d4a..043a40ed4 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 @@ -199,8 +213,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 @@ -218,29 +237,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 @@ -367,7 +423,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} @@ -378,6 +434,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 @@ -398,7 +466,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} @@ -409,6 +477,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 @@ -491,6 +571,7 @@ autoreconf -ivf %{with_initscript} \ %{?with_syslog} \ %{?with_cifs_utils_plugin_option} \ + %{?with_python3_option} \ %{?experimental} make %{?_smp_mflags} all @@ -505,6 +586,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 @@ -535,6 +620,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 @@ -780,16 +872,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 @@ -831,11 +945,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.* -- cgit