diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index b084d80..a7443b7 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 7 -Release: 5 +Release: 6 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -13,14 +13,21 @@ URL: http://download.fedoraproject.org/pub/epel Source0: macros.epel-rpm-macros Source1: GPL -BuildArch: noarch -Requires: redhat-release >= %{version} +BuildArch: noarch +Requires: redhat-release >= %{version} +# For python buildroot macros +Requires: python-srpm-macros +# Since the RHEL python-devel package doesn't require them, bring them in here +# python3-rpm-macros is brought in by python3X-devel +Requires: python-rpm-macros +Requires: python2-rpm-macros %description This package contains the Extra Packages for Enterprise Linux (EPEL) RPM macros for building EPEL packages. %prep +%setup -cT install -pm 644 %{SOURCE1} . %install @@ -34,6 +41,10 @@ install -Dpm 644 %{SOURCE0} \ %changelog +* Mon Jan 25 2016 Orion Poplawski 7-6 +- Bring in python macros via the python-rpm-macros packages +- Use %%setup so fedpkg local works + * Mon Jan 4 2016 Orion Poplawski 7-5 - Fix python_provide macro for EPEL7 python3 package names diff --git a/macros.epel-rpm-macros b/macros.epel-rpm-macros index d85526d..105c630 100644 --- a/macros.epel-rpm-macros +++ b/macros.epel-rpm-macros @@ -1,83 +1,3 @@ # epel macros %epel %{?rhel}%{!?rhel:7} - -# -# These are use for python3 in EPEL. -# See: https://fedoraproject.org/wiki/User:Orion/EPEL7_Python3 -# -%python3_pkgversion 34 -%python3_other_pkgversion 35 - -# -# Python macros, see: https://bugzilla.redhat.com/show_bug.cgi?id=1241655 -# -%py_setup setup.py -%py_shbang_opts -s - -%py_build() %{expand:\ -CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?1}\ -} - -%py_install() %{expand:\ -CFLAGS="%{optflags}" %{__python} %{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\ - str = rpm.expand("%{?1:%{1}}");\ - vr = rpm.expand("%{?epoch:%{epoch}:}%{version}-%{release}");\ - if (string.starts(str, "python2-")) then\ - print("Provides: python-");\ - print(string.sub(str,9,string.len(str)));\ - print(" = ");\ - print(vr);\ - --Obsoleting the previous default python package\ - print("\\nObsoletes: python-");\ - print(string.sub(str,9,string.len(str)));\ - print(" < ");\ - print(vr);\ - elseif (string.starts(str, "python3-")) then\ - --No unversioned provides as python3 is not default\ - elseif (string.starts(str, "python" .. rpm.expand("%{python3_pkgversion}") .. "-")) then\ - --No unversioned provides as python3 is not default\ - elseif (string.starts(str, "python" .. rpm.expand("%{python3_other_pkgversion}") .. "-")) then\ - --No unversioned provides as python3 is not default\ - elseif (string.starts(str, "pypy-")) then\ - --No unversioned provides as pypy is not default\ - elseif (string.starts(str, "pypy3-")) then\ - --No unversioned provides as pypy is not default\ - elseif (string.starts(str, "python-")) then\ - --Providing the current default python\ - print("Provides: python2-");\ - print(string.sub(str,8,string.len(str)));\ - print(" = ");\ - print(vr);\ - else\ - print("ERROR: ");\ - print(str);\ - print(" not recognized by %python_provide.");\ - end\ -} - -%py3_shbang_opts -s - -%py3_build() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?1}\ -} - -%py3_install() %{expand:\ -CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ -} - -%py2_shbang_opts -s - -%py2_build() %{expand:\ -CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?1}\ -} - -%py2_install() %{expand:\ -CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?1}\ -}