-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel-docs.spec.in
More file actions
159 lines (136 loc) · 3.87 KB
/
Copy pathkernel-docs.spec.in
File metadata and controls
159 lines (136 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#
# spec file for package kernel-docs@VARIANT@
#
# Copyright (c) @YEAR@ SUSE LLC
#
# 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 https://bugs.opensuse.org/
#
%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-only
Group: Documentation/Man
Version: @RPMVERSION@
%if 0%{?is_kotd}
Release: <RELEASE>.g@COMMIT@
%else
Release: @RELEASE@
%endif
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
BuildRequires: bash-sh
%endif
# TW (4.13 or later) no longer needs xmlto
%if 0%{?sle_version}
BuildRequires: xmlto
%endif
%if %build_pdf || %build_html
# ReST handling
BuildRequires: ImageMagick
BuildRequires: graphviz
BuildRequires: graphviz-gd
BuildRequires: graphviz-gnome
BuildRequires: python3-Sphinx
BuildRequires: texlive-amscls
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
%endif
%endif
URL: https://www.kernel.org/
Provides: %name = %version-%source_rel
Provides: %name-srchash-@COMMIT_FULL@
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@SOURCES@
%description
A few basic documents from the current kernel sources.
%source_timestamp
%if %build_pdf
%package pdf
Summary: Kernel Documentation (PDF)
Group: Documentation/Other
%description pdf
These are PDF documents built from the current kernel sources.
%source_timestamp
%endif
%if %build_html
%package html
Summary: Kernel Documentation (HTML)
Group: Documentation/HTML
%description html
These are HTML documents built from the current kernel sources.
%source_timestamp
%endif
%prep
%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
%build
cd linux-%srcversion
export LANG=en_US.utf8
%if %build_html
mkdir -p html
make %{?make_arg} O=$PWD/html PYTHON=python3 htmldocs
%endif
%if %build_pdf
mkdir -p pdf
make %{?make_arg} O=$PWD/pdf PYTHON=python3 pdfdocs
%endif
%install
cd linux-%srcversion
%if %build_html
install -d %{buildroot}%{_datadir}/doc/kernel/html/rst
cp -a html/Documentation/output/* %{buildroot}%{_datadir}/doc/kernel/html/rst || true
%endif
%if %build_pdf
install -d %{buildroot}%{_datadir}/doc/kernel/pdf
for i in pdf/Documentation/output/latex/*.pdf; do
cp -a $i %{buildroot}%{_datadir}/doc/kernel/pdf
done
%endif
%files
%defattr(-,root,root)
%if 0%{?suse_version} && 0%{?suse_version} < 1500
%doc COPYING
%else
%license COPYING
%endif
%doc CREDITS MAINTAINERS README
%if %build_pdf
%files pdf
%defattr(-,root,root)
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/pdf
%{_datadir}/doc/kernel/pdf
%endif
%if %build_html
%files html
%defattr(-,root,root)
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/html
%{_datadir}/doc/kernel/html
%endif
%changelog