rpm: RHEL 8 update macros

RHEL 8 and derivatives have supported the various CMake macros since
8.4 (June 2021, see https://access.redhat.com/errata/RHEA-2021:1747)
Use them there as well, so that we have a unified spec file for all
recent distributions (with the older RHEL/CentOS 7 and SLES 12 being
the only exceptions.)
This commit is contained in:
John Thacker 2022-01-17 09:55:13 -05:00 committed by A Wireshark GitLab Utility
parent d6a6cc72a0
commit 92c8c2f7a0
1 changed files with 13 additions and 15 deletions

View File

@ -277,12 +277,8 @@ development of Wireshark scripts and plugins.
cmake3 \
-DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \
%else
%if 0%{?el8}
cmake \
%else
%cmake \
%endif
%endif
%if 0%{?fedora} && ( "%{_prefix}" != "/usr" )
-DENABLE_RPATH_ORIGIN=ON \
%endif
@ -363,17 +359,17 @@ cmake \
# either macro, and thus presumably does in-source builds.)
%{?!__cmake_builddir: %global __cmake_builddir %{?__builddir}%{!?__builddir:.}}
%if 0%{?rhel} && ( 0%{?rhel} <= 7 ) || (0%{?suse_version} && 0%{?sle_version} <= 150100)
%if %{with ninja}
%if 0%{?fedora} || ( 0%{?suse_version} && 0%{?sle_version} >= 150200 )
%cmake_build
%else
%ninja_build
%endif
%else
# Suggestion: put this in your ~/.rpmmacros (without the hash sign, of course):
# %_smp_mflags -j %(grep -c processor /proc/cpuinfo)
make %{?_smp_mflags} -C %{__cmake_builddir}
%endif
%else
%cmake_build
%endif
%install
rm -rf $RPM_BUILD_ROOT
@ -381,18 +377,20 @@ rm -rf $RPM_BUILD_ROOT
cd build
%endif
%if 0%{?rhel} && ( 0%{?rhel} <= 7 ) || (0%{?suse_version} && 0%{?sle_version} <= 150100)
%if %{with ninja}
%if 0%{?fedora} || ( 0%{?suse_version} && 0%{?sle_version} >= 150200 )
%cmake_install
%else
%ninja_install
%endif
%if %{with guides}
%ninja_install install_guides -C %{__cmake_builddir}
%endif
%else
make DESTDIR=$RPM_BUILD_ROOT install -C %{__cmake_builddir}
%endif
%else
%cmake_install
%endif
%if %{with guides}
%if %{with ninja}
%ninja_install install_guides -C %{__cmake_builddir}
%else
make DESTDIR=$RPM_BUILD_ROOT install_guides -C %{__cmake_builddir}
%endif
%endif