/[packages]/updates/6/kernel-linus/current/SPECS/kernel-linus.spec
ViewVC logotype

Contents of /updates/6/kernel-linus/current/SPECS/kernel-linus.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 912902 - (show annotations) (download)
Mon Dec 21 13:13:30 2015 UTC (8 years, 4 months ago) by tmb
Original Path: cauldron/kernel-linus/current/SPECS/kernel-linus.spec
File size: 26245 byte(s)
- update to 4.4-rc6
- update defconfigs


1 # upstream versioning
2 %define kernelversion 4
3 %define patchlevel 4
4 # sublevel is now used for -stable patches
5 %define sublevel 0
6 # extstable is for extended stable patches
7 %define extstable 0
8
9 # kernel Makefile extraversion is substituted by
10 # kpatch/kgit wich are either 0 (empty), rc (kpatch), git (kgit)
11 %define kpatch rc6
12
13 # kernel.org -gitX patch (only the number after "git")
14 %define kgit 0
15
16 # this is the releaseversion
17 %define mgarelease 1
18
19 # This is only to make life easier for people that creates derivated kernels
20 # a.k.a name it kernel-tmb :)
21 %define kname kernel-linus
22
23 %define rpmtag %{distsuffix}%{mgaver}
24 %if %kpatch
25 %if %kgit
26 %define rpmrel %mkrel 0.%{kpatch}.%{kgit}.%{mgarelease}
27 %else
28 %define rpmrel %mkrel 0.%{kpatch}.%{mgarelease}
29 %endif
30 %else
31 %define rpmrel %mkrel %{mgarelease}
32 %endif
33
34 # theese two never change, they are used to fool rpm/urpmi/smart
35 %define fakever 1
36 %define fakerel %mkrel 1
37
38 # When we are using a pre/rc patch, the tarball is a sublevel -1
39 %if %kpatch
40 %if %sublevel
41 %define tar_ver %{kernelversion}.%{patchlevel}
42 %else
43 %define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1)
44 %endif
45 %else
46 %define tar_ver %{kernelversion}.%{patchlevel}
47 %endif
48 %if %extstable
49 %define kversion %{kernelversion}.%{patchlevel}.%{sublevel}.%{extstable}
50 %else
51 %define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
52 %endif
53 %define kverrel %{kversion}-%{rpmrel}
54
55 # used for not making too long names for rpms or search paths
56 %if %kpatch
57 %if %kgit
58 %define buildrpmrel 0.%{kpatch}.%{kgit}.%{mgarelease}%{rpmtag}
59 %else
60 %define buildrpmrel 0.%{kpatch}.%{mgarelease}%{rpmtag}
61 %endif
62 %else
63 %define buildrpmrel %{mgarelease}%{rpmtag}
64 %endif
65
66 %define buildrel %{kversion}-%{buildrpmrel}
67
68 %define klinus_notice NOTE: This kernel has no Mageia patches and no third-party drivers.
69
70 # having different top level names for packges means that you have to remove them by hard :(
71 %define top_dir_name %{kname}-%{_arch}
72
73 %define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
74 %define src_dir %{build_dir}/linux-%{tar_ver}
75
76 # disable useless debug rpms...
77 %define _enable_debug_packages %{nil}
78 %define debug_package %{nil}
79
80 # build defines
81 %define build_doc 1
82 %define build_source 1
83 %define build_devel 1
84
85 %define build_kernel 1
86
87 %define distro_branch %(perl -pe '/(\\d+)\\.(\\d)\\.?(\\d)?/; $_="$1.$2"' /etc/mageia-release)
88
89 # End of user definitions
90 %{?_without_kernel: %global build_kernel 0}
91 %{?_without_doc: %global build_doc 0}
92 %{?_without_source: %global build_source 0}
93 %{?_without_devel: %global build_devel 0}
94
95 %{?_with_kernel: %global build_kernel 1}
96 %{?_with_doc: %global build_doc 1}
97 %{?_with_source: %global build_source 1}
98 %{?_with_devel: %global build_devel 1}
99
100 %if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi)
101 %define kmake %make CC="$CC"
102 %else
103 %define kmake %make
104 %endif
105 # there are places where parallel make don't work
106 %define smake make
107
108 # Parallelize xargs invocations on smp machines
109 %define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\
110 && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
111 [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS")
112
113 # Aliases for amd64 builds (better make source links?)
114 %define target_cpu %(echo %{_target_cpu} | sed -e "s/amd64/x86_64/")
115 %define target_arch %(echo %{_arch} | sed -e "s/amd64/x86_64/" -e 's/arm.*/arm/')
116
117 # src.rpm description
118 Summary: The Linux kernel (the core of the Linux operating system)
119 Name: %{kname}
120 Version: %{kversion}
121 Release: %{rpmrel}
122 License: GPLv2
123 Group: System/Kernel and hardware
124 ExclusiveArch: %{ix86} x86_64 %{arm}
125 ExclusiveOS: Linux
126 URL: http://www.kernel.org/
127
128 ####################################################################
129 #
130 # Sources
131 #
132 ### This is for full SRC RPM
133 Source0: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/linux-%{tar_ver}.tar.xz
134 Source1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/linux-%{tar_ver}.tar.sign
135
136 # This is for disabling mrproper and other targets on -devel rpms
137 Source2: disable-mrproper-in-devel-rpms.patch
138
139 Source4: README.kernel-sources
140
141 # Kernel defconfigs
142 Source20: i386_defconfig
143 Source21: x86_64_defconfig
144 Source22: arm_defconfig
145
146 ####################################################################
147 #
148 # Patches
149
150 #
151 # Patch0 to Patch100 are for core kernel upgrades.
152 #
153
154 # Pre linus patch: ftp://ftp.kernel.org/pub/linux/kernel/v(kernelversion).(patchlevel)/testing
155
156 %if %sublevel
157 Patch1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{sublevel}.xz
158 Source11: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{sublevel}.sign
159 %endif
160 %if %kpatch
161 Source200: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/testing/patch-%{kernelversion}.%{patchlevel}-%{kpatch}.xz
162 Source12: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/testing/patch-%{kernelversion}.%{patchlevel}-%{kpatch}.sign
163 %endif
164 %if %extstable
165 Patch3: patch-%{kernelversion}.%{patchlevel}.%{sublevel}.%{extstable}.patch
166 %endif
167
168 # critical fixes
169
170 #END
171 ####################################################################
172
173 # global defines
174 Autoreqprov: no
175 BuildRequires: gcc
176 BuildRequires: kmod >= 12-2
177 BuildRequires: bc
178 BuildRequires: binutils >= 1:2.25.1
179 %ifarch %{arm}
180 BuildRequires: uboot-mkimage
181 %endif
182
183 %description
184 Source package to build the Linux kernel.
185
186 %{klinus_notice}
187
188
189 #
190 # kernel: Symmetric MultiProcessing kernel
191 #
192 %if %build_kernel
193 %package -n %{kname}-%{buildrel}
194 Version: %{fakever}
195 Release: %{fakerel}
196 %ifarch %{ix86}
197 Summary: Linux Kernel for desktop use with i586 & 4GB RAM
198 %else
199 %ifarch %{arm}
200 Linux Kernel for Arm machines based on Kirkwood
201 %else
202 Summary: Linux Kernel for desktop use with %{_arch}
203 %endif
204 %endif
205 Group: System/Kernel and hardware
206 Provides: should-restart = system
207 Provides: kernel = %{tar_ver}
208 Provides: alsa
209 Requires: bootloader-utils >= 1.16-1
210 Requires: dracut >= 038-21
211 Requires: kmod >= 12-2
212 Requires: sysfsutils >= 2.1.0-16
213 Requires: kernel-firmware >= 20150722-1
214
215 # conflict dkms packages that dont support kernel-4.2
216 Conflicts: dkms-broadcom-wl < 6.30.223.248-8
217 Conflicts: dkms-fglrx < 15.201.1151-2
218 Conflicts: dkms-nvidia-current < 346.72-1
219 Conflicts: dkms-nvidia340 < 340.76-2
220 Conflicts: dkms-nvidia304 < 304.125-5
221 Conflicts: dkms-virtualbox < 5.0.4-1
222 Conflicts: dkms-xtables-addons < 2.8-1
223 # not supported by x11-server-1.16
224 Conflicts: dkms-nvidia173 <= 173.14.39
225 # (tmb) nvidia96xx does not support this kernel or x11-server-1.13
226 Conflicts: dkms-nvidia96xx <= 96.43.23
227 # (tmb) conflict too old lvm2 rules to make upgrades work (tv, mga #9536)
228 Conflicts: lvm2 < 2.02.98-3
229 # (tmb) conflict too old drakxtools-backend to avoid bogus root=/dev/ (#9536)
230 Conflicts: drakxtools-backend < 15.37-1
231 # (tmb) conflict older btrfs-progs to get the new in same transaction and in initrd
232 Conflicts: btrfs-progs < 4.1-1
233 # (tmb) conflict too old plymouth (mga#15486)
234 Conflicts: plymouth < 0.8.6.1-13
235 # (tmb) conflict too old radeon-firmware to get the uvd firmwares in initrd
236 Conflicts: radeon-firmware < 20150722-1
237 # (tmb) conflict old firmware to get the firmwares in initrd
238 Conflicts: kernel-firmware-nonfree < 20150722-1
239 # (tmb) conflict old theme to get mga5 theme in initrd
240 Conflicts: mageia-gfxboot-theme < 4.5.6.6-1
241 # (tmb) conflict too old grub2(-efi)
242 Conflicts: grub2 < 2.02-0.git9752.18
243 Conflicts: grub2-efi < 2.02-0.git9752.18
244 # (tmb) conflict too old efibootmgr
245 Conflicts: efibootmgr < 0.11.0-7
246 # (tmb) conflict for vmmouse breakage (mga#16954)
247 Conflicts: x11-driver-input-vmmouse < 13.1.0-1
248
249 %ifarch %{ix86}
250 Conflicts: arch(x86_64)
251 %endif
252
253 %description -n %{kname}-%{buildrel}
254 %ifarch %{ix86}
255 This kernel is compiled for desktop use, single or multiple i586
256 processor(s)/core(s) and less than 4GB RAM, using HZ_1000, voluntary
257 preempt, CFS cpu scheduler and cfq i/o scheduler.
258 This kernel relies on in-kernel smp alternatives to switch between
259 up & smp mode depending on detected hardware. To force the kernel
260 to boot in single processor mode, use the "nosmp" boot parameter.
261 %else
262 %ifarch %{arm}
263 This kernel is compiled for Arm Kirkwood boxes. It will run on openrd
264 boards. It's configured using HZ_100, preempt, CFS cpu scheduler and
265 cfq i/o scheduler.
266 This kernel relies on in-kernel smp alternatives to switch between
267 up & smp mode depending on detected hardware. To force the kernel
268 to boot in single processor mode, use the "nosmp" boot parameter.
269 %else
270 This kernel is compiled for desktop use, single or multiple %{_arch}
271 processor(s)/core(s), using HZ_1000, voluntary preempt, CFS cpu
272 scheduler and cfq i/o scheduler.
273 This kernel relies on in-kernel smp alternatives to switch between
274 up & smp mode depending on detected hardware. To force the kernel
275 to boot in single processor mode, use the "nosmp" boot parameter.
276 %endif
277 %endif
278
279 %{klinus_notice}
280 %endif # build_kernel
281
282
283 #
284 # kernel-source: kernel sources
285 #
286 %if %build_source
287 %package -n %{kname}-source-%{buildrel}
288 Version: %{fakever}
289 Release: %{fakerel}
290 Provides: %{kname}-source, kernel-source = %{kverrel}
291 Provides: %{kname}-source-%{kernelversion}.%{patchlevel}
292 Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils
293 Summary: The source code for the Linux kernel
294 Group: Development/Kernel
295 Autoreqprov: no
296 Buildarch: noarch
297
298 %description -n %{kname}-source-%{buildrel}
299 The %{kname}-source package contains the source code files for the
300 Linux kernel. Theese source files are only needed if you want to build
301 your own custom kernel that is better tuned to your particular hardware.
302
303 If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...)
304 drivers against, install the *-devel-* rpm that is matching your kernel.
305
306 %{klinus_notice}
307 %endif #build_source
308
309
310 #
311 # kernel-devel: stripped kernel sources
312 #
313 %if %build_devel
314 %package -n %{kname}-devel-%{buildrel}
315 Version: %{fakever}
316 Release: %{fakerel}
317 Provides: kernel-devel = %{kverrel}
318 Summary: The %{kname} devel files for 3rdparty modules build
319 Group: Development/Kernel
320 Autoreqprov: no
321 Requires: glibc-devel, ncurses-devel, make, gcc, perl
322 %ifarch %{ix86}
323 Conflicts: arch(x86_64)
324 %endif
325
326 %description -n %{kname}-devel-%{buildrel}
327 This package contains the kernel-devel files that should be enough to build
328 3rdparty drivers against for use with the %{kname}-%{buildrel}.
329
330 If you want to build your own kernel, you need to install the full
331 %{kname}-source-%{buildrel} rpm.
332
333 %{klinus_notice}
334 %endif #build_devel
335
336
337 #
338 # kernel-doc: documentation for the Linux kernel
339 #
340 %if %build_doc
341 %package -n %{kname}-doc
342 Version: %{kversion}
343 Release: %{rpmrel}
344 Summary: Various documentation bits found in the kernel source
345 Group: Documentation
346 Buildarch: noarch
347
348 %description -n %{kname}-doc
349 This package contains documentation files form the kernel source. Various
350 bits of information about the Linux kernel and the device drivers shipped
351 with it are documented in these files. You also might want install this
352 package if you need a reference to the options that can be passed to Linux
353 kernel modules at load time.
354
355 %{klinus_notice}
356 %endif #build_doc
357
358
359 #
360 # kernel-latest: virtual rpm
361 #
362 %if %build_kernel
363 %package -n %{kname}-latest
364 Version: %{kversion}
365 Release: %{rpmrel}
366 Summary: Virtual rpm for latest %{kname}
367 Group: System/Kernel and hardware
368 Requires: %{kname}-%{buildrel}
369 %ifarch %{ix86}
370 Conflicts: arch(x86_64)
371 %endif
372
373 %description -n %{kname}-latest
374 This package is a virtual rpm that aims to make sure you always have the
375 latest %{kname} installed...
376
377 %{klinus_notice}
378 %endif #build_kernel
379
380
381 #
382 # kernel-source-latest: virtual rpm
383 #
384 %if %build_source
385 %package -n %{kname}-source-latest
386 Version: %{kversion}
387 Release: %{rpmrel}
388 Summary: Virtual rpm for latest %{kname}-source
389 Group: System/Kernel and hardware
390 Requires: %{kname}-source-%{buildrel}
391 Buildarch: noarch
392
393 %description -n %{kname}-source-latest
394 This package is a virtual rpm that aims to make sure you always have the
395 latest %{kname}-source installed...
396
397 %{klinus_notice}
398 %endif #build_source
399
400
401 #
402 # kernel-devel-latest: virtual rpm
403 #
404 %if %build_devel
405 %package -n %{kname}-devel-latest
406 Version: %{kversion}
407 Release: %{rpmrel}
408 Summary: Virtual rpm for latest %{kname}-devel
409 Group: System/Kernel and hardware
410 Requires: %{kname}-devel-%{buildrel}
411 %ifarch %{ix86}
412 Conflicts: arch(x86_64)
413 %endif
414
415 %description -n %{kname}-devel-latest
416 This package is a virtual rpm that aims to make sure you always have the
417 latest %{kname}-devel installed...
418
419 %{klinus_notice}
420 %endif #build_devel
421
422
423 #
424 # End packages - here begins build stage
425 #
426 %prep
427 %setup -q -n %top_dir_name -c
428
429 pushd %src_dir
430
431 %if %sublevel
432 %patch1 -p1
433 %endif
434 %if %kpatch
435 # (tmb) temp work around patch hiccup handling binary removal
436 xz -dc %{SOURCE200} | patch -p1 || true
437 rm -f drivers/staging/ft1000/ft1000-pcmcia/ft1000.img
438 rm -f drivers/staging/ft1000/ft1000-usb/ft3000.img
439 %endif
440 %if %extstable
441 %patch3 -p1
442 %endif
443
444 # critical fixes
445
446 popd
447
448 # PATCH END
449
450
451 #
452 # Setup Begin
453 #
454
455
456 # Install defconfigs...
457 install %{SOURCE20} %{build_dir}/linux-%{tar_ver}/arch/x86/configs/
458 install %{SOURCE21} %{build_dir}/linux-%{tar_ver}/arch/x86/configs/
459 install %{SOURCE22} %{build_dir}/linux-%{tar_ver}/arch/arm/configs/
460
461 # make sure the kernel has the sublevel we know it has...
462 LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" linux-%{tar_ver}/Makefile
463
464
465 %build
466 # Common target directories
467 %define _bootdir /boot
468 %define _modulesdir /lib/modules
469 %define _kerneldir /usr/src/%{kname}-%{buildrel}
470 %define _develdir /usr/src/%{kname}-devel-%{buildrel}
471
472
473 # Directories definition needed for building
474 %define temp_root %{build_dir}/temp-root
475 %define temp_boot %{temp_root}%{_bootdir}
476 %define temp_modules %{temp_root}%{_modulesdir}
477 %define temp_source %{temp_root}%{_kerneldir}
478 %define temp_devel %{temp_root}%{_develdir}
479
480
481 # Create a simulacro of buildroot
482 rm -rf %{temp_root}
483 install -d %{temp_root}
484
485
486 # make sure we are in the directory
487 cd %{src_dir}
488
489 # make sure EXTRAVERSION says what we want it to say
490 %if %extstable
491 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = .%{extstable}-%{buildrpmrel}/" Makefile
492 %else
493 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{buildrpmrel}/" Makefile
494 %endif
495
496 # Prepare the kernel
497 %smake -s mrproper
498 %ifarch %{ix86} x86_64
499 cp arch/x86/configs/%{target_arch}_defconfig .config
500 %else
501 cp arch/%{target_arch}/%{target_arch}_defconfig .config
502 %endif
503 %smake oldconfig
504
505 # Build the kernel
506 %kmake -s all
507 %ifarch %{arm}
508 %kmake uImage
509 %endif
510 # Install kernel
511 install -d %{temp_boot}
512 install -m 644 System.map %{temp_boot}/System.map-%{buildrel}
513 install -m 644 .config %{temp_boot}/config-%{buildrel}
514 %ifarch %{arm}
515 cp -f arch/%{target_arch}/boot/uImage %{temp_boot}/uImage-$KernelVer
516 %else
517 cp -f arch/%{target_arch}/boot/bzImage %{temp_boot}/vmlinuz-%{buildrel}
518 %endif
519
520 # Install modules
521 install -d %{temp_modules}/%{buildrel}
522 %smake INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=%{buildrel} modules_install
523
524 # remove /lib/firmware, we use a separate kernel-firmware
525 rm -rf %{temp_root}/lib/firmware
526
527 # Save devel tree
528 %if %build_devel
529 mkdir -p %{temp_devel}
530 for i in $(find . -name 'Makefile*'); do cp -R --parents $i %{temp_devel};done
531 for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*' -o -name config.mk); do cp -R --parents $i %{temp_devel};done
532 cp -fR Documentation/DocBook/media/*.b64 %{temp_devel}/Documentation/DocBook/media/
533 cp -fR include %{temp_devel}
534 cp -fR scripts %{temp_devel}
535 cp -fR tools/include %{temp_devel}/tools/
536 %ifarch %{arm}
537 cp -fR arch/%{target_arch}/tools %{temp_devel}/arch/%{target_arch}/
538 %endif
539 %ifarch %{ix86} x86_64
540 cp -fR arch/x86/boot/{ctype.h,string.{c,h}} %{temp_devel}/arch/x86/boot/
541 cp -fR arch/x86/kernel/asm-offsets.{c,s} %{temp_devel}/arch/x86/kernel/
542 cp -fR arch/x86/kernel/asm-offsets_{32,64}.c %{temp_devel}/arch/x86/kernel/
543 cp -fR arch/x86/purgatory/* %{temp_devel}/arch/x86/purgatory/
544 cp -fR arch/x86/entry/syscalls/syscall* %{temp_devel}/arch/x86/entry/syscalls/
545 cp -fR arch/x86/include %{temp_devel}/arch/x86/
546 cp -fR arch/x86/tools %{temp_devel}/arch/x86/
547 %else
548 cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} %{temp_devel}/arch/%{target_arch}/kernel/
549 for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f %{temp_devel}; done
550 %endif
551
552 # Needed for generation of kernel/bounds.s
553 cp -fR kernel/bounds.c %{temp_devel}/kernel/
554
555 # needed by include/generated/timeconst.h
556 cp -fR kernel/time/timeconst.bc %{temp_devel}/kernel/time/
557
558 # Needed for lguest
559 cp -fR drivers/lguest/lg.h %{temp_devel}/drivers/lguest/
560
561 cp -fR .config Module.symvers %{temp_devel}
562
563 # Needed for truecrypt build (Danny)
564 cp -fR drivers/md/dm.h %{temp_devel}/drivers/md/
565
566 # Needed for external dvb tree (#41418)
567 cp -fR drivers/media/dvb-core/*.h %{temp_devel}/drivers/media/dvb-core/
568 cp -fR drivers/media/dvb-frontends/lgdt330x.h %{temp_devel}/drivers/media/dvb-frontends/
569
570 # add acpica header files, needed for fglrx build
571 cp -fR drivers/acpi/acpica/*.h %{temp_devel}/drivers/acpi/acpica/
572
573 # Check and clean the -devel tree
574 pushd %{temp_devel} >/dev/null
575 %smake -s prepare scripts clean
576 rm -f .config.old
577 popd >/dev/null
578
579 # Disable mrproper and other targets
580 patch -p1 -d %{temp_devel} -i %{SOURCE2}
581
582 # Fix permissions
583 chmod -R a+rX %{temp_devel}
584 %endif # build_devel
585
586 #make sure we are in the directory
587 cd %src_dir
588
589 # kernel-source is shipped as an unprepared tree
590 %smake -s mrproper
591
592
593 ###
594 ### Install
595 ###
596 %install
597 install -m 644 %{SOURCE4} .
598
599 cd %src_dir
600 # Directories definition needed for installing
601 %define target_source %{buildroot}/%{_kerneldir}
602 %define target_boot %{buildroot}%{_bootdir}
603 %define target_modules %{buildroot}%{_modulesdir}
604 %define target_devel %{buildroot}%{_develdir}
605
606 # We want to be able to test several times the install part
607 rm -rf %{buildroot}
608 cp -a %{temp_root} %{buildroot}
609
610 # Create directories infastructure
611 %if %build_source
612 install -d %{target_source}
613
614 tar cf - . | tar xf - -C %{target_source}
615 chmod -R a+rX %{target_source}
616
617 # we remove all the source files that we don't ship
618
619 # first architecture files
620 for i in alpha arc avr32 blackfin c6x cris frv hexagon h8300 ia64 m32r mips \
621 microblaze m68k m68knommu metag mn10300 nios2 openrisc parisc powerpc ppc \
622 s390 score sh sh64 sparc tile unicore32 v850 xtensa; do
623 rm -rf %{target_source}/arch/$i
624
625 %if %build_devel
626 rm -rf %{target_devel}/arch/$i
627 %endif
628 done
629 %ifnarch %{arm}
630 rm -rf %{target_source}/include/kvm/arm*
631 %endif
632
633 # remove arch files based on target arch in -devel rpms
634 %if %build_devel
635 %ifnarch %{ix86} x86_64
636 rm -rf %{target_devel}/arch/x86
637 %endif
638 %ifnarch %{arm}
639 rm -rf %{target_devel}/arch/arm
640 rm -rf %{target_devel}/arch/arm64
641 rm -rf %{target_devel}/include/kvm/arm*
642 rm -rf %{target_devel}/include/soc/tegra
643 %endif
644 %endif
645
646
647 # other misc files
648 rm -f %{target_source}/{.config.old,.config.cmd,.tmp_gas_check,.mailmap,.missing-syscalls.d,arch/.gitignore,.get_maintainer.ignore}
649 rm -rf %{target_source}/.tmp_depmod/
650
651 #endif %build_source
652 %endif
653
654
655 # compressing modules
656 find %{target_modules} -name "*.ko" | %kxargs xz -6e
657
658
659 # We used to have a copy of PrepareKernel here
660 # Now, we make sure that the thing in the linux dir is what we want it to be
661
662 for i in %{target_modules}/*; do
663 rm -f $i/build $i/source
664 done
665
666
667 # sniff, if we gzipped all the modules, we change the stamp :(
668 # we really need the depmod -ae here
669 pushd %{target_modules}
670 for i in *; do
671 /sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
672 echo $?
673 done
674
675 for i in *; do
676 pushd $i
677 echo "Creating module.description for $i"
678 modules=`find . -name "*.ko.xz"`
679 echo $modules | %kxargs /sbin/modinfo \
680 | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description
681 popd
682 done
683 popd
684
685
686 ###
687 ### Clean
688 ###
689
690 %clean
691 rm -rf %{buildroot}
692 # We don't want to remove this, the whole reason of its existence is to be
693 # able to do several rpm --short-circuit -bi for testing install
694 # phase without repeating compilation phase
695 #rm -rf %{temp_root}
696
697
698 ###
699 ### Scripts
700 ###
701
702 ### kernel
703 %if %build_kernel
704 %preun -n %{kname}-%{buildrel}
705 /sbin/installkernel -R %{buildrel}
706 if [ -L /lib/modules/%{buildrel}/build ]; then
707 rm -f /lib/modules/%{buildrel}/build
708 fi
709 if [ -L /lib/modules/%{buildrel}/source ]; then
710 rm -f /lib/modules/%{buildrel}/source
711 fi
712 pushd /boot > /dev/null
713 if [ -L vmlinuz-linus ]; then
714 if [ "$(readlink vmlinuz-linus)" = "vmlinuz-%{buildrel}" ]; then
715 rm -f vmlinuz-linus
716 fi
717 fi
718 if [ -L initrd-linus.img ]; then
719 if [ "$(readlink initrd-linus.img)" = "initrd-%{buildrel}.img" ]; then
720 rm -f initrd-linus.img
721 fi
722 fi
723 popd > /dev/null
724 exit 0
725
726 %post -n %{kname}-%{buildrel}
727 /sbin/installkernel -L %{buildrel}
728 if [ -d /usr/src/%{kname}-devel-%{buildrel} ]; then
729 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/build
730 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/source
731 fi
732 pushd /boot > /dev/null
733 if [ -L vmlinuz-linus ]; then
734 rm -f vmlinuz-linus
735 fi
736 ln -sf vmlinuz-%{buildrel} vmlinuz-linus
737 if [ -L initrd-linus.img ]; then
738 rm -f initrd-linus.img
739 fi
740 ln -sf initrd-%{buildrel}.img initrd-linus.img
741 popd > /dev/null
742
743 %posttrans -n %{kname}-%{buildrel}
744 if [ -x /usr/sbin/dkms_autoinstaller -a -d /usr/src/%{kname}-devel-%{buildrel} ]; then
745 /usr/sbin/dkms_autoinstaller start %{buildrel}
746 fi
747
748 %postun -n %{kname}-%{buildrel}
749 /sbin/kernel_remove_initrd %{buildrel}
750 rm -rf /lib/modules/%{buildrel} > /dev/null
751 %endif # build_kernel
752
753
754 ### kernel-devel
755 %if %build_devel
756 %post -n %{kname}-devel-%{buildrel}
757 # place /build and /source symlinks in place.
758 if [ -d /lib/modules/%{buildrel} ]; then
759 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/build
760 ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/source
761 fi
762
763 %preun -n %{kname}-devel-%{buildrel}
764 # we need to delete <modules>/{build,source} at uninstall
765 if [ -L /lib/modules/%{buildrel}/build ]; then
766 rm -f /lib/modules/%{buildrel}/build
767 fi
768 if [ -L /lib/modules/%{buildrel}/source ]; then
769 rm -f /lib/modules/%{buildrel}/source
770 fi
771 exit 0
772 %endif #build_devel
773
774
775 ###
776 ### file lists
777 ###
778
779 # kernel
780 %if %build_kernel
781 %files -n %{kname}-%{buildrel}
782 %{_bootdir}/config-%{buildrel}
783 %ifarch %{arm}
784 %{_bootdir}/uImage-%{buildrel}
785 %else
786 %{_bootdir}/vmlinuz-%{buildrel}
787 %endif
788 %{_bootdir}/System.map-%{buildrel}
789 %dir %{_modulesdir}/%{buildrel}/
790 %{_modulesdir}/%{buildrel}/kernel
791 %{_modulesdir}/%{buildrel}/modules.*
792 %doc README.kernel-sources
793 %endif # build_kernel
794
795 # kernel-source
796 %if %build_source
797 %files -n %{kname}-source-%{buildrel}
798 %dir %{_kerneldir}
799 %dir %{_kerneldir}/arch
800 %dir %{_kerneldir}/include
801 %{_kerneldir}/.gitignore
802 %{_kerneldir}/COPYING
803 %{_kerneldir}/CREDITS
804 %{_kerneldir}/Documentation
805 %{_kerneldir}/Kbuild
806 %{_kerneldir}/Kconfig
807 %{_kerneldir}/MAINTAINERS
808 %{_kerneldir}/Makefile
809 %{_kerneldir}/README
810 %{_kerneldir}/REPORTING-BUGS
811 %{_kerneldir}/arch/Kconfig
812 %{_kerneldir}/arch/arm
813 %{_kerneldir}/arch/arm64
814 %{_kerneldir}/arch/x86
815 %{_kerneldir}/arch/um
816 %{_kerneldir}/block
817 %{_kerneldir}/certs
818 %{_kerneldir}/crypto
819 %{_kerneldir}/drivers
820 %{_kerneldir}/firmware
821 %{_kerneldir}/fs
822 %{_kerneldir}/include/Kbuild
823 %{_kerneldir}/include/acpi
824 %{_kerneldir}/include/asm-generic
825 %{_kerneldir}/include/clocksource
826 %{_kerneldir}/include/crypto
827 %{_kerneldir}/include/drm
828 %{_kerneldir}/include/dt-bindings
829 %{_kerneldir}/include/kvm
830 %{_kerneldir}/include/linux
831 %{_kerneldir}/include/math-emu
832 %{_kerneldir}/include/memory
833 %{_kerneldir}/include/net
834 %{_kerneldir}/include/pcmcia
835 %{_kerneldir}/include/ras
836 %{_kerneldir}/include/scsi
837 %{_kerneldir}/include/soc
838 %{_kerneldir}/include/sound
839 %{_kerneldir}/include/target
840 %{_kerneldir}/include/trace
841 %{_kerneldir}/include/uapi
842 %{_kerneldir}/include/video
843 %{_kerneldir}/include/media
844 %{_kerneldir}/include/misc
845 %{_kerneldir}/include/rxrpc
846 %{_kerneldir}/include/keys
847 %{_kerneldir}/include/rdma
848 %{_kerneldir}/include/xen
849 %{_kerneldir}/init
850 %{_kerneldir}/ipc
851 %{_kerneldir}/kernel
852 %{_kerneldir}/lib
853 %{_kerneldir}/mm
854 %{_kerneldir}/net
855 %{_kerneldir}/samples
856 %{_kerneldir}/scripts
857 %{_kerneldir}/security
858 %{_kerneldir}/sound
859 %{_kerneldir}/tools
860 %{_kerneldir}/usr
861 %{_kerneldir}/virt
862 %doc README.kernel-sources
863 %endif # build_source
864
865 # kernel-devel
866 %if %build_devel
867 %files -n %{kname}-devel-%{buildrel}
868 %dir %{_develdir}
869 %dir %{_develdir}/arch
870 %dir %{_develdir}/include
871 %{_develdir}/.config
872 %{_develdir}/Documentation
873 %{_develdir}/Kbuild
874 %{_develdir}/Kconfig
875 %{_develdir}/Makefile
876 %{_develdir}/Module.symvers
877 %{_develdir}/arch/Kconfig
878 %ifarch %{arm}
879 %{_develdir}/arch/arm
880 %{_develdir}/arch/arm64
881 %endif
882 %ifarch %{ix86} x86_64
883 %{_develdir}/arch/x86
884 %endif
885 %{_develdir}/arch/um
886 %{_develdir}/block
887 %{_develdir}/certs
888 %{_develdir}/crypto
889 %{_develdir}/drivers
890 %{_develdir}/firmware
891 %{_develdir}/fs
892 %{_develdir}/include/Kbuild
893 %{_develdir}/include/acpi
894 %{_develdir}/include/asm-generic
895 %{_develdir}/include/clocksource
896 %{_develdir}/include/config
897 %{_develdir}/include/crypto
898 %{_develdir}/include/drm
899 %{_develdir}/include/dt-bindings
900 %{_develdir}/include/generated
901 %{_develdir}/include/keys
902 %{_develdir}/include/kvm
903 %{_develdir}/include/linux
904 %{_develdir}/include/math-emu
905 %{_develdir}/include/memory
906 %{_develdir}/include/misc
907 %{_develdir}/include/net
908 %{_develdir}/include/pcmcia
909 %{_develdir}/include/ras
910 %{_develdir}/include/rdma
911 %{_develdir}/include/scsi
912 %{_develdir}/include/soc
913 %{_develdir}/include/sound
914 %{_develdir}/include/target
915 %{_develdir}/include/trace
916 %{_develdir}/include/uapi
917 %{_develdir}/include/video
918 %{_develdir}/include/media
919 %{_develdir}/include/rxrpc
920 %{_develdir}/include/xen
921 %{_develdir}/init
922 %{_develdir}/ipc
923 %{_develdir}/kernel
924 %{_develdir}/lib
925 %{_develdir}/mm
926 %{_develdir}/net
927 %{_develdir}/samples
928 %{_develdir}/scripts
929 %{_develdir}/security
930 %{_develdir}/sound
931 %{_develdir}/tools
932 %{_develdir}/usr
933 %{_develdir}/virt
934 %doc README.kernel-sources
935 %endif # build_devel
936
937
938 %if %build_doc
939 %files -n %{kname}-doc
940 %doc linux-%{tar_ver}/Documentation/*
941 %endif # build_doc
942
943 %if %build_kernel
944 %files -n %{kname}-latest
945 %endif # build_kernel
946
947 %if %build_source
948 %files -n %{kname}-source-latest
949 %endif # build_source
950
951 %if %build_devel
952 %files -n %{kname}-devel-latest
953 %endif # build_devel

  ViewVC Help
Powered by ViewVC 1.1.30