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