From 8ef228123aaa5150878bfdbe10f06237c71a74ed Mon Sep 17 00:00:00 2001 From: Tadej Janež Date: Jun 21 2018 19:54:43 +0000 Subject: Add %python3_other_* counterparts for %python3_* macros in EPEL 7 --- diff --git a/macros.python3 b/macros.python3 index d313235..2313da2 100644 --- a/macros.python3 +++ b/macros.python3 @@ -1,5 +1,4 @@ %__python3 /usr/bin/python3.4 -%__python3_other /usr/bin/python3.6 %python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python3_sitearch %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") diff --git a/macros.python3_other b/macros.python3_other new file mode 100644 index 0000000..a15dca5 --- /dev/null +++ b/macros.python3_other @@ -0,0 +1,38 @@ +%__python3_other /usr/bin/python3.6 + +%python3_other_sitelib %(%{__python3_other} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") +%python3_other_sitearch %(%{__python3_other} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") +%python3_other_version %(%{__python3_other} -c "import sys; sys.stdout.write(sys.version[:3])") +%python3_other_version_nodots %(%{__python3_other} -c "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") + +%py3_other_shbang_opts -s + +# Use the slashes after expand so that the command starts on the same line as +# the macro +%py3_other_build() %{expand:\\\ + CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} build --executable="%{__python3_other} %{py3_other_shbang_opts}" %{?*} + sleep 1 +} + +%py3_other_build_egg() %{expand:\\\ + CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} bdist_egg %{?*} + sleep 1 +} + +%py3_other_build_wheel() %{expand:\\\ + CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} + sleep 1 +} + +%py3_other_install() %{expand:\\\ + CFLAGS="%{optflags}" %{__python3_other} %{py_setup} %{?py_setup_args} install -O1 --skip-build --root %{buildroot} %{?*} +} + +%py3_other_install_egg() %{expand:\\\ + mkdir -p %{buildroot}%{python3_other_sitelib} + easy_install-%{python3_other_version} -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_other_version}.egg %{?*} +} + +%py3_other_install_wheel() %{expand:\\\ + pip%{python3_other_version} install -I dist/%{1} --root %{buildroot} --strip-file-prefix %{buildroot} --no-deps +} diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 6d8aea2..7ee0f1e 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 19%{?dist} +Release: 20%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -8,6 +8,7 @@ Source0: macros.python Source1: macros.python-srpm Source2: macros.python2 Source3: macros.python3 +Source4: macros.python3_other BuildArch: noarch # For %%python3_pkgversion used in %%python_provide @@ -45,7 +46,7 @@ RPM macros for building Python 3 packages. %install mkdir -p %{buildroot}/%{rpmmacrodir} -install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ +install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %{buildroot}/%{rpmmacrodir}/ @@ -60,9 +61,13 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} \ %files -n python3-rpm-macros %{rpmmacrodir}/macros.python3 +%{rpmmacrodir}/macros.python3_other %changelog +* Thu Jun 21 2018 Tadej Janež - 3-20 +- Add %%python3_other_* counterparts for %%python3_* macros in EPEL 7 + * Mon Jun 18 2018 Jason L Tibbitts III - 3-19 - Add %%pypi_source macro.