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

Contents of /cauldron/kernel-linus/current/SPECS/kernel-linus.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.28