Bug 521141

Summary: rpmbuild brp-python-bytecompile does not honor %{__python}
Product: [Fedora] Fedora Reporter: Bowe Strickland <bowe>
Component: redhat-rpm-configAssignee: Panu Matilainen <pmatilai>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 11CC: amcnabb, ffesti, jcm, jnovy, jonathan, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-02 09:56:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bowe Strickland 2009-09-03 20:26:05 UTC
developers can specify a different python interpreter by defining the __python macro.  although brp-python-bytecompile can use a custom python interpreter specified as $1, the default __os_install_post macro neglects to do so.

Suggest trivial fix to /usr/lib/rpm/redhat/macros:

    s:brp-python-bytecompile \:brp-python-bytecompile %{__python} \:

Comment 1 Panu Matilainen 2009-09-15 10:52:18 UTC
/usr/lib/rpm/redhat/macros is owned by redhat-rpm-config, not rpm itself...

Comment 2 Andrew McNabb 2009-09-28 21:59:52 UTC
I noticed this bug, too.  If you are building a Python RPM, brp-python-bytecompile will use the system Python for bytecompiling libraries.  The correct behavior is to use ./python (the newly built interpreter).  Unfortunately, looking at the __python macro probably isn't enough.  The correct interpreter also needs to be called with the environment LD_LIBRARY_PATH=".".

In cases like this, it would probably best for the RPM creator to manually run:

LD_LIBRARY_PATH=. /usr/lib/rpm/brp-python-bytecompile ./python

but there needs to be a way to disable automatic bytecompilation.

Comment 3 Panu Matilainen 2010-02-02 09:56:08 UTC
Fixed in rawhide as of redhat-rpm-config-9.1.0.