diff --git a/macros.python b/macros.python index a4c2fc8..89cd845 100644 --- a/macros.python +++ b/macros.python @@ -16,22 +16,26 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --ski package = rpm.expand("%{?1:%{1}}");\ vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}") if (string.starts(package, "python2-")) then\ - str = "Provides: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr;\ - print(rpm.expand(str));\ + if (rpm.expand("%{?buildarch}") ~= "noarch") then\ + str = "Provides: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr;\ + print(rpm.expand(str));\ + end\ print("\\nProvides: python-");\ print(string.sub(package,9,string.len(package)));\ print(" = ");\ print(vr);\ --Obsoleting the previous default python package\ - str = "\\nObsoletes: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} < " .. vr;\ - print(rpm.expand(str));\ + if (rpm.expand("%{?buildarch}") ~= "noarch") then\ + str = "\\nObsoletes: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} < " .. vr;\ + print(rpm.expand(str));\ + end\ print("\\nObsoletes: python-");\ print(string.sub(package,9,string.len(package)));\ print(" < ");\ print(vr);\ elseif (string.starts(str, "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(str, "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\ diff --git a/macros.python-srpm b/macros.python-srpm index b515582..274e1c8 100644 --- a/macros.python-srpm +++ b/macros.python-srpm @@ -2,7 +2,8 @@ # a specific version (e.g. 34 in Fedora EPEL7) %python3_pkgversion 34 #python3_other_pkgversion 35 -# Set to /bin/true when not active to avoid %ifdefs in specfiles + +# Set to /bin/true when not active 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 52a97a2..d40d597 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 4%{?dist}.1 +Release: 5%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -61,6 +61,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %changelog +* Thu Jan 14 2016 Orion Poplawski 3-5 +- Handle noarch python sub-packages (bug #1290900) + * Thu Jan 14 2016 Orion Poplawski 3-4.1 - EPEL version