Bug 533022 - RFC: add /etc/rpm/macros.python to python-devel
RFC: add /etc/rpm/macros.python to python-devel
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
12
All Linux
low Severity medium
: ---
: ---
Assigned To: Dave Malcolm
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-04 13:06 EST by Dave Malcolm
Modified: 2010-12-03 22:30 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-12-03 22:30:29 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Patch to add the macros.python file (needs new source file and %changelog entry) (1.49 KB, patch)
2009-11-04 13:08 EST, Dave Malcolm
no flags Details | Diff

  None (edit)
Description Dave Malcolm 2009-11-04 13:06:55 EST
Proposal:
To add a file /etc/rpm/macros.python to the python-devel subpackage, containing these macros: 
%python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")

NB "__python" is defined in /usr/lib/rpm/macros as "/usr/bin/python"

This would avoid the need to define these macros in every specfile (assuming you had a recent enough python-devel).

I've tried doing something similar for python3-devel, see:
https://bugzilla.redhat.com/show_bug.cgi?id=526126#c43

One drawback is that the macro files are read (with rpmInitMacros) and
expanded on every rpm operation, which means that when python-devel is
installed, every "rpm" invocation is going to be quietly invoking
/usr/bin/python twice on startup.  None of the existing macro files seem to
invoke subprocess during expansion.
Comment 1 Dave Malcolm 2009-11-04 13:08:41 EST
Created attachment 367514 [details]
Patch to add the macros.python file (needs new source file and %changelog entry)
Comment 2 Dave Malcolm 2009-11-04 13:11:25 EST
Another way to do this would be to pre-evaluate the values, and bake them in to the macro file.  That would avoid invoking /usr/bin/python twice, but would make them not change if __python was redefined.
Comment 3 James Antill 2009-11-04 13:50:09 EST
 The python3 macro names should be %python3_sitelib and %python3_sitearch otherwise people are going to get screwed over as the value changes at different points in the specfile (depending on what __python points to). You shouldn't consider the specfile language a real programming language, IMO.
 So just pre-populating them should be fine.
Comment 4 Bug Zapper 2009-11-16 10:05:57 EST
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 5 Dave Malcolm 2010-01-22 17:30:06 EST
Panu: am I right in thinking that these macros are supplied now in F-13's rpm?
Comment 6 Bug Zapper 2010-11-04 02:48:19 EDT
This message is a reminder that Fedora 12 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 12.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '12'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 12's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 12 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 Bug Zapper 2010-12-03 22:30:29 EST
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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