Add doc pkg

This commit is contained in:
Neil Hanlon 2023-10-31 23:40:14 -04:00 committed by Neil Hanlon
parent 236090ebb3
commit 25ffe31d22
Signed by: neil
GPG Key ID: 705BC21EC3C70F34

View File

@ -1,7 +1,7 @@
# adapted with love from sqlite # adapted with love from sqlite
%bcond_without check %bcond_without check
%bcond_with docs %bcond_without doc
%bcond_without static %bcond_without static
%global gittagversion 1.15.3 %global gittagversion 1.15.3
@ -32,12 +32,12 @@ BuildRequires: raft-devel
BuildRequires: sqlite-devel BuildRequires: sqlite-devel
# docs # docs
%if %{with docs} %if %{with doc}
BuildRequires: python-sphinx BuildRequires: python-sphinx
BuildRequires: python-mock #BuildRequires: python-mock
BuildRequires: python-alabaster #BuildRequires: python-alabaster
BuildRequires: python-commonmark #BuildRequires: python-commonmark
BuildRequires: python-sphinx-rtd-theme #BuildRequires: python-sphinx-rtd-theme
BuildRequires: python-recommonmark BuildRequires: python-recommonmark
%endif %endif
@ -64,7 +64,7 @@ This package contains the header files and development documentation
for %{name}. If you like to develop programs using %{name}, you will need for %{name}. If you like to develop programs using %{name}, you will need
to install %{name}-devel. to install %{name}-devel.
%if %{with docs} %if %{with doc}
%package doc %package doc
Summary: Documentation for libcowsql Summary: Documentation for libcowsql
BuildArch: noarch BuildArch: noarch
@ -82,8 +82,9 @@ autoreconf -iv
%configure %configure
%make_build %make_build
%if %{with docs} %if %{with doc}
sphinx-build -a docs docs-build sphinx-build -b html docs html
rm -rf html/.{doctrees,buildinfo}
%endif %endif
%install %install
@ -93,14 +94,6 @@ sphinx-build -a docs docs-build
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.{la,a} rm -f $RPM_BUILD_ROOT/%{_libdir}/*.{la,a}
%endif %endif
%if %{with docs}
pushd docs-build
for d in **/*; do
install -Dpm 644 -t %{buildroot}/usr/share/doc/cowsql/ $d
done
popd
%endif
%if %{with check} %if %{with check}
%check %check
make check make check
@ -122,9 +115,9 @@ make check
%exclude %{_libdir}/*.la %exclude %{_libdir}/*.la
%endif %endif
%if %{with docs} %if %{with doc}
%files doc %files doc
%doc /usr/share/doc/cowsql %doc html
%endif %endif
%changelog %changelog