Bug 521141 - rpmbuild brp-python-bytecompile does not honor %{__python}
Summary: rpmbuild brp-python-bytecompile does not honor %{__python}
Alias: None
Product: Fedora
Classification: Fedora
Component: redhat-rpm-config
Version: 11
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2009-09-03 20:26 UTC by Bowe Strickland
Modified: 2010-02-02 09:56 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-02-02 09:56:08 UTC

Attachments (Terms of Use)

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.

Note You need to log in before you can comment on or make changes to this bug.