File of Package kernel-source.18114

# spec file for package kernel-docs@VARIANT@
# Copyright (c) @YEAR@ SUSE LINUX GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%define srcversion @SRCVERSION@
%define patchversion @PATCHVERSION@
%define variant @VARIANT@%{nil}

%include %_sourcedir/kernel-spec-macros

%define build_html 1
%define build_pdf 0

%(chmod +x %_sourcedir/{@SCRIPTS@})

Name:           kernel-docs@VARIANT@
Summary:        Kernel Documentation
License:        GPL-2.0
Group:          Documentation/Man
Version:        @RPMVERSION@
%if 0%{?is_kotd}
Release:        <RELEASE>.g@COMMIT@
Release:        @RELEASE@
# TW (4.13 or later) no longer needs xmlto
BuildRequires:  xmlto
%if %build_pdf || %build_html
# ReST handling
BuildRequires:  ImageMagick
BuildRequires:  graphviz
BuildRequires:  graphviz-gd
BuildRequires:  graphviz-gnome
BuildRequires:  python3-Sphinx < 3
BuildRequires:  texlive-anyfontsize
%if %build_pdf
BuildRequires:  python3-Sphinx-latex
BuildRequires:  texlive-adjustbox
BuildRequires:  texlive-dejavu
BuildRequires:  texlive-dejavu-fonts
BuildRequires:  texlive-glyphlist
BuildRequires:  texlive-makeindex
BuildRequires:  texlive-varwidth
BuildRequires:  texlive-xetex
BuildRequires:  texlive-zapfding
Provides:       %name = %version-%source_rel
Provides:       %name-srchash-@COMMIT_FULL@
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# These files are found in the kernel-source package:

A few basic documents from the current kernel sources.


%if %build_pdf
%package pdf
Summary:        Kernel Documentation (PDF)
Group:          Documentation/Other

%description pdf
These are PDF documents built from the current kernel sources.


%if %build_html
%package html
Summary:        Kernel Documentation (HTML)
Group:          Documentation/HTML

%description html
These are HTML documents built from the current kernel sources.


%setup -q -c -T -a 0 @UNPACK_PATCHES@
cp -a linux-%srcversion/{COPYING,CREDITS,MAINTAINERS,README} .
cd linux-%srcversion
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols

cd linux-%srcversion
export LANG=en_US
%if %build_html
mkdir -p html
make %{?make_arg} O=$PWD/html htmldocs
%if %build_pdf
mkdir -p pdf
make %{?make_arg} O=$PWD/pdf pdfdocs

cd linux-%srcversion
%if %build_html
install -d $RPM_BUILD_ROOT%{_datadir}/doc/kernel/html/rst
cp -a html/Documentation/output/* $RPM_BUILD_ROOT%{_datadir}/doc/kernel/html/rst || true

%if %build_pdf
install -d $RPM_BUILD_ROOT%{_datadir}/doc/kernel/pdf
for i in pdf/Documentation/output/latex/*.pdf; do
    cp -a $i $RPM_BUILD_ROOT%{_datadir}/doc/kernel/pdf


%if %build_pdf
%files pdf
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/pdf

%if %build_html
%files html
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/html

openSUSE Build Service is sponsored by