add --without doc option

because EL8 does not have necessary build dependencies yet,
sphinx3-breathe and nodejs-less, for instance. so add
"--without doc" option to disable the doc build.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
Kefu Chai 2020-04-30 07:46:15 +00:00
parent 482a077115
commit 87706d77ed

View File

@ -1,3 +1,4 @@
%bcond_without doc
Name: fmt
Version: 6.2.0
Release: 2%{?dist}
@ -23,7 +24,7 @@ BuildRequires: cmake3
%else
BuildRequires: cmake
%endif
# For building documentation
%if %{with doc}
BuildRequires: doxygen
BuildRequires: nodejs-less
%if 0%{?rhel} && 0%{?rhel} <= 7
@ -33,6 +34,7 @@ BuildRequires: python%{python3_version_nodots}-breathe
BuildRequires: python3-sphinx
BuildRequires: python3-breathe
%endif
%endif
# This package replaces the old name of cppformat
Provides: cppformat = %{version}-%{release}
@ -53,6 +55,7 @@ Obsoletes: cppformat-devel < %{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
@ -64,6 +67,7 @@ Obsoletes: cppformat-doc < %{version}-%{release}
%description doc
This package contains documentation for developer documentation for %{name}.
%endif
%prep
%autosetup -p1
@ -81,11 +85,13 @@ pushd build
-DFMT_CMAKE_DIR=%{_datadir}/cmake/%{name} \
-DFMT_LIB_DIR=%{_libdir}
%if %{with doc}
# Remove --clean-css since that plugin isn't available
sed -i "s/'--clean-css',//" ../doc/build.py
%make_build all doc
# Remove temporary build products
rm -rf ../build/doc/html/{.buildinfo,.doctrees,objects.inv}
%endif
%install
%make_install -C build
@ -106,9 +112,11 @@ popd
%{_datadir}/cmake/%{name}
%{_libdir}/pkgconfig/%{name}.pc
%if %{with doc}
%files doc
%doc %{_datadir}/doc/%{name}
%license doc/python-license.txt
%endif
%changelog
* Thu Apr 30 2020 Kefu Chai <tchaikov@gmail.com> - 6.2.0-2