%define debug_package %{nil} %define _build_id_links none %if 0%{?rhel} && 0%{?rhel} < 10 %global gcc_toolset_enable source /opt/rh/gcc-toolset-15/enable %else %global gcc_toolset_enable source /usr/lib/gcc-toolset/15-env.source %endif Name: fmt Version: 12.1.0 Release: %autorelease License: MIT Summary: Small, safe and fast formatting library for C++ URL: https://github.com/fmtlib/%{name} Source0: %{url}/archive/%{version}.tar.gz BuildRequires: cmake BuildRequires: gcc-toolset-15-gcc BuildRequires: gcc-toolset-15-gcc-c++ BuildRequires: gcc-toolset-15-gcc-plugin-annobin BuildRequires: ninja-build # This package replaces the old name of cppformat Provides: cppformat = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: cppformat < %{?epoch:%{epoch}:}%{version}-%{release} %description C++ Format is an open-source formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} # for usage with -DFMT_HEADER_ONLY Provides: %{name}-static = %{?epoch:%{epoch}:}%{version}-%{release} # This package replaces the old name of cppformat Provides: cppformat-devel = %{?epoch:%{epoch}:}%{version}-%{release} Obsoletes: cppformat-devel < %{?epoch:%{epoch}:}%{version}-%{release} %description devel This package contains the header file for using %{name}. %prep %autosetup -p1 %build %{gcc_toolset_enable} %cmake -G Ninja \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON \ -DFMT_CMAKE_DIR:STRING=%{_libdir}/cmake/%{name} \ -DFMT_LIB_DIR:STRING=%{_libdir} %cmake_build %install %cmake_install %check %ctest %files %license LICENSE %doc ChangeLog.md README.md %{_libdir}/lib%{name}.so.12* %files devel %{_includedir}/%{name} %{_libdir}/lib%{name}.so %{_libdir}/cmake/%{name} %{_libdir}/pkgconfig/%{name}.pc %changelog %autochangelog