summaryrefslogtreecommitdiff
path: root/absl.spec
blob: 085126788fa765c89044609c2161226e6a8e8e95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Abseil C++ Common Libraries.
#
# Source0 is the upstream release tag archive. The tarball placed in SOURCES is
# a repackage of tag 20260817.0 (commit 2065f4ded0558c6f89fee67c8e5228feb4eb960e)
# with its top-level directory normalised to name-version form, so the
# automatic source extraction directory is deterministic and reproducible.
%undefine __cmake_in_source_build

# Upstream library soname version (ABSL_SOVERSION), independent of the
# YYYYMMDD release version.
%global absl_soversion 2608.0.0

Name:           absl
Version:        20260817.0
Release:        1%{?dist}
Summary:        C++ Common Libraries

License:        Apache-2.0
URL:            https://abseil.io
Source0:        https://github.com/abseil/abseil-cpp/archive/refs/tags/%{version}.tar.gz#/absl-%{version}.tar.gz

BuildRequires:  cmake
BuildRequires:  ninja-build
BuildRequires:  gcc-c++
BuildRequires:  make

%description
Abseil is an open-source collection of C++ library code designed to augment
the C++ standard library. The Abseil library code is collected from Google's
own C++ code base, has been extensively tested and used in production, and is
the same code we depend on in our daily coding lives.

In some cases, Abseil provides pieces missing from the C++ standard; in others,
Abseil provides alternatives to the standard for special needs we have found
through usage in the Google code base. We denote those cases clearly within the
library code we provide you.

Abseil is not meant to be a competitor to the standard library; we have just
found that many of these utilities serve a purpose within our code base, and we
now want to provide those resources to the C++ community as a whole.

%package devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}

%description devel
Development headers, CMake integration files and pkgconfig files for %{name}
(Abseil C++ Common Libraries).

%prep
%autosetup -n %{name}-%{version}

%build
# Invoke the cmake binary directly rather than the cmake rpm macro so the
# build is portable across builders, including ones lacking the cmake macro.
cmake -S %{_vpath_srcdir} -B %{_vpath_builddir} -GNinja \
    -DCMAKE_INSTALL_PREFIX=%{_prefix} \
    -DCMAKE_INSTALL_LIBDIR=%{_lib} \
    -DBUILD_SHARED_LIBS=ON \
    -DABSL_BUILD_TESTING=OFF \
    -DABSL_BUILD_TEST_HELPERS=OFF \
    -DABSL_PROPAGATE_CXX_STD=ON \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DCMAKE_CXX_STANDARD=17
cmake --build %{_vpath_builddir} --parallel

%install
DESTDIR="%{buildroot}" cmake --install "%{_vpath_builddir}"

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%files
%license LICENSE
%doc FAQ.md README.md UPGRADES.md
%{_libdir}/libabsl_*.so.*

%files devel
%{_includedir}/absl
%{_libdir}/cmake/absl
%{_libdir}/libabsl_*.so
%{_libdir}/pkgconfig/*.pc

%changelog
* Fri Nov 27 2026 openEuler Builder <builder@openeuler.org> - 20260817.0-1
- Initial package (Abseil C++ Common Libraries)