Add a build-condition for disabling building documentation
The optional documentation distributed within doc subpackage requires doxygen and graphviz at build time. That is an obstacle when building jsoncpp for modular Fedora when the dependecies are not yet available. This patch introduces a build-time condition that allows to disable generating the documentation while building in normal Fedora is unchanged.
This commit is contained in:
parent
ada64f9086
commit
a59d3c78a5
17
jsoncpp.spec
17
jsoncpp.spec
@ -1,3 +1,6 @@
|
|||||||
|
# Build documentation in HTML with images
|
||||||
|
%bcond_without jsoncpp_enables_doc
|
||||||
|
|
||||||
%global jsondir json
|
%global jsondir json
|
||||||
|
|
||||||
Name: jsoncpp
|
Name: jsoncpp
|
||||||
@ -10,10 +13,12 @@ URL: https://github.com/open-source-parsers/%{name}
|
|||||||
Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
Source0: %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||||
|
|
||||||
BuildRequires: cmake >= 3.1
|
BuildRequires: cmake >= 3.1
|
||||||
|
%if %{with jsoncpp_enables_doc}
|
||||||
BuildRequires: doxygen
|
BuildRequires: doxygen
|
||||||
BuildRequires: graphviz
|
BuildRequires: graphviz
|
||||||
BuildRequires: hardlink
|
BuildRequires: hardlink
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
%{name} is an implementation of a JSON (http://json.org) reader and writer in
|
%{name} is an implementation of a JSON (http://json.org) reader and writer in
|
||||||
@ -30,18 +35,22 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
|
|||||||
This package contains the development headers and library for %{name}.
|
This package contains the development headers and library for %{name}.
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with jsoncpp_enables_doc}
|
||||||
%package doc
|
%package doc
|
||||||
Summary: Documentation for %{name}
|
Summary: Documentation for %{name}
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%description doc
|
%description doc
|
||||||
This package contains the documentation for %{name}.
|
This package contains the documentation for %{name}.
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p 1
|
%autosetup -p 1
|
||||||
|
%if %{with jsoncpp_enables_doc}
|
||||||
doxygen -s -u doc/doxyfile.in
|
doxygen -s -u doc/doxyfile.in
|
||||||
sed -i -e 's!^DOT_FONTNAME.*=.*!DOT_FONTNAME =!g' doc/doxyfile.in
|
sed -i -e 's!^DOT_FONTNAME.*=.*!DOT_FONTNAME =!g' doc/doxyfile.in
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -58,19 +67,23 @@ popd
|
|||||||
|
|
||||||
%make_build -C %{_target_platform}
|
%make_build -C %{_target_platform}
|
||||||
|
|
||||||
|
%if %{with jsoncpp_enables_doc}
|
||||||
# Build the doc
|
# Build the doc
|
||||||
%{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
|
%{__python3} doxybuild.py --with-dot --doxygen %{_bindir}/doxygen
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%make_install -C %{_target_platform}
|
%make_install -C %{_target_platform}
|
||||||
|
|
||||||
|
%if %{with jsoncpp_enables_doc}
|
||||||
mkdir -p %{buildroot}%{_docdir}/%{name}/html
|
mkdir -p %{buildroot}%{_docdir}/%{name}/html
|
||||||
for f in README.md ; do
|
for f in README.md ; do
|
||||||
install -p -m 0644 $f %{buildroot}%{_docdir}/%{name}
|
install -p -m 0644 $f %{buildroot}%{_docdir}/%{name}
|
||||||
done
|
done
|
||||||
install -p -m 0644 dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
|
install -p -m 0644 dist/doxygen/*/*.{html,png} %{buildroot}%{_docdir}/%{name}/html
|
||||||
hardlink -cfv %{buildroot}%{_docdir}/%{name}
|
hardlink -cfv %{buildroot}%{_docdir}/%{name}
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
@ -83,9 +96,11 @@ hardlink -cfv %{buildroot}%{_docdir}/%{name}
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%license AUTHORS LICENSE
|
%license AUTHORS LICENSE
|
||||||
|
%if %{with jsoncpp_enables_doc}
|
||||||
%doc %dir %{_docdir}/%{name}
|
%doc %dir %{_docdir}/%{name}
|
||||||
%doc %{_docdir}/%{name}/README.md
|
%doc %{_docdir}/%{name}/README.md
|
||||||
%exclude %{_docdir}/%{name}/html
|
%exclude %{_docdir}/%{name}/html
|
||||||
|
%endif
|
||||||
%{_libdir}/lib%{name}.so.*
|
%{_libdir}/lib%{name}.so.*
|
||||||
|
|
||||||
|
|
||||||
@ -96,9 +111,11 @@ hardlink -cfv %{buildroot}%{_docdir}/%{name}
|
|||||||
%{_libdir}/pkgconfig/jsoncpp.pc
|
%{_libdir}/pkgconfig/jsoncpp.pc
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with jsoncpp_enables_doc}
|
||||||
%files doc
|
%files doc
|
||||||
%license %{_datadir}/licenses/%{name}*
|
%license %{_datadir}/licenses/%{name}*
|
||||||
%doc %{_docdir}/%{name}*
|
%doc %{_docdir}/%{name}*
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user