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
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