From de213fa2bdc810d7a6982b3000692cd73308cbc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 11 Apr 2018 01:18:25 +0200 Subject: [PATCH] Add pypy2 macros --- macros.pypy2 | 4 ++++ pypy.spec | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 macros.pypy2 diff --git a/macros.pypy2 b/macros.pypy2 new file mode 100644 index 0000000..9058466 --- /dev/null +++ b/macros.pypy2 @@ -0,0 +1,4 @@ +%__pypy2 /usr/bin/pypy2 +%pypy2_sitelib %(%{__pypy2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") +%pypy2_sitearch %(%{__pypy2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") +%pypy2_version %(%{__pypy2} -c "import sys; sys.stdout.write(sys.version[:3])") diff --git a/pypy.spec b/pypy.spec index d1eb2fa..a0d90ce 100644 --- a/pypy.spec +++ b/pypy.spec @@ -1,7 +1,7 @@ %global basever 5.10 Name: pypy Version: %{basever}.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Python implementation with a Just-In-Time compiler Group: Development/Languages @@ -142,7 +142,9 @@ Source0: https://bitbucket.org/pypy/pypy/downloads/%{src_name}.tar.bz2 # Supply various useful RPM macros for building python modules against pypy: # __pypy, pypy_sitelib, pypy_sitearch -Source2: macros.%{name} +Source1: macros.%{name} +# __pypy2, pypy2_sitelib, pypy2_sitearch +Source2: macros.%{name}%{pymajorlibver} # Patch pypy.translator.platform so that stdout from "make" etc gets logged, # rather than just stderr, so that the command-line invocations of the compiler @@ -586,6 +588,7 @@ chrpath --delete %{buildroot}/%{pypyprefix}/bin/%{name} # Install macros for rpm: mkdir -p %{buildroot}/%{_rpmconfigdir}/macros.d +install -m 644 %{SOURCE1} %{buildroot}/%{_rpmconfigdir}/macros.d install -m 644 %{SOURCE2} %{buildroot}/%{_rpmconfigdir}/macros.d # Remove build script from the package @@ -756,6 +759,7 @@ CheckPyPy %{name}-c-stackless %{pypy_include_dir}/*.h %{pypy_include_dir}/_numpypy %{_rpmconfigdir}/macros.d/macros.%{name} +%{_rpmconfigdir}/macros.d/macros.%{name}%{pymajorlibver} %if 0%{with_stackless} %files stackless @@ -766,6 +770,9 @@ CheckPyPy %{name}-c-stackless %changelog +* Tue Apr 10 2018 Miro HronĨok - 5.10.0-3 +- RPM macros improvements + * Tue Mar 27 2018 Michal Cyprian - 5.10.0-2 - Remove the rightmost version number from the path - rhbz#1516885: https://bugzilla.redhat.com/show_bug.cgi?id=1516885