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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30