All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [ceph spec] package *.py* files
@ 2012-01-17 19:22 Alexandre Oliva
  2012-01-19 17:35 ` Holger Macht
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2012-01-17 19:22 UTC (permalink / raw)
  To: ceph-devel

Some post-install rpmbuild defaults byte-compile all packaged python
files, so don't bother removing the .pyc files, and package .py* to
get both .pyo and .pyc.  It wastes a tiny little bit of space, but it
makes the spec file portable across a wider range of rpm and python
configurations.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicam.br>
---
 ceph.spec.in |   19 +++----------------
 1 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/ceph.spec.in b/ceph.spec.in
index 3950fd1..d4994b5 100644
--- a/ceph.spec.in
+++ b/ceph.spec.in
@@ -255,10 +255,6 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/ceph/tmp/
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/ceph/
 mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/ceph/
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ceph/
-# remove *.pyc where *.pyo exists
-rm $RPM_BUILD_ROOT/%{python_sitelib}/rados.pyc
-rm $RPM_BUILD_ROOT/%{python_sitelib}/rbd.pyc
-rm $RPM_BUILD_ROOT/%{python_sitelib}/rgw.pyc
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -351,12 +347,6 @@ fi
 %ghost %dir %{_localstatedir}/run/ceph/
 %dir %{_sysconfdir}/ceph/
 /usr/sbin/rcceph
-# not sure why I need to list those for CentOS although they're removed in install
-%if 0%{defined centos_version}
-%{python_sitelib}/rados.pyc
-%{python_sitelib}/rbd.pyc
-%{python_sitelib}/rgw.pyc
-%endif
 %{_libdir}/rados-classes/libcls_rbd.so.*
 %{_libdir}/rados-classes/libcls_rgw.so.*
 
@@ -483,11 +473,8 @@ fi
 #################################################################################
 %files -n python-ceph
 %defattr(-,root,root,-)
-%{python_sitelib}/rados.py
-%{python_sitelib}/rados.pyo
-%{python_sitelib}/rbd.py
-%{python_sitelib}/rbd.pyo
-%{python_sitelib}/rgw.py
-%{python_sitelib}/rgw.pyo
+%{python_sitelib}/rados.py*
+%{python_sitelib}/rbd.py*
+%{python_sitelib}/rgw.py*
 
 %changelog
-- 
1.7.7.5

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ceph spec] package *.py* files
  2012-01-17 19:22 [PATCH] [ceph spec] package *.py* files Alexandre Oliva
@ 2012-01-19 17:35 ` Holger Macht
  2012-01-20  0:26   ` Alexandre Oliva
  0 siblings, 1 reply; 8+ messages in thread
From: Holger Macht @ 2012-01-19 17:35 UTC (permalink / raw)
  To: ceph-devel

Alexandre Oliva <oliva <at> lsd.ic.unicamp.br> writes:

> 
> Some post-install rpmbuild defaults byte-compile all packaged python
> files, so don't bother removing the .pyc files, and package .py* to
> get both .pyo and .pyc.  It wastes a tiny little bit of space, but it
> makes the spec file portable across a wider range of rpm and python
> configurations.

Just wondering...do you have a concrete issue or an example where this is a 
problem?

Regards
 Holger



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ceph spec] package *.py* files
  2012-01-19 17:35 ` Holger Macht
@ 2012-01-20  0:26   ` Alexandre Oliva
  2012-01-20 15:03     ` Holger Macht
  0 siblings, 1 reply; 8+ messages in thread
From: Alexandre Oliva @ 2012-01-20  0:26 UTC (permalink / raw)
  To: Holger Macht; +Cc: ceph-devel

On Jan 19, 2012, Holger Macht <hmacht@suse.de> wrote:

> Alexandre Oliva <oliva <at> lsd.ic.unicamp.br> writes:
>> 
>> Some post-install rpmbuild defaults byte-compile all packaged python
>> files, so don't bother removing the .pyc files, and package .py* to
>> get both .pyo and .pyc.  It wastes a tiny little bit of space, but it
>> makes the spec file portable across a wider range of rpm and python
>> configurations.

> Just wondering...do you have a concrete issue or an example where this is a 
> problem?

It failed to build on a BLAGified Fedora 16, complaining about the
unpackaged .pyc files.  It's not just CentOS that creates the .pyc files
in brp-python-bytecompile.  Plus, they should be packaged (if at all) in
python-ceph, but definitely not in the main ceph package.


Another issue I forgot while posting the patch was that there was not a
.tar.bz2 available from the ceph site.  I ended up recompressing the .gz
as .bz2, but if ceph is going to be released compressed as .gz, the spec
file ought to be adjusted to reflect that.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ceph spec] package *.py* files
  2012-01-20  0:26   ` Alexandre Oliva
@ 2012-01-20 15:03     ` Holger Macht
  2012-01-20 23:28       ` Alexandre Oliva
  0 siblings, 1 reply; 8+ messages in thread
From: Holger Macht @ 2012-01-20 15:03 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: ceph-devel

On Thu 19. Jan - 22:26:09, Alexandre Oliva wrote:
> On Jan 19, 2012, Holger Macht <hmacht@suse.de> wrote:
> 
> > Alexandre Oliva <oliva <at> lsd.ic.unicamp.br> writes:
> >> 
> >> Some post-install rpmbuild defaults byte-compile all packaged python
> >> files, so don't bother removing the .pyc files, and package .py* to
> >> get both .pyo and .pyc.  It wastes a tiny little bit of space, but it
> >> makes the spec file portable across a wider range of rpm and python
> >> configurations.
> 
> > Just wondering...do you have a concrete issue or an example where this is a 
> > problem?
> 
> It failed to build on a BLAGified Fedora 16, complaining about the
> unpackaged .pyc files.  It's not just CentOS that creates the .pyc files
> in brp-python-bytecompile.  

So the built failed because *.pyo was there and *.pyc wasn't? That is
really strange, because I really don't think both are needed. But sure,
there might be python configurations out there I don't know of, which
can't handle pyo but can do fine with pyc. So maybe we should just
always put pyc files in for maximum compatibility across distributions?

Otherwise, if this really makes the build fail for some distributions,
go for it. I will not argue about the different build systems because 1)
I don't know enough about them (including the one from SUSE) and 2) I
don't won't to dig to deep because of some minor issue like this.

> Plus, they should be packaged (if at all) in python-ceph, but
> definitely not in the main ceph package.

They are packaged in python-ceph.

> Another issue I forgot while posting the patch was that there was not a
> .tar.bz2 available from the ceph site.  I ended up recompressing the .gz
> as .bz2, but if ceph is going to be released compressed as .gz, the spec
> file ought to be adjusted to reflect that.

My fault. I also recompressed them at the very start of working on the
spec file and changed it accordingly, but I'm fine for changing this
back to .gz.

Regards
 Holger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ceph spec] package *.py* files
  2012-01-20 15:03     ` Holger Macht
@ 2012-01-20 23:28       ` Alexandre Oliva
  2012-01-20 23:36         ` Sage Weil
  2012-01-24 20:26         ` Holger Macht
  0 siblings, 2 replies; 8+ messages in thread
From: Alexandre Oliva @ 2012-01-20 23:28 UTC (permalink / raw)
  To: Holger Macht; +Cc: ceph-devel

On Jan 20, 2012, Holger Macht <hmacht@suse.de> wrote:

> On Thu 19. Jan - 22:26:09, Alexandre Oliva wrote:
>> On Jan 19, 2012, Holger Macht <hmacht@suse.de> wrote:
>> 
>> > Alexandre Oliva <oliva <at> lsd.ic.unicamp.br> writes:
>> >> 
>> >> Some post-install rpmbuild defaults byte-compile all packaged python
>> >> files, so don't bother removing the .pyc files, and package .py* to
>> >> get both .pyo and .pyc.  It wastes a tiny little bit of space, but it
>> >> makes the spec file portable across a wider range of rpm and python
>> >> configurations.
>> 
>> > Just wondering...do you have a concrete issue or an example where this is a 
>> > problem?
>> 
>> It failed to build on a BLAGified Fedora 16, complaining about the
>> unpackaged .pyc files.  It's not just CentOS that creates the .pyc files
>> in brp-python-bytecompile.  

> So the built failed because *.pyo was there and *.pyc wasn't?

No, both were there, but the .pyc was (correctly) flagged as not
packaged.

> So maybe we should just always put pyc files in for maximum
> compatibility across distributions?

Yeah.

> Otherwise, if this really makes the build fail for some distributions,

The CentOS-only .pyc packaging did not cover other distros that required
it, such as Fedora and BLAG, yes.

>> Plus, they should be packaged (if at all) in python-ceph, but
>> definitely not in the main ceph package.

> They are packaged in python-ceph.

No, look at the patch.  The ugly work-around to package .pyc files on
CentOS only was not in python-ceph.

> My fault. I also recompressed them at the very start of working on the
> spec file and changed it accordingly, but I'm fine for changing this
> back to .gz.

I'd rather use the smallest available tarball, but we should use
whatever ceph publishes.  If it's going to be .gz from now on, we have
to change the spec file.

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ceph spec] package *.py* files
  2012-01-20 23:28       ` Alexandre Oliva
@ 2012-01-20 23:36         ` Sage Weil
  2012-01-24 20:18           ` Holger Macht
  2012-01-24 20:26         ` Holger Macht
  1 sibling, 1 reply; 8+ messages in thread
From: Sage Weil @ 2012-01-20 23:36 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: Holger Macht, ceph-devel

On Fri, 20 Jan 2012, Alexandre Oliva wrote:
> On Jan 20, 2012, Holger Macht <hmacht@suse.de> wrote:
> > So maybe we should just always put pyc files in for maximum
> > compatibility across distributions?
> 
> Yeah.

I should apply this, then?

> > My fault. I also recompressed them at the very start of working on the
> > spec file and changed it accordingly, but I'm fine for changing this
> > back to .gz.
> 
> I'd rather use the smallest available tarball, but we should use
> whatever ceph publishes.  If it's going to be .gz from now on, we have
> to change the spec file.

I'll start doing .bz2 (in addition to .gz) with 0.41.

Thanks!
sage


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ceph spec] package *.py* files
  2012-01-20 23:36         ` Sage Weil
@ 2012-01-24 20:18           ` Holger Macht
  0 siblings, 0 replies; 8+ messages in thread
From: Holger Macht @ 2012-01-24 20:18 UTC (permalink / raw)
  To: Sage Weil; +Cc: Alexandre Oliva, ceph-devel

On Fr 20. Jan - 15:36:45, Sage Weil wrote:
> On Fri, 20 Jan 2012, Alexandre Oliva wrote:
> > On Jan 20, 2012, Holger Macht <hmacht@suse.de> wrote:
> > > So maybe we should just always put pyc files in for maximum
> > > compatibility across distributions?
> > 
> > Yeah.
> 
> I should apply this, then?

Ok, fine with me.

> 
> > > My fault. I also recompressed them at the very start of working on the
> > > spec file and changed it accordingly, but I'm fine for changing this
> > > back to .gz.
> > 
> > I'd rather use the smallest available tarball, but we should use
> > whatever ceph publishes.  If it's going to be .gz from now on, we have
> > to change the spec file.
> 
> I'll start doing .bz2 (in addition to .gz) with 0.41.

Thanks,
 Holger

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] [ceph spec] package *.py* files
  2012-01-20 23:28       ` Alexandre Oliva
  2012-01-20 23:36         ` Sage Weil
@ 2012-01-24 20:26         ` Holger Macht
  1 sibling, 0 replies; 8+ messages in thread
From: Holger Macht @ 2012-01-24 20:26 UTC (permalink / raw)
  To: Alexandre Oliva; +Cc: ceph-devel

On Fr 20. Jan - 21:28:56, Alexandre Oliva wrote:
> On Jan 20, 2012, Holger Macht <hmacht@suse.de> wrote:
> 
> > On Thu 19. Jan - 22:26:09, Alexandre Oliva wrote:
> >> On Jan 19, 2012, Holger Macht <hmacht@suse.de> wrote:
> >> 
> >> > Alexandre Oliva <oliva <at> lsd.ic.unicamp.br> writes:
> >> >> 
> >> >> Some post-install rpmbuild defaults byte-compile all packaged python
> >> >> files, so don't bother removing the .pyc files, and package .py* to
> >> >> get both .pyo and .pyc.  It wastes a tiny little bit of space, but it
> >> >> makes the spec file portable across a wider range of rpm and python
> >> >> configurations.
> >> 
> >> > Just wondering...do you have a concrete issue or an example where this is a 
> >> > problem?
> >> 
> >> It failed to build on a BLAGified Fedora 16, complaining about the
> >> unpackaged .pyc files.  It's not just CentOS that creates the .pyc files
> >> in brp-python-bytecompile.  
> 
> > So the built failed because *.pyo was there and *.pyc wasn't?
> 
> No, both were there, but the .pyc was (correctly) flagged as not
> packaged.
> 
> > So maybe we should just always put pyc files in for maximum
> > compatibility across distributions?
> 
> Yeah.
> 
> > Otherwise, if this really makes the build fail for some distributions,
> 
> The CentOS-only .pyc packaging did not cover other distros that required
> it, such as Fedora and BLAG, yes.
> 
> >> Plus, they should be packaged (if at all) in python-ceph, but
> >> definitely not in the main ceph package.
> 
> > They are packaged in python-ceph.
> 
> No, look at the patch.  The ugly work-around to package .pyc files on
> CentOS only was not in python-ceph.

Ok, now I see.

Regards
 Holger

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-01-24 20:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-17 19:22 [PATCH] [ceph spec] package *.py* files Alexandre Oliva
2012-01-19 17:35 ` Holger Macht
2012-01-20  0:26   ` Alexandre Oliva
2012-01-20 15:03     ` Holger Macht
2012-01-20 23:28       ` Alexandre Oliva
2012-01-20 23:36         ` Sage Weil
2012-01-24 20:18           ` Holger Macht
2012-01-24 20:26         ` Holger Macht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.