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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30