Merge branch 'master' into epel7

Conflicts:
	macros.python
	macros.python-srpm
	python-rpm-macros.spec
This commit is contained in:
Orion Poplawski 2016-01-14 16:22:53 -07:00
commit 68a7e6e10b
3 changed files with 15 additions and 7 deletions

View File

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

View File

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

View File

@ -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 <orion@cora.nwra.com> 3-5
- Handle noarch python sub-packages (bug #1290900)
* Thu Jan 14 2016 Orion Poplawski <orion@cora.nwra.com> 3-4.1
- EPEL version