From 2553290f9302b88f1f0b35b535e15c5b46b168f2 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 14 Jan 2016 20:34:31 -0700 Subject: [PATCH 1/5] Better error message from %python_provide --- macros.python | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.python b/macros.python index 89cd845..911f4c1 100644 --- a/macros.python +++ b/macros.python @@ -48,8 +48,8 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --ski print(" = ");\ print(vr);\ else\ - print("ERROR: ");\ + print("%python_provide: ERROR: ");\ print(package);\ - print("not recognized.");\ + print(" not recognized.");\ end\ } From 1a6f8f12f81e5c5a8686cb1944148d9291964f2b Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 14 Jan 2016 20:40:15 -0700 Subject: [PATCH 2/5] Move srpm macros to macros.0python-srpm to be defined before other macros --- macros.python-srpm | 8 -------- python-rpm-macros.spec | 9 ++++++--- 2 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 macros.python-srpm diff --git a/macros.python-srpm b/macros.python-srpm deleted file mode 100644 index 87ce887..0000000 --- a/macros.python-srpm +++ /dev/null @@ -1,8 +0,0 @@ -# python3_pkgversion specifies the version of Python 3 in the distro. It can be -# a specific version (e.g. 34 in Fedora EPEL7) -%python3_pkgversion 3 - -# Set to /bin/true to avoid %ifdefs and %{? in specfiles -%__python3_other /bin/true -%py3_other_build /bin/true -%py3_other_install /bin/true diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 577eb9f..a82e27a 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,11 +1,11 @@ Name: python-rpm-macros Version: 3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: The unversioned Python RPM macros License: MIT Source0: macros.python -Source1: macros.python-srpm +Source1: macros.0python-srpm Source2: macros.python2 Source3: macros.python3 @@ -57,7 +57,7 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %{_rpmconfigdir}/macros.d/macros.python %files -n python-srpm-macros -%{_rpmconfigdir}/macros.d/macros.python-srpm +%{_rpmconfigdir}/macros.d/macros.0python-srpm %files -n python2-rpm-macros %{_rpmconfigdir}/macros.d/macros.python2 @@ -67,6 +67,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %changelog +* Thu Jan 14 2016 Orion Poplawski 3-6 +- Move srpm macros to macros.0python-srpm to be defined before other macros + * Thu Jan 14 2016 Orion Poplawski 3-5 - Handle noarch python sub-packages (bug #1290900) From 34f5f4c7a47863cc9951ed4873aa45ccef963c3b Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 14 Jan 2016 20:48:02 -0700 Subject: [PATCH 3/5] Fix typo in %python_provide --- macros.python | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.python b/macros.python index 911f4c1..0a7ed0a 100644 --- a/macros.python +++ b/macros.python @@ -33,9 +33,9 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --ski print(string.sub(package,9,string.len(package)));\ print(" < ");\ print(vr);\ - elseif (string.starts(str, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then\ + elseif (string.starts(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then\ --No unversioned provides as python3 is not default\ - elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(str, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then\ + elseif (rpm.expand("%{?python3_other_pkgversion}") ~= "" and string.starts(package, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then\ --No unversioned provides as python3_other is not default\ elseif (string.starts(package, "pypy-")) then\ --No unversioned provides as pypy is not default\ From 49ccad99b2f218aef8c77b69688801f779f7f6b8 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 14 Jan 2016 20:49:29 -0700 Subject: [PATCH 4/5] Revert "Move srpm macros to macros.0python-srpm to be defined before other macros" This reverts commit 1a6f8f12f81e5c5a8686cb1944148d9291964f2b. --- macros.python-srpm | 8 ++++++++ python-rpm-macros.spec | 9 +++------ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 macros.python-srpm diff --git a/macros.python-srpm b/macros.python-srpm new file mode 100644 index 0000000..87ce887 --- /dev/null +++ b/macros.python-srpm @@ -0,0 +1,8 @@ +# python3_pkgversion specifies the version of Python 3 in the distro. It can be +# a specific version (e.g. 34 in Fedora EPEL7) +%python3_pkgversion 3 + +# Set to /bin/true to avoid %ifdefs and %{? in specfiles +%__python3_other /bin/true +%py3_other_build /bin/true +%py3_other_install /bin/true diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index a82e27a..577eb9f 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,11 +1,11 @@ Name: python-rpm-macros Version: 3 -Release: 6%{?dist} +Release: 5%{?dist} Summary: The unversioned Python RPM macros License: MIT Source0: macros.python -Source1: macros.0python-srpm +Source1: macros.python-srpm Source2: macros.python2 Source3: macros.python3 @@ -57,7 +57,7 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %{_rpmconfigdir}/macros.d/macros.python %files -n python-srpm-macros -%{_rpmconfigdir}/macros.d/macros.0python-srpm +%{_rpmconfigdir}/macros.d/macros.python-srpm %files -n python2-rpm-macros %{_rpmconfigdir}/macros.d/macros.python2 @@ -67,9 +67,6 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %changelog -* Thu Jan 14 2016 Orion Poplawski 3-6 -- Move srpm macros to macros.0python-srpm to be defined before other macros - * Thu Jan 14 2016 Orion Poplawski 3-5 - Handle noarch python sub-packages (bug #1290900) From 2b90e4a07b5b119f2f65cf28f28fce23bda8a159 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 14 Jan 2016 20:50:53 -0700 Subject: [PATCH 5/5] Fix typo in %python_provide --- python-rpm-macros.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 577eb9f..19453b4 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 5%{?dist} +Release: 6%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -67,6 +67,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %changelog +* Thu Jan 14 2016 Orion Poplawski 3-6 +- Fix typo in %%python_provide + * Thu Jan 14 2016 Orion Poplawski 3-5 - Handle noarch python sub-packages (bug #1290900)