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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 201851 - (hide annotations) (download)
Thu Jan 26 10:49:05 2012 UTC (12 years, 2 months ago) by tmb
File size: 24697 byte(s)
update to 3.2.2-rt10
1 tmb 131493 # kernel version
2 tmb 128177 %define kernelversion 3
3 tmb 201851 %define patchlevel 2
4 tmb 128177 # sublevel is now used for -stable patches
5 tmb 201851 %define sublevel 2
6 tmb 128177
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 tmb 131727 %define mgarelease 1
16 tmb 128177
17     # this is the -rt release
18 tmb 201851 %define rt_ver 3.2
19     %define rt_rel rt10
20 tmb 128177
21     # This is only to make life easier for people that creates derivated kernels
22     # a.k.a name it kernel-tmb :)
23     %define kname kernel-rt
24    
25     %define rpmtag %{distsuffix}%{mgaver}
26     %if %kpatch
27     %if %kgit
28     %define rpmrel %mkrel 0.%{kpatch}.%{kgit}.%{rt_rel}.%{mgarelease}
29     %else
30     %define rpmrel %mkrel 0.%{kpatch}.%{rt_rel}.%{mgarelease}
31     %endif
32     %else
33     %define rpmrel %mkrel 0.%{rt_rel}.%{mgarelease}
34     %endif
35    
36     # theese two never change, they are used to fool rpm/urpmi/smart
37     %define fakever 1
38     %define fakerel %mkrel 1
39    
40     # When we are using a pre/rc patch, the tarball is a sublevel -1
41     %if %kpatch
42     %define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
43     %define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1)
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}.%{rt_rel}.%{mgarelease}%{rpmtag}
54     %else
55     %define buildrpmrel 0.%{kpatch}.%{rt_rel}.%{mgarelease}%{rpmtag}
56     %endif
57     %else
58     %define buildrpmrel 0.%{rt_rel}.%{mgarelease}%{rpmtag}
59     %endif
60    
61     %define buildrel %{kversion}-%{buildrpmrel}
62    
63     %define rt_notice NOTE: This kernel has no Mageia patches besides the -rt patch 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 tmb 128234 URL: https://rt.wiki.kernel.org/
122 tmb 128177
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.bz2
129     Source1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/linux-%{tar_ver}.tar.bz2.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 %kpatch
152 tmb 173093 Patch1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/testing/patch-%{kernelversion}.%{patchlevel}-%{kpatch}.xz
153     Source10: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/testing/patch-%{kernelversion}.%{patchlevel}-%{kpatch}.sign
154 tmb 128177 %endif
155     %if %sublevel
156 tmb 158007 Patch1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/patch-%{kversion}.xz
157     Source10: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/patch-%{kversion}.sign
158 tmb 128177 %endif
159     # kernel.org -git
160     %if %kgit
161 tmb 173093 Patch2: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/snapshots/patch-%{kernelversion}.%{patchlevel}-%{kpatch}-git%{kgit}.xz
162     Source11: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.%{patchlevel}/snapshots/patch-%{kernelversion}.%{patchlevel}-%{kpatch}-git%{kgit}.sign
163 tmb 128177 %endif
164    
165     # -rt patches
166 tmb 173093 Patch101: ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/patch-%{rt_ver}-%{rt_rel}.patch.xz
167     Source101: ftp://ftp.kernel.org/pub/linux/kernel/projects/rt/patch-%{rt_ver}-%{rt_rel}.patch.sign
168 tmb 128177
169     #END
170     ####################################################################
171    
172     # Defines for the things that are needed for all the kernels
173     %define requires1 module-init-tools >= 3.6-10
174     %define requires2 mkinitrd >= 3.4.43-10
175     %define requires3 bootloader-utils >= 1.9
176     %define requires4 sysfsutils
177     %define requires5 kernel-firmware >= 20101024
178    
179     %define kprovides kernel = %{tar_ver}, alsa
180    
181     BuildRoot: %{_tmppath}/%{name}-%{kversion}-build-%{_arch}
182     Autoreqprov: no
183     BuildRequires: gcc module-init-tools >= 0.9.15
184     %ifarch %{arm}
185     BuildRequires: uboot-mkimage
186     %endif
187    
188     %description
189     Source package to build the Linux kernel.
190    
191     %{rt_notice}
192    
193    
194     #
195     # kernel: Symmetric MultiProcessing kernel
196     #
197     %if %build_kernel
198     %package -n %{kname}-%{buildrel}
199     Version: %{fakever}
200     Release: %{fakerel}
201     %ifarch %{ix86}
202 tmb 128234 Summary: Linux realtime kernel for desktop use with i686 & 4GB RAM
203 tmb 128177 %else
204     %ifarch %{arm}
205 tmb 128234 Linux realtime kernel for Arm machines based on Kirkwood
206 tmb 128177 %else
207 tmb 128234 Summary: Linux realtime kernel for desktop use with %{_arch}
208 tmb 128177 %endif
209     %endif
210     Group: System/Kernel and hardware
211     Provides: %kprovides
212     Provides: should-restart = system
213     Requires: %requires1
214     Requires: %requires2
215     Requires: %requires3
216     Requires: %requires4
217     Requires: %requires5
218    
219     %ifarch %{ix86}
220     Conflicts: arch(x86_64)
221     %endif
222    
223     %description -n %{kname}-%{buildrel}
224     %ifarch %{ix86}
225 tmb 128234 This kernel is compiled for desktop use, single or multiple i686
226     processor(s)/core(s) and less than 4GB RAM, using HZ_1000, realtime
227 tmb 128177 preempt, CFS cpu scheduler and cfq i/o scheduler.
228     This kernel relies on in-kernel smp alternatives to switch between
229     up & smp mode depending on detected hardware. To force the kernel
230     to boot in single processor mode, use the "nosmp" boot parameter.
231     %else
232     %ifarch %{arm}
233     This kernel is compiled for Arm Kirkwood boxes. It will run on openrd
234 tmb 128234 boards. It's configured using HZ_100, realtime preempt, CFS cpu scheduler
235     and cfq i/o scheduler.
236 tmb 128177 This kernel relies on in-kernel smp alternatives to switch between
237     up & smp mode depending on detected hardware. To force the kernel
238     to boot in single processor mode, use the "nosmp" boot parameter.
239     %else
240     This kernel is compiled for desktop use, single or multiple %{_arch}
241 tmb 128234 processor(s)/core(s), using HZ_1000, realtime preempt, CFS cpu
242 tmb 128177 scheduler and cfq i/o scheduler.
243     This kernel relies on in-kernel smp alternatives to switch between
244     up & smp mode depending on detected hardware. To force the kernel
245     to boot in single processor mode, use the "nosmp" boot parameter.
246     %endif
247     %endif
248    
249     %{rt_notice}
250     %endif # build_kernel
251    
252    
253     #
254     # kernel-source: kernel sources
255     #
256     %if %build_source
257     %package -n %{kname}-source-%{buildrel}
258     Version: %{fakever}
259     Release: %{fakerel}
260     Provides: %{kname}-source, kernel-source = %{kverrel}
261     Provides: %{kname}-source-%{kernelversion}.%{patchlevel}
262     Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils
263     Summary: The source code for the Linux kernel
264     Group: Development/Kernel
265     Autoreqprov: no
266     Buildarch: noarch
267    
268     %description -n %{kname}-source-%{buildrel}
269     The %{kname}-source package contains the source code files for the
270     Linux kernel. Theese source files are only needed if you want to build
271     your own custom kernel that is better tuned to your particular hardware.
272    
273     If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...)
274     drivers against, install the *-devel-* rpm that is matching your kernel.
275    
276     %{rt_notice}
277     %endif #build_source
278    
279    
280     #
281     # kernel-devel: stripped kernel sources
282     #
283     %if %build_devel
284     %package -n %{kname}-devel-%{buildrel}
285     Version: %{fakever}
286     Release: %{fakerel}
287     Provides: kernel-devel = %{kverrel}
288     Summary: The %{kname} devel files for 3rdparty modules build
289     Group: Development/Kernel
290     Autoreqprov: no
291     Requires: glibc-devel, ncurses-devel, make, gcc, perl
292     %ifarch %{ix86}
293     Conflicts: arch(x86_64)
294     %endif
295    
296     %description -n %{kname}-devel-%{buildrel}
297     This package contains the kernel-devel files that should be enough to build
298     3rdparty drivers against for use with the %{kname}-%{buildrel}.
299    
300     If you want to build your own kernel, you need to install the full
301     %{kname}-source-%{buildrel} rpm.
302    
303     %{rt_notice}
304     %endif #build_devel
305    
306    
307     #
308     # kernel-doc: documentation for the Linux kernel
309     #
310     %if %build_doc
311     %package -n %{kname}-doc
312     Version: %{kversion}
313     Release: %{rpmrel}
314     Summary: Various documentation bits found in the kernel source
315     Group: Books/Computer books
316     Buildarch: noarch
317    
318     %description -n %{kname}-doc
319     This package contains documentation files form the kernel source. Various
320     bits of information about the Linux kernel and the device drivers shipped
321     with it are documented in these files. You also might want install this
322     package if you need a reference to the options that can be passed to Linux
323     kernel modules at load time.
324    
325     %{rt_notice}
326     %endif #build_doc
327    
328    
329     #
330     # kernel-latest: virtual rpm
331     #
332     %if %build_kernel
333     %package -n %{kname}-latest
334     Version: %{kversion}
335     Release: %{rpmrel}
336     Summary: Virtual rpm for latest %{kname}
337     Group: System/Kernel and hardware
338     Requires: %{kname}-%{buildrel}
339     %ifarch %{ix86}
340     Conflicts: arch(x86_64)
341     %endif
342    
343     %description -n %{kname}-latest
344     This package is a virtual rpm that aims to make sure you always have the
345     latest %{kname} installed...
346    
347     %{rt_notice}
348     %endif #build_kernel
349    
350    
351     #
352     # kernel-source-latest: virtual rpm
353     #
354     %if %build_source
355     %package -n %{kname}-source-latest
356     Version: %{kversion}
357     Release: %{rpmrel}
358     Summary: Virtual rpm for latest %{kname}-source
359     Group: System/Kernel and hardware
360     Requires: %{kname}-source-%{buildrel}
361     Buildarch: noarch
362    
363     %description -n %{kname}-source-latest
364     This package is a virtual rpm that aims to make sure you always have the
365     latest %{kname}-source installed...
366    
367     %{rt_notice}
368     %endif #build_source
369    
370    
371     #
372     # kernel-devel-latest: virtual rpm
373     #
374     %if %build_devel
375     %package -n %{kname}-devel-latest
376     Version: %{kversion}
377     Release: %{rpmrel}
378     Summary: Virtual rpm for latest %{kname}-devel
379     Group: System/Kernel and hardware
380     Requires: %{kname}-devel-%{buildrel}
381     %ifarch %{ix86}
382     Conflicts: arch(x86_64)
383     %endif
384    
385     %description -n %{kname}-devel-latest
386     This package is a virtual rpm that aims to make sure you always have the
387     latest %{kname}-devel installed...
388    
389     %{rt_notice}
390     %endif #build_devel
391    
392    
393     #
394     # End packages - here begins build stage
395     #
396     %prep
397     %setup -q -n %top_dir_name -c
398    
399     pushd %src_dir
400     %if %kpatch
401     %patch1 -p1
402     %endif
403     %if %sublevel
404     %patch1 -p1
405     %endif
406     %if %kgit
407     %patch2 -p1
408     %endif
409    
410     # rt patches
411     %patch101 -p1
412    
413     popd
414    
415     # PATCH END
416    
417    
418     #
419     # Setup Begin
420     #
421    
422    
423     # Install defconfigs...
424     install %{SOURCE20} %{build_dir}/linux-%{tar_ver}/arch/x86/configs/
425     install %{SOURCE21} %{build_dir}/linux-%{tar_ver}/arch/x86/configs/
426     install %{SOURCE22} %{build_dir}/linux-%{tar_ver}/arch/arm/configs/
427    
428     # make sure the kernel has the sublevel we know it has...
429     LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" linux-%{tar_ver}/Makefile
430    
431 tmb 131493 # drop localversion before build or it will mess up uname -r (we have it in kernel name/version)
432     rm -f %{build_dir}/linux-%{tar_ver}/localversion-rt
433 tmb 128177
434     %build
435     # Common target directories
436     %define _bootdir /boot
437     %define _modulesdir /lib/modules
438     %define _kerneldir /usr/src/%{kname}-%{buildrel}
439     %define _develdir /usr/src/%{kname}-devel-%{buildrel}
440    
441    
442     # Directories definition needed for building
443     %define temp_root %{build_dir}/temp-root
444     %define temp_boot %{temp_root}%{_bootdir}
445     %define temp_modules %{temp_root}%{_modulesdir}
446     %define temp_source %{temp_root}%{_kerneldir}
447     %define temp_devel %{temp_root}%{_develdir}
448    
449    
450     # Create a simulacro of buildroot
451     rm -rf %{temp_root}
452     install -d %{temp_root}
453    
454    
455     # make sure we are in the directory
456     cd %{src_dir}
457    
458     # make sure EXTRAVERSION says what we want it to say
459 tmb 131493 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{buildrpmrel}/" Makefile
460 tmb 128177
461     # Prepare the kernel
462     %smake -s mrproper
463     %ifarch %{ix86} x86_64 %{arm}
464     cp arch/x86/configs/%{target_arch}_defconfig .config
465     %else
466     cp arch/%{target_arch}/defconfig .config
467     %endif
468     %smake oldconfig
469    
470     # Build the kernel
471 tmb 131994 %kmake -s all
472 tmb 128177 %ifarch %{arm}
473     %kmake uImage
474     %endif
475     # Install kernel
476     install -d %{temp_boot}
477     install -m 644 System.map %{temp_boot}/System.map-%{buildrel}
478     install -m 644 .config %{temp_boot}/config-%{buildrel}
479     %ifarch %{arm}
480     cp -f arch/%{target_arch}/boot/uImage %{temp_boot}/uImage-$KernelVer
481     %else
482     cp -f arch/%{target_arch}/boot/bzImage %{temp_boot}/vmlinuz-%{buildrel}
483     %endif
484    
485     # Install modules
486     install -d %{temp_modules}/%{buildrel}
487     %smake INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=%{buildrel} modules_install
488    
489     # remove /lib/firmware, we use a separate kernel-firmware
490     rm -rf %{temp_root}/lib/firmware
491    
492     # Save devel tree
493     %if %build_devel
494     mkdir -p %{temp_devel}
495     for i in $(find . -name 'Makefile*'); do cp -R --parents $i %{temp_devel};done
496     for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*' -o -name config.mk); do cp -R --parents $i %{temp_devel};done
497     cp -fR include %{temp_devel}
498     cp -fR scripts %{temp_devel}
499     %ifarch %{arm}
500     cp -fR arch/%{target_arch}/tools $TempDevelRoot/arch/%{target_arch}/
501     %endif
502     %ifarch %{ix86} x86_64
503     cp -fR arch/x86/kernel/asm-offsets.{c,s} %{temp_devel}/arch/x86/kernel/
504     cp -fR arch/x86/kernel/asm-offsets_{32,64}.c %{temp_devel}/arch/x86/kernel/
505     cp -fR arch/x86/include %{temp_devel}/arch/x86/
506     %else
507     cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} %{temp_devel}/arch/%{target_arch}/kernel/
508     for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f $TempDevelRoot; done
509     %endif
510    
511     # Needed for generation of kernel/bounds.s
512     cp -fR kernel/bounds.c %{temp_devel}/kernel/
513    
514     # Needed for lguest
515     cp -fR drivers/lguest/lg.h %{temp_devel}/drivers/lguest/
516    
517     cp -fR .config Module.symvers %{temp_devel}
518    
519     # Needed for truecrypt build (Danny)
520     cp -fR drivers/md/dm.h %{temp_devel}/drivers/md/
521    
522     # Needed for external dvb tree (#41418)
523     cp -fR drivers/media/dvb/dvb-core/*.h %{temp_devel}/drivers/media/dvb/dvb-core/
524     cp -fR drivers/media/dvb/frontends/lgdt330x.h %{temp_devel}/drivers/media/dvb/frontends/
525    
526     # add acpica header files, needed for fglrx build
527     cp -fR drivers/acpi/acpica/*.h %{temp_devel}/drivers/acpi/acpica/
528    
529     # Check and clean the -devel tree
530     pushd %{temp_devel} >/dev/null
531     %smake -s prepare scripts clean
532     rm -f .config.old
533     popd >/dev/null
534    
535     # Disable mrproper and other targets
536     patch -p1 -d %{temp_devel} -i %{SOURCE2}
537    
538     # Fix permissions
539     chmod -R a+rX %{temp_devel}
540     %endif # build_devel
541    
542     #make sure we are in the directory
543     cd %src_dir
544    
545     # kernel-source is shipped as an unprepared tree
546     %smake -s mrproper
547    
548    
549     ###
550     ### Install
551     ###
552     %install
553     install -m 644 %{SOURCE4} .
554    
555     cd %src_dir
556     # Directories definition needed for installing
557     %define target_source %{buildroot}/%{_kerneldir}
558     %define target_boot %{buildroot}%{_bootdir}
559     %define target_modules %{buildroot}%{_modulesdir}
560     %define target_devel %{buildroot}%{_develdir}
561    
562     # We want to be able to test several times the install part
563     rm -rf %{buildroot}
564     cp -a %{temp_root} %{buildroot}
565    
566     # Create directories infastructure
567     %if %build_source
568     install -d %{target_source}
569    
570     tar cf - . | tar xf - -C %{target_source}
571     chmod -R a+rX %{target_source}
572    
573     # we remove all the source files that we don't ship
574    
575     # first architecture files
576     for i in alpha avr32 blackfin cris frv h8300 ia64 m32r mips microblaze \
577     m68k m68knommu mn10300 parisc powerpc ppc s390 score sh sh64 sparc \
578     tile unicore32 v850 xtensa; do
579     rm -rf %{target_source}/arch/$i
580    
581     %if %build_devel
582     rm -rf %{target_devel}/arch/$i
583     %endif
584     done
585    
586     # remove arch files based on target arch in -devel rpms
587     %if %build_devel
588     %ifnarch %{ix86} x86_64
589     rm -rf %{target_devel}/arch/x86
590     %endif
591     %ifnarch %{arm}
592     rm -rf %{target_devel}/arch/arm
593     %endif
594     %endif
595    
596    
597     # other misc files
598 tmb 131493 rm -f %{target_source}/{.config.old,.config.cmd,.tmp_gas_check,.mailmap,.missing-syscalls.d,arch/.gitignore}
599 tmb 128177 rm -rf %{target_source}/.tmp_depmod/
600    
601     #endif %build_source
602     %endif
603    
604    
605     # gzipping modules
606     find %{target_modules} -name "*.ko" | %kxargs gzip -9
607    
608    
609     # We used to have a copy of PrepareKernel here
610     # Now, we make sure that the thing in the linux dir is what we want it to be
611    
612     for i in %{target_modules}/*; do
613     rm -f $i/build $i/source
614     done
615    
616    
617     # sniff, if we gzipped all the modules, we change the stamp :(
618     # we really need the depmod -ae here
619     pushd %{target_modules}
620     for i in *; do
621     /sbin/depmod -u -ae -b %{buildroot} -r -F %{target_boot}/System.map-$i $i
622     echo $?
623     done
624    
625     for i in *; do
626     pushd $i
627     echo "Creating module.description for $i"
628     modules=`find . -name "*.ko.gz"`
629     echo $modules | %kxargs /sbin/modinfo \
630     | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description
631     popd
632     done
633     popd
634    
635    
636     ###
637     ### Clean
638     ###
639    
640     %clean
641     rm -rf %{buildroot}
642     # We don't want to remove this, the whole reason of its existence is to be
643     # able to do several rpm --short-circuit -bi for testing install
644     # phase without repeating compilation phase
645     #rm -rf %{temp_root}
646    
647    
648     ###
649     ### Scripts
650     ###
651    
652     ### kernel
653     %if %build_kernel
654     %preun -n %{kname}-%{buildrel}
655     /sbin/installkernel -R %{buildrel}
656     if [ -L /lib/modules/%{buildrel}/build ]; then
657     rm -f /lib/modules/%{buildrel}/build
658     fi
659     if [ -L /lib/modules/%{buildrel}/source ]; then
660     rm -f /lib/modules/%{buildrel}/source
661     fi
662     pushd /boot > /dev/null
663     if [ -L vmlinuz-linus ]; then
664     if [ "$(readlink vmlinuz-linus)" = "vmlinuz-%{buildrel}" ]; then
665     rm -f vmlinuz-linus
666     fi
667     fi
668     if [ -L initrd-linus.img ]; then
669     if [ "$(readlink initrd-linus.img)" = "initrd-%{buildrel}.img" ]; then
670     rm -f initrd-linus.img
671     fi
672     fi
673     popd > /dev/null
674     exit 0
675    
676     %post -n %{kname}-%{buildrel}
677     /sbin/installkernel -L %{buildrel}
678     if [ -d /usr/src/%{kname}-devel-%{buildrel} ]; then
679     ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/build
680     ln -sf /usr/src/%{kname}-devel-%{buildrel} /lib/modules/%{buildrel}/source
681     fi
682     pushd /boot > /dev/null
683     if [ -L vmlinuz-linus ]; then
684     rm -f vmlinuz-linus
685     fi
686     ln -sf vmlinuz-%{buildrel} vmlinuz-linus
687     if [ -L initrd-linus.img ]; then
688     rm -f initrd-linus.img
689     fi
690     ln -sf initrd-%{buildrel}.img initrd-linus.img
691     popd > /dev/null
692    
693 tmb 187275 %posttrans -n %{kname}-%{buildrel}
694     if [ -x /usr/sbin/dkms_autoinstaller -a -d /usr/src/%{kname}-devel-%{buildrel} ]; then
695     /usr/sbin/dkms_autoinstaller start %{buildrel}
696     fi
697    
698 tmb 128177 %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