File fmt.spec of Package fmt-7.1.3

%undefine __cmake_in_source_build
%bcond_with doc
Name:                fmt
Version:             7.1.3
Release:             1
Summary:             Small, safe and fast formatting library for C++
License:             BSD
URL:       {name}
Source0:             %{url}/archive/%{version}.tar.gz
Patch1:              doc-build-removed-all-pip-internet-stuff.patch
Patch3:              doc-build-do-not-create-virtual-environment.patch
Patch4:              doc-_templates-layout-stripped-Google-Analytics.patch
Patch5:              doc-_templates-layout-stripped-download-links.patch
Patch6:              doc-index-removed-GitHub-iframe.patch
Patch7:              doc-build-use-sphinx-build-3.patch
BuildRequires:       gcc gcc-c++ ninja-build cmake
%if %{with doc}
BuildRequires:       doxygen nodejs-less python3-sphinx python3-breathe
Provides:            %{name}-doc = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:           %{name}-doc < %{?epoch:%{epoch}:}%{version}-%{release}
Provides:            cppformat = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:           cppformat < %{?epoch:%{epoch}:}%{version}-%{release}
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}
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}.
%if %{with doc}

%package        doc
Summary:             Documentation files for %{name}
License:             Python
BuildArch:           noarch
Provides:            cppformat-doc = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes:           cppformat-doc < %{?epoch:%{epoch}:}%{version}-%{release}
%description    doc
This package contains documentation for developer documentation for %{name}.

%autosetup -p1
%if %{with doc}
sed -i "s/'--clean-css',//" doc/

%cmake                                        \
    -G Ninja                                  \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo         \
    -DFMT_CMAKE_DIR=%{_libdir}/cmake/%{name}  \
cmake --build  ./ %{?_smp_flags} --verbose --target all
%if %{with doc}
    --target doc \
%if %{with doc}
rm -rf %{_vpath_builddir}/doc/html/{.buildinfo,.doctrees,objects.inv}

install -d -m 0755 %{buildroot}/%{_includedir}/%{name}
install -d -m 0755 %{buildroot}/%{_libdir}
install -d -m 0755 %{buildroot}/%{_libdir}/cmake/%{name}
install -d -m 0755 %{buildroot}/%{_libdir}/pkgconfig
cp  -arf  include/fmt/*  %{buildroot}/%{_includedir}/%{name}
cp  -arf lib%{name}.so %{buildroot}/%{_libdir}
cp  -arf lib%{name}.so.7.1.3 %{buildroot}/%{_libdir}
cp  -arf lib%{name}.so.7 %{buildroot}/%{_libdir}
cp  -arf fmt.pc   %{buildroot}/%{_libdir}/pkgconfig
cp  -arf  *.cmake  %{buildroot}/%{_libdir}/cmake/%{name}


%license LICENSE.rst
%doc ChangeLog.rst README.rst

%files devel
%if %{with doc}

%files doc
%doc %{_datadir}/doc/%{name}
%license doc/python-license.txt

* Thu Nov 25 2021 liyanan <> - 7.1.3-1
- package init