File kernel-source-rt.spec of Package kernel-syms-rt
314
1
#
2
# spec file for package kernel-source-rt
3
#
4
# Copyright (c) 2021 SUSE LLC
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via http://bugs.opensuse.org/
16
#
17
# icecream 0
18
19
20
%define srcversion 5.3
21
%define patchversion 5.3.18
22
%define variant -rt%{nil}
23
%define vanilla_only 0
24
25
%include %_sourcedir/kernel-spec-macros
26
27
%define src_install_dir usr/src/linux-%kernelrelease%variant
28
29
Name: kernel-source-rt
30
Summary: The Linux Kernel Sources
31
License: GPL-2.0
32
Group: Development/Sources
33
Version: 5.3.18
34
%if 0%{?is_kotd}
35
Release: <RELEASE>.gebc4f0c
36
%else
37
Release: 0
38
%endif
39
Url: http://www.kernel.org/
40
AutoReqProv: off
41
BuildRequires: coreutils
42
BuildRequires: fdupes
43
BuildRequires: sed
44
Requires(post): coreutils sed
45
Provides: %name = %version-%source_rel
46
Provides: %name-srchash-ebc4f0cb715d533804b3e9d66899a0470ba951f2
47
Provides: linux
48
Provides: multiversion(kernel)
49
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz
50
Source2: source-post.sh
51
Source3: kernel-source.rpmlintrc
52
Source8: devel-pre.sh
53
Source9: devel-post.sh
54
Source10: preun.sh
55
Source11: postun.sh
56
Source12: pre.sh
57
Source13: post.sh
58
Source14: series.conf
59
Source16: guards
60
Source17: apply-patches
61
Source21: config.conf
62
Source23: supported.conf
63
Source33: check-for-config-changes
64
Source35: group-source-files.pl
65
Source36: README.PATCH-POLICY.SUSE
66
Source37: README.SUSE
67
Source38: README.KSYMS
68
Source39: config-options.changes.txt
69
Source40: source-timestamp
70
Source46: split-modules
71
Source47: modversions
72
Source48: macros.kernel-source
73
Source49: kernel-module-subpackage
74
Source50: kabi.pl
75
Source51: mkspec
76
Source52: kernel-source%variant.changes
77
Source53: kernel-source.spec.in
78
Source54: kernel-binary.spec.in
79
Source55: kernel-syms.spec.in
80
Source56: kernel-docs.spec.in
81
Source57: kernel-cert-subpackage
82
Source58: constraints.in
83
Source60: config.sh
84
Source61: compute-PATCHVERSION.sh
85
Source62: old-flavors
86
Source63: arch-symbols
87
Source64: package-descriptions
88
Source65: kernel-spec-macros
89
Source67: log.sh
90
Source68: host-memcpy-hack.h
91
Source69: try-disable-staging-driver
92
Source70: kernel-obs-build.spec.in
93
Source71: kernel-obs-qa.spec.in
94
Source72: compress-vmlinux.sh
95
Source73: dtb.spec.in.in
96
Source74: mkspec-dtb
97
Source75: release-projects
98
Source76: check-module-license
99
Source77: klp-symbols
100
Source78: modules.fips
101
Source79: splitflist
102
Source80: mergedep
103
Source81: moddep
104
Source82: modflist
105
Source83: kernel-subpackage-build
106
Source84: kernel-subpackage-spec
107
Source85: kernel-default-base.spec.txt
108
Source100: config.tar.bz2
109
Source101: config.addon.tar.bz2
110
Source102: patches.arch.tar.bz2
111
Source103: patches.drivers.tar.bz2
112
Source104: patches.fixes.tar.bz2
113
Source105: patches.rpmify.tar.bz2
114
Source106: patches.suse.tar.bz2
115
Source108: patches.addon.tar.bz2
116
Source109: patches.kernel.org.tar.bz2
117
Source110: patches.apparmor.tar.bz2
118
Source111: patches.rt.tar.bz2
119
Source113: patches.kabi.tar.bz2
120
Source120: kabi.tar.bz2
121
Source121: sysctl.tar.bz2
122
BuildRoot: %{_tmppath}/%{name}-%{version}-build
123
BuildArch: noarch
124
Prefix: /usr/src
125
# Source is only complete with devel files.
126
Requires: kernel-devel%variant = %version-%source_rel
127
# extra packages needed for building a kernel from scratch
128
Recommends: bc
129
Recommends: bison
130
Recommends: flex
131
Recommends: libelf-devel
132
Recommends: openssl-devel
133
%obsolete_rebuilds %name
134
135
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,group-source-files.pl,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,log.sh,try-disable-staging-driver,compress-vmlinux.sh,mkspec-dtb,check-module-license,klp-symbols,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
136
137
# Force bzip2 instead of lzma compression to
138
# 1) allow install on older dist versions, and
139
# 2) decrease build times (bsc#962356 boo#1175882)
140
%define _binary_payload w9.bzdio
141
142
%define symbols %(set -- $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
143
%define variant_symbols %(case %name in (*-rt) echo "RT" ;; esac)
144
145
%define do_vanilla "%variant" == ""
146
147
%description
148
Linux kernel sources with many fixes and improvements.
149
150
151
%source_timestamp
152
%package -n kernel-devel%variant
153
%obsolete_rebuilds kernel-devel%variant
154
Summary: Development files needed for building kernel modules
155
Group: Development/Sources
156
AutoReqProv: off
157
Provides: kernel-devel%variant = %version-%source_rel
158
Provides: multiversion(kernel)
159
Requires: kernel-macros
160
Requires(post): coreutils
161
162
%description -n kernel-devel%variant
163
Kernel-level headers and Makefiles required for development of
164
external kernel modules.
165
166
%source_timestamp
167
168
# Note: The kernel-macros package intentionally does not provide
169
# multiversion(kernel) nor is its name decorated with the variant (-rt)
170
%package -n kernel-macros
171
Summary: RPM macros for building Kernel Module Packages
172
Group: Development/Sources
173
Provides: kernel-subpackage-macros
174
175
%description -n kernel-macros
176
This package provides the rpm macros and templates for Kernel Module Pakcages
177
178
%source_timestamp
179
180
%package vanilla
181
%obsolete_rebuilds %name-vanilla
182
Summary: Vanilla Linux kernel sources with minor build fixes
183
Group: Development/Sources
184
AutoReqProv: off
185
Provides: %name-vanilla = %version-%source_rel
186
Provides: multiversion(kernel)
187
Requires: kernel-macros
188
189
%description vanilla
190
Vanilla Linux kernel sources with minor build fixes.
191
192
193
%source_timestamp
194
195
%prep
196
197
echo "Symbol(s): %symbols"
198
199
# Unpack all sources and patches
200
%setup -q -c -T -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 108 -a 109 -a 110 -a 111 -a 113 -a 120 -a 121
201
202
%build
203
%install
204
mkdir -p $RPM_BUILD_ROOT/usr/src
205
pushd $RPM_BUILD_ROOT/usr/src
206
207
# Unpack the vanilla kernel sources
208
tar -xf %{S:0}
209
if test "%srcversion" != "%kernelrelease%variant"; then
210
mv linux-%srcversion linux-%kernelrelease%variant
211
fi
212
213
%if %do_vanilla
214
%if %vanilla_only
215
mv \
216
%else
217
cp -al \
218
%endif
219
linux-%kernelrelease%variant linux-%kernelrelease-vanilla
220
cd linux-%kernelrelease-vanilla
221
%_sourcedir/apply-patches --vanilla %_sourcedir/series.conf %my_builddir %symbols
222
rm -f $(find . -name ".gitignore")
223
cd ..
224
%endif
225
226
%if ! %vanilla_only
227
cd linux-%kernelrelease%variant
228
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols
229
rm -f $(find . -name ".gitignore")
230
231
if [ -f %_sourcedir/localversion ] ; then
232
cat %_sourcedir/localversion > localversion
233
fi
234
cd ..
235
%endif
236
237
# Hardlink duplicate files automatically (from package fdupes).
238
%fdupes $RPM_BUILD_ROOT
239
popd
240
241
%if ! %vanilla_only
242
# Install the documentation and example Kernel Module Package.
243
DOC=/usr/share/doc/packages/%name-%kernelrelease
244
mkdir -p %buildroot/$DOC
245
cp %_sourcedir/README.SUSE %_sourcedir/config-options.changes.txt %buildroot/$DOC
246
ln -s $DOC/README.SUSE %buildroot/%src_install_dir/
247
248
%if "%variant" == ""
249
install -m 755 -d $RPM_BUILD_ROOT/etc/rpm
250
install -m 644 %_sourcedir/macros.kernel-source $RPM_BUILD_ROOT/etc/rpm/
251
install -m 755 -d $RPM_BUILD_ROOT/usr/lib/rpm
252
install -m 644 %_sourcedir/kernel-{module,cert}-subpackage \
253
$RPM_BUILD_ROOT/usr/lib/rpm/
254
install -m 755 -d $RPM_BUILD_ROOT/usr/lib/rpm/kernel
255
install -m 755 %_sourcedir/{splitflist,mergedep,moddep,modflist,kernel-subpackage-build} $RPM_BUILD_ROOT/usr/lib/rpm/kernel
256
install -m 644 %_sourcedir/kernel-subpackage-spec $RPM_BUILD_ROOT/usr/lib/rpm/kernel
257
install -m 644 -T %_sourcedir/kernel-default-base.spec.txt $RPM_BUILD_ROOT/usr/lib/rpm/kernel/kernel-default-base.spec
258
%endif
259
260
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
261
-e "s:@SRCVARIANT@:%variant:g" \
262
%_sourcedir/source-post.sh > %name-post.sh
263
264
pushd "%buildroot"
265
perl "%_sourcedir/group-source-files.pl" \
266
-D "$OLDPWD/devel.files" -N "$OLDPWD/nondevel.files" \
267
-L "%src_install_dir"
268
popd
269
270
find %{buildroot}/usr/src/linux* -type f -name '*.[ch]' -perm /0111 -exec chmod -v a-x {} +
271
# OBS checks don't like /usr/bin/env in script interpreter lines
272
grep -Elr '^#! */usr/bin/env ' %{buildroot}/usr/src/linux* | while read f; do
273
sed -re '1 { s_^#! */usr/bin/env +/_#!/_ ; s_^#! */usr/bin/env +([^/])_#!/usr/bin/\1_ }' -i "$f"
274
done
275
# kernel-source and kernel-$flavor-devel are built independently, but the
276
# shipped sources (/usr/src/linux/) need to be older than generated files
277
# (/usr/src/linux-obj). We rely on the git commit timestamp to not point into
278
# the future and be thus lower than the timestamps of files built from the
279
# source (bnc#669669).
280
ts="$(head -n1 %_sourcedir/source-timestamp)"
281
find %buildroot/usr/src/linux* ! -type l | xargs touch -d "$ts"
282
283
%post -f %name-post.sh
284
285
%post -n kernel-devel%variant -f %name-post.sh
286
287
%files -f nondevel.files
288
%defattr(-, root, root)
289
290
%files -n kernel-devel%variant -f devel.files
291
%defattr(-,root,root)
292
%ghost /usr/src/linux%variant
293
%doc /usr/share/doc/packages/*
294
295
%if "%variant" == ""
296
%files -n kernel-macros
297
%defattr(-,root,root)
298
/etc/rpm/macros.kernel-source
299
/usr/lib/rpm/kernel-*-subpackage
300
%dir /usr/lib/rpm/kernel
301
/usr/lib/rpm/kernel/*
302
%endif
303
304
%endif
305
306
%if %do_vanilla
307
308
%files vanilla
309
%defattr(-, root, root)
310
/usr/src/linux-%kernelrelease-vanilla
311
%endif
312
313
%changelog
314