Single generic package for python 2.x

Raphaël De GIUSTI raphael.degiusti at guardis.com
Thu Jan 12 15:05:17 UTC 2012


On Thu, Jan 12, 2012 at 12:13 PM, Panu Matilainen
<pmatilai at laiskiainen.org>wrote:

> On 01/12/2012 12:41 PM, Raphaël De GIUSTI wrote:
>
>> I have a python application, it can run on Python>= 2.6 and it's
>> architecture independant.
>> I need the rpm package of this application to be installed on Fedora 14
>> (python 2.7) and Centos 6.2 (python 2.6).
>> I currently use mock to build one rpm package for each "flavour" and it
>> works well.
>>
>> Do I really have to use mock and build 2 rpms or is there another way to
>> create a single generic python 2.x rpm package ?
>>
>> Because apparently I can't install the Centos compiled rpm on Fedora.
>> It gives me this error message :
>>
>> ******************************************************************
>> error: Failed dependencies:
>> python(abi) = 2.6 is needed by myapp-0.9.el6.noarch
>> ******************************************************************
>>
>> Here is the relevant part of my .spec file :
>>
>> ****************************************************************
>> ****************************************************************
>> *********************************************
>> %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from
>> distutils.sysconfig import get_python_lib; print(get_python_lib())")}
>> %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from
>> distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
>>
>
> If the software installs anything into python library paths, then it the
> resulting *package* is dependent on the python version used when building:
> eg python 2.6 will not look into python 2.7 library paths, so it will not
> work.
>
> In addition there's the issue (which rpm dependencies dont currently
> enforce) with any of byte-compiled files (.pyc and .pyo) included in the
> package: they should be compiled with the version of python used to run
> them. IIRC python silently falls back to non-bytecompiled versions on
> version mismatch if it cannot replace the byte-compiled files, so it works
> but non-optimally. And if run as root, python will silently rewrite the
> byte-compiled versions which in turn causes rpm verify to light up like a
> x-mas tree.
>
> So yes, you should really build separate packages for distros where the
> python version differs.
>
>        - Panu -
>
> ______________________________**_________________
> Rpm-list mailing list
> Rpm-list at lists.rpm.org
> http://lists.rpm.org/mailman/**listinfo/rpm-list<http://lists.rpm.org/mailman/listinfo/rpm-list>
>

Thank you for your answer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-list/attachments/20120112/a59021a4/attachment.html>


More information about the Rpm-list mailing list