From 2c9745716c8a98153e9b5894b0400bbb16c33730 Mon Sep 17 00:00:00 2001 From: Jason Tibbitts Date: Sep 15 2016 20:12:19 +0000 Subject: Remove most python macros Remove all but two of the python macros and replace them with dependencies on the various subpackages of python-rpm-macros. --- diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 0a789da..589665b 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 6 -Release: 12 +Release: 13 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -13,12 +13,14 @@ URL: http://download.fedoraproject.org/pub/epel # Please see the file itself for an explanation of its odd name. Source0: macros.zzz-epel -Source1: macros.zzz-epel-python Source9: GPL -BuildArch: noarch -Requires: epel-release = %{version} +BuildArch: noarch +Requires: epel-release = %{version} +Requires: python-srpm-macros +Requires: python-rpm-macros +Requires: python2-rpm-macros %description This package contains some RPM macros which minimize the differences in the @@ -32,17 +34,22 @@ install -pm 644 %{SOURCE9} . %install install -Dpm 644 %{SOURCE0} \ %{buildroot}/etc/rpm/macros.zzz-epel -install -Dpm 644 %{SOURCE1} \ - %{buildroot}/etc/rpm/macros.zzz-epel-python %files # Explicitly don't use %%license so that this package can be built without this # package being installed. %doc GPL /etc/rpm/macros.zzz-epel -/etc/rpm/macros.zzz-epel-python %changelog +* Wed Aug 24 2016 Jason L Tibbitts III - 6-13 +- Drop python macros; they're in the python-rpm-macros package now. +- Add dependency on the python-rpm-macros packages so that EPEL6 packages don't + need to manually add a dep on them. (Python in RHEL6 can't be changed to + require them.) +- Move the two stub python3 definitions from the python macro file into the + main macro file. + * Thu Aug 11 2016 Jason L Tibbitts III - 6-12 - Add %%bash_completion_dir @@ -53,7 +60,7 @@ install -Dpm 644 %{SOURCE1} \ - Remove autosetup macros since they're now in RHEL 6.8. * Thu Apr 21 2016 Jason L Tibbitts III - 6-9 -- Add the %make_build macro. +- Add the %%make_build macro. * Tue Apr 19 2016 Jason L Tibbitts III - 6-8 - Add some python macros pulled from EPEL7. diff --git a/macros.zzz-epel b/macros.zzz-epel index a625d3a..55e72db 100644 --- a/macros.zzz-epel +++ b/macros.zzz-epel @@ -1,5 +1,4 @@ # EPEL6-specific macros - %epel 6 # This file is named such that it appears alphabetically after other macro @@ -34,5 +33,10 @@ # The useful make_build macro %make_build %{__make} %{?_smp_mflags} -# Bash completions. Not in bash to not interfere with install ordering. +# Bash completions. %bash_completion_dir /usr/share/bash-completion/ + +# Two stub defines to reduce the number of ifdefs you need to bring python +# packages down to EL6. +%py3_build %{nil} +%py3_install %{nil} diff --git a/macros.zzz-epel-python b/macros.zzz-epel-python deleted file mode 100644 index 5b4beba..0000000 --- a/macros.zzz-epel-python +++ /dev/null @@ -1,63 +0,0 @@ -# EPEL6-specific bits -%__python2 /usr/bin/python2.6 -%python2_sitelib %python_sitelib -%python2_sitearch %python_sitearch -%py3_build %{nil} -%py3_install %{nil} - -# Stock Python macros from EPEL7 -%py_setup setup.py -%py_shbang_opts -s - -%py2_build() %{expand: -CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?1} -} - -%py2_install() %{expand: -CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1} -} - -%python_provide() %{lua: - function string.starts(String,Start) - return string.sub(String,1,string.len(Start))==Start - end - package = rpm.expand("%{?1:%{1}}"); - vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}") - if (string.starts(package, "python2-")) then - 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 - 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(package, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then - --No unversioned provides as python3 is not default - 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 - elseif (string.starts(package, "pypy3-")) then - --No unversioned provides as pypy is not default - elseif (string.starts(package, "python-")) then - --Providing the current default python - print("Provides: python2-"); - print(string.sub(package,8,string.len(package))); - print(" = "); - print(vr); - else - print("%python_provide: ERROR: "); - print(package); - print(" not recognized."); - end -}