Bug 731800

Summary: Add a %python2_version rpm macro
Product: [Fedora] Fedora Reporter: Garrett Holmstrom <gholms>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: dmalcolm, ivazqueznet, jonathansteffan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-2.7.2-5.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-08-18 20:17:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Garrett Holmstrom 2011-08-18 17:50:01 UTC
Description of problem:
The rpm package provides a useful %python_version macro:
%(%{__python} -c "import sys; sys.stdout.write(sys.version[:3])")

Could we have a similar %python2_version macro as well?


Version-Release number of selected component (if applicable):
python-2.7-8.fc14.1.x86_64


Steps to Reproduce:
rpm --eval %python2_version

  
Actual results:
%python2_version


Expected results:
2.7


Additional info:
%python_version is defined in /usr/lib/rpm/macros.  rpm owns this, so this bug may actually belong to rpm.

Related: bug #719082's request for a %python3_version macro

Comment 1 Dave Malcolm 2011-08-18 19:28:19 UTC
New "macros.python2" file committed/pushed to git as:
http://pkgs.fedoraproject.org/gitweb/?p=python.git;a=commitdiff;h=85867c0a81ff2e52d71e69dc846a3c0efd3fed46


With this applied locally, I get the following on this box:
$ rpm --eval %python2_version
2.7

For consistency, I also added these macros:
$ rpm --eval %__python2
/usr/bin/python2
$ rpm --eval %python2_sitelib
/usr/lib/python2.7/site-packages
$ rpm --eval %python2_sitearch
/usr/lib64/python2.7/site-packages


Building python-2.7.2-5.fc17 for dist-rawhide
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=3284636