From f798c4335426a9c900a42ed28f34402416b0f4f8 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Tue, 15 Nov 2016 16:12:23 -0700 Subject: [PATCH] Add %py_build_egg and %py_install_egg macros --- macros.python | 9 +++++++++ macros.python2 | 10 ++++++++++ macros.python3 | 10 ++++++++++ 3 files changed, 29 insertions(+) diff --git a/macros.python b/macros.python index 2913a27..710678e 100644 --- a/macros.python +++ b/macros.python @@ -5,10 +5,19 @@ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?*} } +%py_build_egg() %{expand: + CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_egg --executable="%{__python2} %{py_shbang_opts}" %{?*} +} + %py_install() %{expand: CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} } +%py_install_egg() %{expand: + mkdir -p %{buildroot}%{python_sitelib} + easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*} +} + %python_provide() %{lua: function string.starts(String,Start) return string.sub(String,1,string.len(Start))==Start diff --git a/macros.python2 b/macros.python2 index a79b941..b5bc98a 100644 --- a/macros.python2 +++ b/macros.python2 @@ -11,6 +11,16 @@ sleep 1 } +%py2_build_egg() %{expand: + CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_egg --executable="%{__python2} %{py2_shbang_opts}" %{?*} + sleep 1 +} + %py2_install() %{expand: CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} } + +%py2_install_egg() %{expand: + mkdir -p %{buildroot}%{python2_sitelib} + easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*} +} diff --git a/macros.python3 b/macros.python3 index 665f9f2..fcf9964 100644 --- a/macros.python3 +++ b/macros.python3 @@ -12,6 +12,16 @@ sleep 1 } +%py3_build_egg() %{expand: + CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_egg --executable="%{__python3} %{py3_shbang_opts}" %{?*} + sleep 1 +} + %py3_install() %{expand: CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} } + +%py3_install_egg() %{expand: + mkdir -p %{buildroot}%{python3_sitelib} + easy_install-%{python3_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*} +}