File folly.spec of Package folly

#
# spec file for package folly
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%{?suse_build_hwcaps_libs}

Name:           folly
Version:        2023.10.30.00
Release:        0
Summary:        Facebook Open-source Library
# FIXME: Select a correct license from https://github.com/openSUSE/spec-cleaner#spdx-licenses
License:        Apache-2.0
URL:            https://github.com/facebook/folly
Source0:        %{name}-%{version}.tar.xz
Source1:        baselibs.conf
BuildRequires:  boost-devel
BuildRequires:  cmake
BuildRequires:  double-conversion-devel
BuildRequires:  fmt-9-devel
%if 0%{?sle_version} == 150600
BuildRequires:  gcc12
BuildRequires:  gcc12-c++
%else
BuildRequires:  gcc
BuildRequires:  gcc-c++
%endif
BuildRequires:  gflags-devel
BuildRequires:  glog-4-devel
BuildRequires:  libaio-devel
BuildRequires:  libboost_context-devel
BuildRequires:  libboost_filesystem-devel
BuildRequires:  libboost_program_options-devel
BuildRequires:  libboost_regex-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  libbz2-devel
BuildRequires:  libdwarf-devel
BuildRequires:  libevent-devel
BuildRequires:  liblz4-devel
BuildRequires:  libsodium-devel
BuildRequires:  libunwind-devel
BuildRequires:  liburing-devel
BuildRequires:  openssl-devel
BuildRequires:  snappy-devel
BuildRequires:  xz-devel
BuildRequires:  zlib-devel

Requires:       double-conversion-devel
Requires:       double-conversion-devel
Requires:       gflags-devel
Requires:       libaio-devel
Requires:       libbz2-devel
Requires:       libdwarf-devel
Requires:       libevent-devel
Requires:       libevent-devel
Requires:       liblz4-devel
Requires:       libsodium-devel
Requires:       libunwind-devel
Requires:       liburing-devel
Requires:       openssl-devel
Requires:       snappy-devel
Requires:       xz-devel

%description
folly (acronymed loosely after Facebook Open Source Library) is a library of
C++17 components designed with practicality and efficiency in mind. Folly
contains a variety of core library components used extensively at Facebook. In
particular, it's often a dependency of Facebook's other open source C++ efforts
and place where those projects can share code.

%package devel
Summary:        Facebook Open-source Library
Requires:       %{name} = %{version}
Requires:       libfolly0 = %version

%description devel
folly (acronymed loosely after Facebook Open Source Library) is a library of
C++17 components designed with practicality and efficiency in mind. Folly
contains a variety of core library components used extensively at Facebook. In
particular, it's often a dependency of Facebook's other open source C++ efforts
and place where those projects can share code.

%package -n libfolly0
Summary:        Facebook Open-source Library

%description -n libfolly0
folly (acronymed loosely after Facebook Open Source Library) is a library of
C++17 components designed with practicality and efficiency in mind. Folly
contains a variety of core library components used extensively at Facebook. In
particular, it's often a dependency of Facebook's other open source C++ efforts
and place where those projects can share code.

%prep
%autosetup -p1

%build
%if 0%{?sle_version} == 150600
export CC=gcc-12
export CXX=g++-12
%endif
export CXXFLAGS="-Wno-error=return-type"
%ifarch x86_64
export CXXFLAGS="${CXXFLAGS} -march=x86-64-v3"
%endif
%cmake \
  -DBUILD_SHARED_LIBS=ON \
  -DCMAKE_INSTALL_DIR=%{_libdir}/cmake/folly

%cmake_build

%install
%cmake_install

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

%files
%license LICENSE
%doc README.md

%files devel
%{_includedir}/folly
%{_libdir}/libfolly.so
%{_libdir}/libfolly_exception_counter.so
%{_libdir}/libfolly_exception_tracer.so
%{_libdir}/libfolly_exception_tracer_base.so
%{_libdir}/libfolly_test_util.so
%{_libdir}/libfollybenchmark.so
%{_libdir}/cmake/folly
%{_libdir}/pkgconfig/libfolly.pc

%files -n libfolly0
%{_libdir}/libfolly.so.*
%{_libdir}/libfolly_exception_counter.so.*
%{_libdir}/libfolly_exception_tracer.so.*
%{_libdir}/libfolly_exception_tracer_base.so.*
%{_libdir}/libfolly_test_util.so.*
%{_libdir}/libfollybenchmark.so.*

%changelog
openSUSE Build Service is sponsored by