Handle noarch python sub-packages (bug #1290900)

This commit is contained in:
Orion Poplawski 2016-01-14 16:17:51 -07:00
parent 608a3b9b3b
commit f16464f0b6
2 changed files with 7 additions and 4 deletions

View File

@ -16,7 +16,7 @@ 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\
if (rpm.expand("%{?buildarch}") != "noarch") then\
if (rpm.expand("%{?buildarch}") ~= "noarch") then\
str = "Provides: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} = " .. vr;\
print(rpm.expand(str));\
end\
@ -25,7 +25,7 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --ski
print(" = ");\
print(vr);\
--Obsoleting the previous default python package\
if (rpm.expand("%{?buildarch}") != "noarch") then\
if (rpm.expand("%{?buildarch}") ~= "noarch") then\
str = "\\nObsoletes: python-" .. string.sub(package,9,string.len(package)) .. "%{?_isa} < " .. vr;\
print(rpm.expand(str));\
end\
@ -35,7 +35,7 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --ski
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\

View File

@ -1,6 +1,6 @@
Name: python-rpm-macros
Version: 3
Release: 4%{?dist}
Release: 5%{?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 <orion@cora.nwra.com> 3-5
- Handle noarch python sub-packages (bug #1290900)
* Wed Jan 13 2016 Orion Poplawski <orion@cora.nwra.com> 3-4
- Fix python2/3-rpm-macros package names