diff --git a/macros.python2 b/macros.python2 index 789ca09..66e9c5a 100644 --- a/macros.python2 +++ b/macros.python2 @@ -1,8 +1,8 @@ -%__python2 /usr/bin/python2 +%__python2 /usr/bin/python2.6 %python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -%python2_version %(%{__python2} -c "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") -%python2_version_nodots %(%{__python2} -c "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") +%python2_version %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3])") +%python2_version_nodots %(%{__python2} -c "import sys; sys.stdout.write(sys.version[:3:2])") %py2_shbang_opts -s diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 51b5e40..f2c2bff 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 10%{?dist} +Release: 11%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -44,25 +44,33 @@ RPM macros for building Python 3 packages. %build %install -mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d/ +mkdir -p %{buildroot}/%{rpmmacrodir} install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ - %{buildroot}/%{_rpmconfigdir}/macros.d/ + %{buildroot}/%{rpmmacrodir} %files -%{_rpmconfigdir}/macros.d/macros.python +%{rpmmacrodir}/macros.python %files -n python-srpm-macros -%{_rpmconfigdir}/macros.d/macros.python-srpm +%{rpmmacrodir}/macros.python-srpm %files -n python2-rpm-macros -%{_rpmconfigdir}/macros.d/macros.python2 +%{rpmmacrodir}/macros.python2 %files -n python3-rpm-macros -%{_rpmconfigdir}/macros.d/macros.python3 +%{rpmmacrodir}/macros.python3 %changelog +* Thu Sep 15 2016 Jason L Tibbitts III - 3-11 +- Use %%rpmmacrodir to put the macros in the proper location. +- Change %%python2_version* to a form that works on EL6. +- Change %%__python2 to point explicitly to python2.6 to avoid breakage in + Amazon Linux, which links /usr/bin/python to python2.7. This syncs up with + the macros which were in epel-rpm-macros. See + https://bugzilla.redhat.com/show_bug.cgi?id=1347019 + * Tue Jul 12 2016 Orion Poplawski 3-10 - Do not generate useless Obsoletes with %%{?_isa}