0bb384
%bcond_with doc
0bb384
Name:           fmt
0bb384
Version:        6.2.1
0bb384
Release:        1%{?dist}
0bb384
Summary:        Small, safe and fast formatting library for C++
0bb384
0bb384
License:        BSD
0bb384
URL:            https://github.com/fmtlib/%{name}
0bb384
Source0:        %{url}/archive/%{version}.tar.gz
0bb384
# See https://github.com/fmtlib/fmt/issues/443 and https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/LVKYLDLJVWAVJE4MQVKDO6PYZRD5MCP6/
0bb384
Patch1:         doc-build-removed-all-pip-internet-stuff.patch
0bb384
Patch3:         doc-build-do-not-create-virtual-environment.patch
0bb384
Patch4:         doc-_templates-layout-stripped-Google-Analytics.patch
0bb384
Patch5:         doc-_templates-layout-stripped-download-links.patch
0bb384
Patch6:         doc-index-removed-GitHub-iframe.patch
0bb384
Patch7:         doc-build-use-sphinx-build-3.patch
0bb384
Patch8:         doc-build-use-python3.patch
0bb384
0bb384
BuildRequires:  gcc
0bb384
BuildRequires:  gcc-c++
0bb384
%if 0%{?rhel} && 0%{?rhel} <= 7
0bb384
BuildRequires:  cmake3
0bb384
%else
0bb384
BuildRequires:  cmake
0bb384
%endif
0bb384
%if %{with doc}
0bb384
BuildRequires:  doxygen
0bb384
BuildRequires:  nodejs-less
0bb384
%if 0%{?rhel} && 0%{?rhel} <= 7
0bb384
BuildRequires:  python%{python3_version_nodots}-sphinx
0bb384
BuildRequires:  python%{python3_version_nodots}-breathe
0bb384
%else
0bb384
BuildRequires:  python3-sphinx
0bb384
BuildRequires:  python3-breathe
0bb384
%endif
0bb384
%endif
0bb384
0bb384
# This package replaces the old name of cppformat
0bb384
Provides:       cppformat = %{version}-%{release}
0bb384
Obsoletes:      cppformat < %{version}-%{release}
0bb384
0bb384
%description
0bb384
C++ Format is an open-source formatting library for C++. It can be used as a
0bb384
safe alternative to printf or as a fast alternative to IOStreams.
0bb384
0bb384
%package        devel
0bb384
Summary:        Development files for %{name}
0bb384
Requires:       %{name}%{?_isa} = %{version}-%{release}
0bb384
0bb384
# This package replaces the old name of cppformat
0bb384
Provides:       cppformat-devel = %{version}-%{release}
0bb384
Obsoletes:      cppformat-devel < %{version}-%{release}
0bb384
0bb384
%description    devel
0bb384
This package contains the header file for using %{name}.
0bb384
0bb384
%if %{with doc}
0bb384
%package        doc
0bb384
Summary:        Documentation files for %{name}
0bb384
License:        Python
0bb384
BuildArch:      noarch
0bb384
0bb384
# This package replaces the old name of cppformat
0bb384
Provides:       cppformat-doc = %{version}-%{release}
0bb384
Obsoletes:      cppformat-doc < %{version}-%{release}
0bb384
0bb384
%description    doc
0bb384
This package contains documentation for developer documentation for %{name}.
0bb384
%endif
0bb384
0bb384
%prep
0bb384
%autosetup -p1
0bb384
mkdir build
0bb384
0bb384
%build
0bb384
pushd build
0bb384
%if 0%{?rhel} && 0%{?rhel} <= 7
0bb384
%cmake3 ..                                    \
0bb384
%else
0bb384
%cmake ..                                     \
0bb384
%endif
0bb384
    -DCMAKE_BUILD_TYPE=RelWithDebInfo         \
0bb384
    -DCMAKE_POSITION_INDEPENDENT_CODE=ON      \
0bb384
    -DFMT_CMAKE_DIR=%{_datadir}/cmake/%{name} \
0bb384
    -DFMT_LIB_DIR=%{_libdir}
0bb384
0bb384
%if %{with doc}
0bb384
# Remove --clean-css since that plugin isn't available
0bb384
sed -i "s/'--clean-css',//" ../doc/build.py
0bb384
%make_build all doc
0bb384
# Remove temporary build products
0bb384
rm -rf ../build/doc/html/{.buildinfo,.doctrees,objects.inv}
0bb384
%endif
0bb384
0bb384
%install
0bb384
%make_install -C build
0bb384
0bb384
%check
0bb384
pushd build
0bb384
ctest -VV %{?_smp_mflags}
0bb384
popd
0bb384
0bb384
%files
0bb384
%license LICENSE.rst
0bb384
%doc ChangeLog.rst README.rst
0bb384
%{_libdir}/lib%{name}.so.6*
0bb384
0bb384
%files devel
0bb384
%{_includedir}/%{name}
0bb384
%{_libdir}/lib%{name}.so
0bb384
%{_datadir}/cmake/%{name}
0bb384
%{_libdir}/pkgconfig/%{name}.pc
0bb384
0bb384
%if %{with doc}
0bb384
%files doc
0bb384
%doc %{_datadir}/doc/%{name}
0bb384
%license doc/python-license.txt
0bb384
%endif
0bb384
0bb384
%changelog
0bb384
* Sat May 09 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 6.2.1-1
0bb384
- Updated to version 6.2.1.
0bb384
0bb384
* Thu Apr 30 2020 Kefu Chai <tchaikov@gmail.com> - 6.2.0-2
0bb384
- Incorporate patch from upstream to address https://github.com/fmtlib/fmt/issues/1631
0bb384
0bb384
* Mon Apr 06 2020 Vitaly Zaitsev <vitaly@easycoding.org> - 6.2.0-1
0bb384
- Updated to version 6.2.0.
0bb384
0bb384
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.2-2
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
0bb384
0bb384
* Wed Dec 18 2019 Vitaly Zaitsev <vitaly@easycoding.org> - 6.1.2-1
0bb384
- Updated to version 6.1.2.
0bb384
- Recreated all documentation patches.
0bb384
- SPEC file cleanup.
0bb384
0bb384
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.3.0-2
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
0bb384
0bb384
* Mon Jun 10 2019 Jan Staněk <jstanek@redhat.com> - 5.3.0-1
0bb384
- Update to 5.3.0
0bb384
- Recreate documentation build patches
0bb384
- Package new pkg-config files
0bb384
0bb384
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.1-2
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
0bb384
0bb384
* Thu Oct 11 2018 Kefu Chai <tchaikov@gmail.com> - 5.2.1-1
0bb384
- Update to 5.2.1
0bb384
- Build using python3 packages on fedora
0bb384
- Remove links in document accessing network
0bb384
- Package ChangeLog.rst and README.rst
0bb384
- Drop fmt-static package
0bb384
0bb384
* Fri Aug 31 2018 Leigh Scott <leigh123linux@googlemail.com> - 3.0.2-7
0bb384
- Fix python2 issue for doc
0bb384
0bb384
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-6
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
0bb384
0bb384
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-5
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0bb384
0bb384
* Wed Aug 09 2017 Dave Johansen <davejohansen@gmail.com> - 3.0.2-4
0bb384
- Patch for Test 8 segfault
0bb384
0bb384
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-3
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
0bb384
0bb384
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.2-2
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0bb384
0bb384
* Sat Jun 24 2017 Dave Johansen <davejohansen@gmail.com> - 3.0.2-1
0bb384
- Upstream release
0bb384
0bb384
* Mon May 15 2017 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.1-3
0bb384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_27_Mass_Rebuild
0bb384
0bb384
* Tue Dec 27 2016 Dave Johansen <davejohansen@gmail.com> - 3.0.1-2
0bb384
- Build documentation
0bb384
0bb384
* Fri Nov 25 2016 Dave Johansen <davejohansen@gmail.com> - 3.0.1-1
0bb384
- Upstream release
0bb384
0bb384
* Tue Nov 15 2016 Dave Johansen <davejohansen@gmail.com> - 3.0.0-2
0bb384
- Fix expected unqualified-id before numeric constant error
0bb384
0bb384
* Wed Aug 24 2016 Dave Johansen <davejohansen@gmail.com> - 3.0.0-1
0bb384
- Initial RPM release