From 5ca1f525e5551e4c80d4168e5eebd56c95eda531 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Thu, 24 Nov 2016 07:53:47 -0700 Subject: [PATCH] Make expaned macros start on the same line as the macro --- macros.python | 14 ++++++++------ macros.python2 | 14 ++++++++------ macros.python3 | 14 ++++++++------ python-rpm-macros.spec | 5 ++++- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/macros.python b/macros.python index a0311ca..aab13c0 100644 --- a/macros.python +++ b/macros.python @@ -1,31 +1,33 @@ %py_setup setup.py %py_shbang_opts -s -%py_build() %{expand: +# Use the slashes after expand so that the command starts on the same line as +# the macro +%py_build() %{expand:\\\ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py_shbang_opts}" %{?*} sleep 1 } -%py_build_egg() %{expand: +%py_build_egg() %{expand:\\\ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*} sleep 1 } -%py_build_wheel() %{expand: +%py_build_wheel() %{expand:\\\ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} sleep 1 } -%py_install() %{expand: +%py_install() %{expand:\\\ CFLAGS="%{optflags}" %{__python} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} } -%py_install_egg() %{expand: +%py_install_egg() %{expand:\\\ mkdir -p %{buildroot}%{python_sitelib} easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*} } -%py_install_wheel() %{expand: +%py_install_wheel() %{expand:\\\ pip install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} } diff --git a/macros.python2 b/macros.python2 index 81e3aa5..420544b 100644 --- a/macros.python2 +++ b/macros.python2 @@ -6,30 +6,32 @@ %py2_shbang_opts -s -%py2_build() %{expand: +# Use the slashes after expand so that the command starts on the same line as +# the macro +%py2_build() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} build --executable="%{__python2} %{py2_shbang_opts}" %{?*} sleep 1 } -%py2_build_egg() %{expand: +%py2_build_egg() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_egg %{?*} sleep 1 } -%py2_build_wheel() %{expand: +%py2_build_wheel() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} sleep 1 } -%py2_install() %{expand: +%py2_install() %{expand:\\\ CFLAGS="%{optflags}" %{__python2} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} } -%py2_install_egg() %{expand: +%py2_install_egg() %{expand:\\\ mkdir -p %{buildroot}%{python2_sitelib} easy_install-%{python2_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python2_version}.egg %{?*} } -%py2_install_wheel() %{expand: +%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 2cabc40..c81cf3f 100644 --- a/macros.python3 +++ b/macros.python3 @@ -7,30 +7,32 @@ %py3_shbang_opts -s -%py3_build() %{expand: +# Use the slashes after expand so that the command starts on the same line as +# the macro +%py3_build() %{expand:\\\ CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*} sleep 1 } -%py3_build_egg() %{expand: +%py3_build_egg() %{expand:\\\ CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*} sleep 1 } -%py3_build_wheel() %{expand: +%py3_build_wheel() %{expand:\\\ CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} sleep 1 } -%py3_install() %{expand: +%py3_install() %{expand:\\\ CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} } -%py3_install_egg() %{expand: +%py3_install_egg() %{expand:\\\ mkdir -p %{buildroot}%{python3_sitelib} easy_install-%{python3_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*} } -%py3_install_wheel() %{expand: +%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 ed94d9d..055a3f0 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 14%{?dist} +Release: 15%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -69,6 +69,9 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %changelog +* Thu Nov 24 2016 Orion Poplawski 3-15 +- Make expaned macros start on the same line as the macro + * Wed Nov 16 2016 Orion Poplawski 3-14 - Fix %%py3_install_wheel (bug #1395953)