From 27985bbcb8631a6af65c76bde080577242960df5 Mon Sep 17 00:00:00 2001 From: Tomas Hrnciar Date: Tue, 10 Aug 2021 13:38:40 +0200 Subject: [PATCH] Add bcond main_pypy3 to differentiate whether package is main pypy package or not --- pypy3.7.spec | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/pypy3.7.spec b/pypy3.7.spec index a660404..33e04c9 100644 --- a/pypy3.7.spec +++ b/pypy3.7.spec @@ -126,6 +126,12 @@ URL: http://pypy.org/ # We refer to this subdir of the source tree in a few places during the build: %global goal_dir pypy/goal +%if 0%{?fedora} >= 35 +%bcond_without main_pypy3 +%else +%bcond_with main_pypy3 +%endif + # Source and patches: Source0: https://downloads.python.org/pypy/pypy%{pyversion}-v%{version}-src.tar.bz2 @@ -237,10 +243,12 @@ BuildRequires: python-pip-wheel # Metadata for the core package (the JIT build): Requires: %{name}-libs%{?_isa} = %{version}-%{release} +%if %{with main_pypy3} Provides: %{name}(abi) = %{basever} Provides: pypy3 = %{version}-%{release} Provides: pypy3%{?_isa} = %{version}-%{release} Obsoletes: pypy3 < 7.3.4-4 +%endif %description PyPy's implementation of Python 3, featuring a Just-In-Time compiler on some CPU @@ -264,9 +272,11 @@ Summary: Run-time libraries used by PyPy implementations of Python 3 Requires: emacs-filesystem >= %{_emacs_version} %endif +%if %{with main_pypy3} Provides: pypy3-libs = %{version}-%{release} Provides: pypy3-libs%{?_isa} = %{version}-%{release} Obsoletes: pypy3-libs < 7.3.4-4 +%endif %if %{with rpmwheels} Requires: python-setuptools-wheel @@ -299,9 +309,11 @@ Libraries required by the various PyPy implementations of Python 3. Summary: Development tools for working with PyPy3 Requires: pypy%{pyversion}%{?_isa} = %{version}-%{release} +%if %{with main_pypy3} Provides: pypy3-devel = %{version}-%{release} Provides: pypy3-devel%{?_isa} = %{version}-%{release} Obsoletes: pypy3-devel < 7.3.4-4 +%endif %description devel Header files for building C extension modules against PyPy3 @@ -537,7 +549,9 @@ mkdir -p %{buildroot}/%{pypyprefix}/site-packages execstack --clear-execstack %{buildroot}/%{pypyprefix}/bin/pypy3 ln -s %{pypyprefix}/bin/pypy%{pyversion} %{buildroot}%{_bindir}/pypy%{pyversion} +%if %{with main_pypy3} ln -s pypy%{pyversion} %{buildroot}%{_bindir}/pypy3 +%endif # pypy uses .pyc files by default (--objspace-usepycfiles), but has a slightly # different bytecode format to CPython. It doesn't use .pyo files: the -O flag @@ -662,12 +676,14 @@ find \ # Install the JIT trace mode for Emacs: %if %{with_emacs} mkdir -p %{buildroot}/%{_emacs_sitelispdir} -cp -a rpython/jit/tool/pypytrace-mode.el %{buildroot}/%{_emacs_sitelispdir}/pypy3trace-mode.el -cp -a rpython/jit/tool/pypytrace-mode.elc %{buildroot}/%{_emacs_sitelispdir}/pypy3trace-mode.elc +cp -a rpython/jit/tool/pypytrace-mode.el %{buildroot}/%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.el +cp -a rpython/jit/tool/pypytrace-mode.elc %{buildroot}/%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.elc %endif +%if %{with main_pypy3} # Install macros for rpm: install -m0644 -p -D -t %{buildroot}/%{_rpmconfigdir}/macros.d %{SOURCE2} +%endif # Remove files we don't want: rm -f %{buildroot}%{_libdir}/%{name}.tar.bz2 \ @@ -828,8 +844,8 @@ CheckPyPy pypy3-c %license %{pypyprefix}/lib_pypy/*/LICENSE %{pypyprefix}/site-packages/ %if %{with_emacs} -%{_emacs_sitelispdir}/pypy3trace-mode.el -%{_emacs_sitelispdir}/pypy3trace-mode.elc +%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.el +%{_emacs_sitelispdir}/pypy%{pyversion}trace-mode.elc %endif %files