From e7af332922fbd543df3844d56313cd1f8b2d336c Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Nov 16 2016 23:28:31 +0000 Subject: Add missing sleeps to other build macros - Fix build_egg macros - Add %py_build_wheel and %py_install_wheel macros --- diff --git a/macros.python b/macros.python index 710678e..a0311ca 100644 --- a/macros.python +++ b/macros.python @@ -3,10 +3,17 @@ %py_build() %{expand: CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?*} + sleep 1 } %py_build_egg() %{expand: - CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_egg --executable="%{__python2} %{py_shbang_opts}" %{?*} + CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*} + sleep 1 +} + +%py_build_wheel() %{expand: + CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} + sleep 1 } %py_install() %{expand: @@ -18,6 +25,10 @@ easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*} } +%py_install_wheel() %{expand: + pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} +} + %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 b5bc98a..81e3aa5 100644 --- a/macros.python2 +++ b/macros.python2 @@ -12,7 +12,12 @@ } %py2_build_egg() %{expand: - CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_egg --executable="%{__python2} %{py2_shbang_opts}" %{?*} + CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*} + sleep 1 +} + +%py2_build_wheel() %{expand: + CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} sleep 1 } @@ -24,3 +29,7 @@ mkdir -p %{buildroot}%{python2_sitelib} easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*} } + +%py2_install_wheel() %{expand: + pip%{python2_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} +} diff --git a/macros.python3 b/macros.python3 index fcf9964..984dbcd 100644 --- a/macros.python3 +++ b/macros.python3 @@ -13,7 +13,12 @@ } %py3_build_egg() %{expand: - CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_egg --executable="%{__python3} %{py3_shbang_opts}" %{?*} + CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*} + sleep 1 +} + +%py3_build_wheel() %{expand: + CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} sleep 1 } @@ -25,3 +30,6 @@ mkdir -p %{buildroot}%{python3_sitelib} easy_install-%{python3_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*} } + +%py3_install_wheel() %{expand: + pip%{python3_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index a1cfffa..62c7977 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 12%{?dist} +Release: 13%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -69,6 +69,11 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %changelog +* Wed Nov 16 2016 Orion Poplawski 3-13 +- Add missing sleeps to other build macros +- Fix build_egg macros +- Add %%py_build_wheel and %%py_install_wheel macros + * Tue Nov 15 2016 Orion Poplawski 3-12 - Add %%py_build_egg and %%py_install_egg macros - Allow multiple args to %%py_build/install macros