[SSSD] [PATCH] Incorrect *.py[co] files placement

Lukas Slebodnik lslebodn at redhat.com
Wed Mar 27 08:14:31 UTC 2013


On (25/03/13 08:04), Stephen Gallagher wrote:
>On Mon 25 Mar 2013 06:42:46 AM EDT, Jakub Hrozek wrote:
>> On Mon, Mar 25, 2013 at 08:49:17AM +0100, Lukas Slebodnik wrote:
>>> On (22/03/13 15:01), Jakub Hrozek wrote:
>>>> On Wed, Mar 20, 2013 at 07:05:49PM +0100, Lukas Slebodnik 
>>>> wrote:
>>>>> Package sssd contains python files. Python files which are 
>>>>> not packaged in noarch package must be installed in 
>>>>> ${python_sitearch} directory and not in ${python_sitelib} 
>>>>> directory
>>>>> 
>>>>> Autoconf detected variable $(pyexecdir) is equivalent of 
>>>>> specfile ${python_sitearch}
>>>>> 
>>>>> https://fedorahosted.org/sssd/ticket/1839
>>>>> 
>>>>> LS
>>>> 
>>>>> -		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; $(PYTHON) setup.py build
>>>>> --build-base $(abs_builddir)/src/config install
>>>>> $(DISTSETUPOPTS) --prefix=$(PYTHON_PREFIX) 
>>>>> --record=$(abs_builddir)/src/config/.filesi
>>>> ^^^^^^^^^^^ "filesi" sounds like a typo to me
>>>>> --install-purelib=$(pyexecdir); \
>>> typo fixed. And I also reformat those lines to become more 
>>> readable.
>>> 
>>> LS
>> 
>> Ack, RPM build and upgrade went fine. I could also import 
>> SSSDConfig with the patch.
>
>
>Nack.
>
>This patch misses the point of the original bug. Rel-eng was
>complaining that we had python modules contained in an arch-specific
>package that were being put on disk in a noarch location. Rel-eng made
>the incorrect assumption that this meant that the modules were
>actually arch-specific, which they are not; SSSDConfig is pure-python
>and safely noarch.
>
>The correct solution to this is for us to add a python-sssdconfig
>noarch subpackage and Requires: it from the 'sssd' package (for
>backwards compatibility).

pure python files moved to noarch package python-sssdconfig.
patch attached

Just one notice. python-sssdconfig contains file
/usr/lib/python2.7/site-packages/SSSDConfig/ipachangeconf.py
but very simillar file is part of package freeipa-client
/usr/lib/python2.7/site-packages/ipaclient/ipachangeconf.py

SSSDConfig/ipachangeconf.py contains extra class SSSDChangeConf(IPAChangeConf),
but there is a lot of code duplication.

LS

-------------- next part --------------
>From 7bac91bb8c577a0da5090e4d7630252e23810a6f Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lslebodn at redhat.com>
Date: Tue, 26 Mar 2013 09:51:25 +0100
Subject: [PATCH] Incorrect *.py[co] files placement

Package sssd contains python files. Python files should be installed
in noarch package, therefore all python files from directory
src/config/SSSDConfig was moved to new noarch package python-sssdconfig.

https://fedorahosted.org/sssd/ticket/1839
---
 contrib/sssd.spec.in | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)

diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in
index dd8113c06a4d98456f928883b085f6ba982eb71c..8a92cb55f68c4816f469d467889a1a5ac6fdb266 100644
--- a/contrib/sssd.spec.in
+++ b/contrib/sssd.spec.in
@@ -61,6 +61,7 @@ Requires: libtdb >= 1.1.3
 Requires: sssd-client%{?_isa} = %{version}-%{release}
 Requires: libipa_hbac = %{version}-%{release}
 Requires: libsss_idmap = %{version}-%{release}
+Requires: python-sssdconfig = %{version}-%{release}
 Requires: cyrus-sasl-gssapi
 %if (0%{?use_systemd} == 1)
 Requires(post): systemd-units systemd-sysv
@@ -170,6 +171,15 @@ Also provides several other administrative tools:
     * sss_seed which pre-creates a user entry for use in kickstarts
     * sss_obfuscate for generating an obfuscated LDAP password
 
+%package -n python-sssdconfig
+Summary: SSSD and IPA configuration file manipulation classes and functions
+Group: Applications/System
+License: GPLv3+
+BuildArch: noarch
+
+%description -n python-sssdconfig
+Provides python files for manipulation SSSD and IPA configuration files.
+
 %package -n libsss_idmap
 Summary: FreeIPA Idmap library
 Group: Development/Libraries
@@ -316,12 +326,13 @@ find $RPM_BUILD_ROOT -name "*.la" -exec rm -f {} \;
 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
+# So we need to append to the sssd*.lang file
 for file in `ls $RPM_BUILD_ROOT/%{python_sitelib}/*.egg-info 2> /dev/null`
 do
-    echo %{python_sitelib}/`basename $file` >> sssd.lang
+    echo %{python_sitelib}/`basename $file` >> python_sssdconfig.lang
 done
 
+touch sssd.lang
 touch sssd_tools.lang
 touch sssd_client.lang
 for man in `find $RPM_BUILD_ROOT/%{_mandir}/??/man?/ -type f | sed -e "s#$RPM_BUILD_ROOT/%{_mandir}/##"`
@@ -432,8 +443,6 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/sss_ssh_knownhostsproxy.1*
 %{python_sitearch}/pysss.so
 %{python_sitearch}/pysss_murmur.so
-%dir %{python_sitelib}/SSSDConfig
-%{python_sitelib}/SSSDConfig/*.py*
 
 %files client -f sssd_client.lang
 %defattr(-,root,root,-)
@@ -471,6 +480,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man8/sss_debuglevel.8*
 %{_mandir}/man8/sss_seed.8*
 
+%files -n python-sssdconfig -f python_sssdconfig.lang
+%defattr(-,root,root,-)
+%dir %{python_sitelib}/SSSDConfig
+%{python_sitelib}/SSSDConfig/*.py*
+
 %files -n libsss_idmap
 %defattr(-,root,root,-)
 %doc src/sss_client/COPYING src/sss_client/COPYING.LESSER
-- 
1.8.1.4



More information about the sssd-devel mailing list