Accepting request 1154625 from LibreOffice:Factory

Fix build on different distributions

OBS-URL: https://build.opensuse.org/request/show/1154625
OBS-URL: https://build.opensuse.org/package/show/devel:microos/abseil-cpp?expand=0&rev=30
This commit is contained in:
Richard Brown 2024-03-18 10:40:02 +00:00 committed by Git OBS Bridge
parent ae9b1d71c9
commit b754c4f0ef
2 changed files with 26 additions and 9 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Mar 4 10:30:53 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- Fix broken link to sources
- Fix build for distributions that lack the ldconfig_scriptlets
macro
- Make the gcc version condition a bit more generic
------------------------------------------------------------------- -------------------------------------------------------------------
Sun Mar 3 06:35:57 UTC 2024 - Andreas Stieger <andreas.stieger@gmx.de> Sun Mar 3 06:35:57 UTC 2024 - Andreas Stieger <andreas.stieger@gmx.de>

View File

@ -17,23 +17,26 @@
%define lname libabsl2401_0_0 %define lname libabsl2401_0_0
%if 0%{?gcc_version} < 7
%global with_gcc 7
%endif
Name: abseil-cpp Name: abseil-cpp
Version: 20240116.1 Version: 20240116.1
Release: 0 Release: 0
Summary: C++11 libraries which augment the C++ stdlib Summary: C++11 libraries which augment the C++ stdlib
License: Apache-2.0 License: Apache-2.0
URL: https://abseil.io/ URL: https://abseil.io/
Source0: https://github.com/abseil/abseil-cpp/releases/download/%{version}/%{name}-%{version}.tar.gz Source0: https://github.com/abseil/%{name}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1: baselibs.conf Source1: baselibs.conf
BuildRequires: cmake BuildRequires: cmake
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: pkgconfig BuildRequires: pkgconfig
%if 0%{?suse_version} && 0%{?suse_version} < 1500 %if 0%{?with_gcc:1}
BuildRequires: gcc7 BuildRequires: gcc%{with_gcc}
BuildRequires: gcc7-c++ BuildRequires: gcc%{with_gcc}-c++
%else %else
BuildRequires: gcc >= 7 BuildRequires: gcc
BuildRequires: gcc-c++ >= 7 BuildRequires: gcc-c++
%endif %endif
# PATCH-FIX-OPENSUSE options-{old,cxx17}.patch Ensure ABI stability regardless of compiler options # PATCH-FIX-OPENSUSE options-{old,cxx17}.patch Ensure ABI stability regardless of compiler options
%if 0%{?suse_version} && 0%{?suse_version} < 1550 %if 0%{?suse_version} && 0%{?suse_version} < 1550
@ -71,9 +74,9 @@ This package contains headers and build system files for it.
%autosetup -p1 %autosetup -p1
%build %build
%if 0%{?suse_version} && 0%{?suse_version} < 1500 %if 0%{?with_gcc:1}
export CC="gcc-7" export CC="gcc-%{with_gcc}"
export CXX="g++-7" export CXX="g++-%{with_gcc}"
%endif %endif
%cmake %cmake
%cmake_build %cmake_build
@ -82,7 +85,13 @@ export CXX="g++-7"
%cmake_install %cmake_install
%fdupes %{buildroot}/%{_prefix} %fdupes %{buildroot}/%{_prefix}
# SLE12 doed not define this macro
%if %{undefined ldconfig_scriptlets}
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%else
%ldconfig_scriptlets -n %{lname} %ldconfig_scriptlets -n %{lname}
%endif
%files -n %{lname} %files -n %{lname}
%license LICENSE %license LICENSE