]> git.pld-linux.org Git - packages/kernel.git/blob - kernel.spec
S: keyutils (dns resolver and other in kernel will needs this)
[packages/kernel.git] / kernel.spec
1 #
2 # NOTE:
3 # the following bcond combos will not work
4 # - without_vserver and any of the following
5 #   - with_grsecurity
6 #
7 # LATEST VERSION CHECKER:
8 # # curl -s http://www.kernel.org/kdist/finger_banner
9 #
10 # TODO:
11 # - update aufs2 patch when final version for 2.6.36 exists
12 #
13 # - benchmark NO_HZ & HZ=1000 vs HZ=300 on i686
14 #
15 # HOWTO update configuration files:
16 # - run build
17 # - add new options to proper config (kernel-multiarch.config, kernel-x86.config, kernel-powerpc.config etc)
18 # - sort configuration files using:
19 #   ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version}/ -a x86 kernel-x86.config
20 #   ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version} kernel-multiarch.config
21 #
22 # Conditional build:
23 %bcond_without  source          # don't build kernel-source package
24 %bcond_without  doc                     # don't build kernel-doc package
25 %bcond_without  pcmcia          # don't build pcmcia
26
27 %bcond_with     verbose         # verbose build (V=1)
28 %bcond_without  reiser4         # support for reiser4 fs (experimental)
29
30 %bcond_without  grsecurity      # don't build grsecurity nor pax at all
31 %bcond_with     pax             # build pax and grsecurity (ie. grsecurity && pax)
32
33 %bcond_with     fbcondecor      # build fbcondecor (disable FB_TILEBLITTING and affected fb modules)
34 %bcond_with     pae             # build PAE (HIGHMEM64G) support on uniprocessor
35 %bcond_with     nfsroot         # build with root on NFS support
36
37 %bcond_without  imq             # imq support
38 %bcond_without  wrr             # wrr support
39 %bcond_without  esfq            # esfq support
40 %bcond_without  ipv6            # ipv6 support
41
42 %bcond_without  vserver         # support for VServer (enabled by default)
43 %bcond_without  tuxonice        # support for tuxonice (ex-suspend2) (enabled by default)
44
45 %bcond_with     rescuecd        # build kernel for our rescue
46
47 %bcond_with     myown           # build with your own config (kernel-myown.config)
48
49 %{?debug:%define with_verbose 1}
50
51 %if %{without grsecurity}
52 %unglobal       with_pax
53 %endif
54
55 %if %{with pax}
56 %define         with_grsecurity         1
57 %define         with_pax                1
58 %endif
59
60 %define         have_drm        1
61 %define         have_oss        1
62 %define         have_sound      1
63 %define         have_pcmcia     1
64
65 %if %{with rescuecd}
66 %unglobal       with_tuxonice
67 %unglobal       with_grsecurity
68 %unglobal       with_pax
69 %unglobal       with_vserver
70 %define         have_drm        0
71 %define         have_sound      0
72 %endif
73
74 %if %{with myown}
75 %define         have_drm        0
76 %define         have_oss        0
77 %define         have_sound      0
78 %define         have_pcmcia     0
79 %endif
80
81 %ifarch sparc sparc64
82 %unglobal       with_pcmcia
83 %define         have_drm        0
84 %define         have_oss        0
85 %endif
86
87 %if %{without pcmcia}
88 %define         have_pcmcia     0
89 %endif
90
91 %define         basever         2.6.36
92 %define         postver         %{nil}
93 %define         rel             0.1
94
95 %define         _enable_debug_packages                  0
96
97 %define         tuxonice_version        3.2
98 %define         netfilter_snap          20070806
99
100 %if %{with myown}
101 %if "%{_alt_kernel}" == ""
102 %define         alt_kernel      myown
103 %endif
104 %else
105 %if %{without rescuecd}
106 %define         __alt_kernel    %{?with_pax:pax}%{!?with_grsecurity:nogrsecurity}%{?with_pae:pae}
107 %if "%{__alt_kernel}" != ""
108 %define         alt_kernel      %{__alt_kernel}
109 %endif
110 %else
111 %define         alt_kernel      rescuecd
112 %endif
113 %endif
114
115 # kernel release (used in filesystem and eventually in uname -r)
116 # modules will be looked from /lib/modules/%{kernel_release}
117 # localversion is just that without version for "> localversion"
118 %define         localversion    %{rel}
119 %define         kernel_release  %{version}%{?alt_kernel:_%{alt_kernel}}-%{localversion}
120
121 Summary:        The Linux kernel (the core of the Linux operating system)
122 Summary(de.UTF-8):      Der Linux-Kernel (Kern des Linux-Betriebssystems)
123 Summary(et.UTF-8):      Linuxi kernel (ehk operatsioonisüsteemi tuum)
124 Summary(fr.UTF-8):      Le Kernel-Linux (La partie centrale du systeme)
125 Summary(pl.UTF-8):      JÄ…dro Linuksa
126 Name:           kernel%{_alt_kernel}
127 Version:        %{basever}%{postver}
128 Release:        %{rel}
129 Epoch:          3
130 License:        GPL v2
131 Group:          Base/Kernel
132 Source0:        http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{basever}.tar.bz2
133 # Source0-md5:  61f3739a73afb6914cb007f37fb09b62
134 %if "%{postver}" != "%{nil}"
135 Source1:        http://www.kernel.org/pub/linux/kernel/v2.6/patch-%{version}.bz2
136 # Source1-md5:  7115d47e87afef1b9a14dbc9c387cd20
137 %endif
138
139 Source3:        kernel-autoconf.h
140 Source4:        kernel-config.h
141 Source6:        kernel-config.awk
142 Source7:        kernel-module-build.pl
143 Source8:        kernel-track-config-change.awk
144 # not used by kernel.spec, but it's good to have it in SOURCES
145 Source9:        kernel-config-sort.pl
146 Source10:       kernel.make
147
148 Source20:       kernel-multiarch.config
149 Source21:       kernel-x86.config
150 Source22:       kernel-sparc.config
151 Source23:       kernel-alpha.config
152 Source24:       kernel-powerpc.config
153 Source25:       kernel-ia64.config
154
155 Source40:       kernel-netfilter.config
156 Source41:       kernel-patches.config
157 Source42:       kernel-tuxonice.config
158 Source43:       kernel-vserver.config
159 Source45:       kernel-grsec.config
160
161 Source49:       kernel-pax.config
162 Source50:       kernel-no-pax.config
163 Source55:       kernel-imq.config
164 Source56:       kernel-reiser4.config
165 Source57:       kernel-wrr.config
166
167 Source58:       kernel-inittmpfs.config
168 Source59:       kernel-bzip2-lzma.config
169
170 # http://dev.gentoo.org/~spock/projects/fbcondecor/archive/fbcondecor-0.9.4-2.6.25-rc6.patch
171 Patch3:         kernel-fbcondecor.patch
172 Patch4:         kernel-fbcon-margins.patch
173
174 # netfilter related stuff mostly based on patch-o-matic-ng
175 # snapshot 20070806 with some fixes. Some modules
176 # were ported to nf_conntrack.
177
178 Patch10:        kernel-pom-ng-IPV4OPTSSTRIP.patch
179 Patch11:        kernel-pom-ng-ipv4options.patch
180
181 Patch16:        kernel-pom-ng-mms-conntrack-nat.patch
182 Patch22:        kernel-pom-ng-rsh.patch
183 Patch23:        kernel-pom-ng-rpc.patch
184
185 # based on http://mike.it-loops.com/rtsp/rtsp-2.6.26.patch
186 Patch36:        kernel-nf_rtsp.patch
187
188 # http://ftp.linux-vserver.org/pub/people/dhozac/p/k/delta-owner-xid-feat02.diff
189 Patch37:        kernel-owner-xid.patch
190
191 # based on kernel-2.6.25-layer7-2.20.patch from
192 # http://switch.dl.sourceforge.net/sourceforge/l7-filter/netfilter-layer7-v2.20.tar.gz
193 Patch40:        kernel-layer7.patch
194
195 # http://www.ssi.bg/~ja/nfct/ipvs-nfct-2.6.34-1.diff
196 Patch41:        kernel-ipvs-nfct.patch
197
198 ### End netfilter
199
200 # http://zph.bratcheda.org/linux-2.6.26.3-zph.patch
201 Patch49:        kernel-zph.patch
202
203 # based on http://www.linuximq.net/patchs/linux-2.6.35-imq-multiqueue-test1.diff
204 Patch50:        kernel-imq.patch
205
206 # http://www.kernel.org/pub/linux/kernel/people/edward/reiser4/reiser4-for-2.6/reiser4-for-2.6.35.patch.bz2
207 Patch51:        kernel-reiser4.patch
208
209 # http://www.zz9.dk/patches/wrr-linux-071203-2.6.25.patch.gz
210 Patch52:        kernel-wrr.patch
211
212 # http://fatooh.org/esfq-2.6/sfq-2.6.24.1.tar.bz2
213 Patch53:        kernel-esfq.patch
214
215 # http://memebeam.org/free-software/toshiba_acpi/toshiba_acpi-dev_toshiba_test5-linux_2.6.26.patch
216 Patch54:        kernel-toshiba_acpi.patch
217
218 # by Baggins request:
219 # derived from ftp://ftp.cmf.nrl.navy.mil/pub/chas/linux-atm/vbr/vbr-kernel-diffs
220 Patch55:        kernel-atm-vbr.patch
221 Patch56:        kernel-atmdd.patch
222
223 # https://trac.pentoo.ch/pentoo/export/1600/kernel/trunk/2.6/2.6.34/4305_sqlzma.patch
224 Patch57:        kernel-squashfs-lzma.patch
225
226 # http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch
227 Patch59:        kernel-rndis_host-wm5.patch
228
229 # Project suspend2 renamed to tuxonice
230 # http://tuxonice.net/files/tuxonice-3.2-rc2-for-2.6.36.patch.bz2
231 Patch69:        kernel-tuxonice.patch
232 Patch70:        kernel-tuxonice-headers.patch
233
234 # adds some ids for hostap suported cards and monitor_enable from/for aircrack-ng
235 # http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch
236 Patch85:        kernel-hostap.patch
237
238 # http://vserver.13thfloor.at/Experimental/patch-2.6.36-vs2.3.0.36.36.diff
239 Patch100:       kernel-vserver-2.3.patch
240 Patch101:       kernel-vserver-fixes.patch
241
242 # Wake-On-Lan fix for nForce drivers; using http://atlas.et.tudelft.nl/verwei90/nforce2/wol.html
243 # Fix verified for that kernel version.
244 Patch130:       kernel-forcedeth-WON.patch
245
246 # add tty ioctl to figure physical device of the console. used by showconsole.spec (blogd)
247 # raw from http://download.opensuse.org/update/11.2/rpm/src/kernel-source-2.6.31.12-0.2.1.src.rpm
248 # from patches.fixes.tar.bz2
249 # from patches.fixes/tiocgdev
250 Patch131:       kernel-TIOCGDEV.patch
251
252 # http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.4_for_2.6.34-rc0.diff.gz
253 # based on mandriva kernel src.rpm patches
254 Patch140:       kernel-unionfs.patch
255
256 # http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git, read README
257 # Patch creation:
258 # git clone http://git.c3sl.ufpr.br/pub/scm/aufs/aufs2-standalone.git
259 # cd aufs2-standalone
260 # git checkout -b aufs2.1-35 origin/aufs2.1-35
261 # cat aufs2-kbuild.patch aufs2-base.patch aufs2-standalone.patch > ~/rpm/packages/kernel/kernel-aufs2.patch
262 # mkdir linux
263 # cp -a Documentation fs include linux
264 # diff -urN /usr/share/empty linux >> ~/rpm/packages/kernel/kernel-aufs2.patch 
265
266 Patch145:       kernel-aufs2.patch
267 Patch146:       kernel-aufs2-unionfs.patch
268 Patch147:       kernel-aufs2-no-const-grsec.patch
269 Patch148:       kernel-aufs2-reiser4.patch
270
271 # Show normal colors in menuconfig with ncurses ABI 6
272 Patch250:       kernel-fix_256colors_menuconfig.patch
273
274 # The following patch extend the routing functionality in Linux
275 # to support static routes (defined by user), new way to use the
276 # alternative routes, the reverse path protection (rp_filter),
277 # the NAT processing to use correctly the routing when multiple
278 # gateways are used.
279 # http://www.ssi.bg/~ja/routes-2.6.36-16.diff
280 Patch300:       kernel-routes.patch
281
282 Patch2000:      kernel-small_fixes.patch
283 Patch2001:      kernel-pwc-uncompress.patch
284 Patch2003:      kernel-regressions.patch
285
286 # kill some thousands of warnings
287 # (only warnings, so just remove parts of this patch if conflics)
288 Patch2500:      kernel-warnings.patch
289
290 # 0001-AppArmor-compatibility-patch-for-v5-network-controll.patch
291 # 0002-AppArmor-compatibility-patch-for-v5-interface.patch
292 # from http://kernel.org/pub/linux/security/apparmor/apparmor-2.6.36-patches.tgz
293 Patch5000:      kernel-apparmor.patch
294
295 # for rescuecd
296 # based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
297 Patch7000:      kernel-inittmpfs.patch
298
299 # based on http://www.grsecurity.net/~spender/grsecurity-2.2.0-2.6.35.7-201010191911.patch
300 # NOTE: put raw upstream patches on kernel-grsec_full.patch:GRSECURITY_RAW for reference
301 #       (since upstream deletes older patches)
302 Patch9999:      kernel-grsec_full.patch
303 Patch10000:     kernel-grsec-caps.patch
304 Patch10001:     kernel-grsec-common.patch
305 Patch10002:     kernel-grsec_fixes.patch
306
307 URL:            http://www.kernel.org/
308 BuildRequires:  binutils >= 3:2.18
309 %ifarch sparc sparc64
310 BuildRequires:  elftoaout
311 %endif
312 %ifarch ppc
313 BuildRequires:  uboot-mkimage
314 %endif
315 BuildRequires:  /sbin/depmod
316 BuildRequires:  gcc >= 5:3.2
317 BuildRequires:  xz >= 1:4.999.7
318 AutoReqProv:    no
319 # for hostname command
320 BuildRequires:  module-init-tools >= 3.5
321 BuildRequires:  net-tools
322 BuildRequires:  perl-base
323 BuildRequires:  rpm-build >= 4.5-24
324 BuildRequires:  rpmbuild(macros) >= 1.217
325 Requires(post): coreutils
326 Requires(post): geninitrd >= 10000-3
327 Requires(post): module-init-tools >= 0.9.9
328 Requires:       /sbin/depmod
329 Requires:       coreutils
330 Requires:       geninitrd >= 10000-3
331 Requires:       module-init-tools >= 0.9.9
332 Suggests:       keyutils
333 Provides:       %{name}(netfilter) = %{netfilter_snap}
334 Provides:       %{name}(vermagic) = %{kernel_release}
335 Obsoletes:      kernel%{_alt_kernel}-isdn-mISDN
336 Obsoletes:      kernel-firmware
337 Obsoletes:      kernel-misc-acer_acpi
338 Obsoletes:      kernel-misc-fuse
339 Obsoletes:      kernel-misc-uvc
340 Obsoletes:      kernel-modules
341 Obsoletes:      kernel-net-ar81
342 Obsoletes:      kernel-net-hostap
343 Obsoletes:      kernel-net-ieee80211
344 Obsoletes:      kernel-net-ipp2p
345 Obsoletes:      kernel-net-rt61
346 Obsoletes:      kernel-smp
347 Conflicts:      e2fsprogs < 1.29
348 Conflicts:      isdn4k-utils < 3.1pre1
349 Conflicts:      jfsutils < 1.1.3
350 Conflicts:      lvm2 < 2.02.40
351 Conflicts:      module-init-tools < 0.9.10
352 Conflicts:      nfs-utils < 1.0.5
353 Conflicts:      oprofile < 0.9
354 Conflicts:      ppp < 1:2.4.0
355 Conflicts:      procps < 3.2.0
356 Conflicts:      quota-tools < 3.09
357 %{?with_reiserfs4:Conflicts:    reiser4progs < 1.0.0}
358 Conflicts:      reiserfsprogs < 3.6.3
359 Conflicts:      rpm < 4.4.2-0.2
360 Conflicts:      udev < 1:081
361 Conflicts:      util-linux < 2.10o
362 Conflicts:      util-vserver < 0.30.216
363 Conflicts:      xfsprogs < 2.6.0
364 %if %{with pae}
365 ExcludeArch:    i386 i486 i586
366 %else
367 ExclusiveArch:  %{ix86} %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64
368 %endif
369 ExclusiveOS:    Linux
370 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
371
372 %ifarch %{ix86} %{x8664}
373 %define         target_arch_dir         x86
374 %endif
375 %ifarch ppc ppc64
376 %define         target_arch_dir         powerpc
377 %endif
378 %ifarch sparc sparc64
379 %define         target_arch_dir         sparc
380 %endif
381 %ifnarch %{ix86} %{x8664} ppc ppc64 sparc sparc64
382 %define         target_arch_dir         %{_target_base_arch}
383 %endif
384
385 %define         defconfig       arch/%{target_arch_dir}/defconfig
386
387 # No ELF objects there to strip (skips processing 27k files)
388 %define         _noautostrip    \\(.*%{_kernelsrcdir}/.*\\|.*/vmlinux.*\\)
389 %define         _noautochrpath  .*%{_kernelsrcdir}/.*
390
391 %ifarch ia64
392 %define         initrd_dir      /boot/efi
393 %else
394 %define         initrd_dir      /boot
395 %endif
396
397 %define         topdir          %{_builddir}/%{name}-%{version}
398 %define         srcdir          %{topdir}/linux-%{basever}
399 %define         objdir          %{topdir}/%{targetobj}
400 %define         targetobj       %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion)
401
402 %define         _kernelsrcdir   /usr/src/linux%{_alt_kernel}-%{version}
403
404 %if "%{_target_base_arch}" != "%{_arch}"
405         %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-
406         %define DepMod /bin/true
407
408         %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64"
409         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
410         %define DepMod /sbin/depmod
411         %endif
412
413         %if "%{_arch}" == "sparc64" && "%{_target_base_arch}" == "sparc"
414         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
415         %define DepMod /sbin/depmod
416         %endif
417
418         %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
419         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
420         %define DepMod /sbin/depmod
421         %endif
422
423         %if "%{_target_base_arch}" == "ppc" || "%{_target_base_arch}" == "ppc64"
424         %define CrossOpts ARCH=powerpc CROSS_COMPILE=%{_target_cpu}-pld-linux-
425         %endif
426 %else
427         %ifarch ppc ppc64
428         %define CrossOpts ARCH=powerpc CC="%{__cc}"
429         %else
430         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
431         %endif
432         %define DepMod /sbin/depmod
433 %endif
434 %define MakeOpts %{CrossOpts} HOSTCC="%{__cc}"
435
436 %define __features Netfilter module dated: %{netfilter_snap}\
437 %{?with_grsecurity:Grsecurity support - enabled}\
438 %{?with_pax:PaX support - enabled}\
439 %{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\
440 %{?with_nfsroot:Root on NFS - enabled}\
441
442 %define Features %(echo "%{__features}" | sed '/^$/d')
443
444 %description
445 This package contains the Linux kernel that is used to boot and run
446 your system. It contains few device drivers for specific hardware.
447 Most hardware is instead supported by modules loaded after booting.
448
449 %{Features}
450
451 %description -l de.UTF-8
452 Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des
453 Linux-Betriebssystems. Der Kernel ist für grundliegende
454 Systemfunktionen verantwortlich: Speicherreservierung,
455 Prozeß-Management, Geräte Ein- und Ausgaben, usw.
456
457 %{Features}
458
459 %description -l fr.UTF-8
460 Le package kernel contient le kernel linux (vmlinuz), la partie
461 centrale d'un système d'exploitation Linux. Le noyau traite les
462 fonctions basiques d'un système d'exploitation: allocation mémoire,
463 allocation de process, entrée/sortie de peripheriques, etc.
464
465 %{Features}
466
467 %description -l pl.UTF-8
468 Pakiet zawiera jÄ…dro Linuksa niezbÄ™dne do prawidÅ‚owego dziaÅ‚ania
469 Twojego komputera. Zawiera w sobie sterowniki do sprzÄ™tu znajdujÄ…cego
470 siÄ™ w komputerze, takiego jak sterowniki dysków itp.
471
472 %{Features}
473
474 %package vmlinux
475 Summary:        vmlinux - uncompressed kernel image
476 Summary(de.UTF-8):      vmlinux - dekompressiertes Kernel Bild
477 Summary(pl.UTF-8):      vmlinux - rozpakowany obraz jÄ…dra
478 Group:          Base/Kernel
479 Obsoletes:      kernel-smp-vmlinux
480
481 %description vmlinux
482 vmlinux - uncompressed kernel image.
483
484 %description vmlinux -l de.UTF-8
485 vmlinux - dekompressiertes Kernel Bild.
486
487 %description vmlinux -l pl.UTF-8
488 vmlinux - rozpakowany obraz jÄ…dra.
489
490 %package drm
491 Summary:        DRM kernel modules
492 Summary(de.UTF-8):      DRM Kernel Treiber
493 Summary(pl.UTF-8):      Sterowniki DRM
494 Group:          Base/Kernel
495 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
496 Requires:       %{name} = %{epoch}:%{version}-%{release}
497 Obsoletes:      kernel-smp-drm
498 AutoReqProv:    no
499
500 %description drm
501 DRM kernel modules.
502
503 %description drm -l de.UTF-8
504 DRM Kernel Treiber.
505
506 %description drm -l pl.UTF-8
507 Sterowniki DRM.
508
509 %package pcmcia
510 Summary:        PCMCIA modules
511 Summary(de.UTF-8):      PCMCIA Module
512 Summary(pl.UTF-8):      ModuÅ‚y PCMCIA
513 Group:          Base/Kernel
514 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
515 Requires:       %{name} = %{epoch}:%{version}-%{release}
516 Obsoletes:      kernel-smp-pcmcia
517 Conflicts:      pcmcia-cs < 3.1.21
518 Conflicts:      pcmciautils < 004
519 AutoReqProv:    no
520
521 %description pcmcia
522 PCMCIA modules.
523
524 %description pcmcia -l de.UTF-8
525 PCMCIA Module.
526
527 %description pcmcia -l pl.UTF-8
528 ModuÅ‚y PCMCIA.
529
530 %package sound-alsa
531 Summary:        ALSA kernel modules
532 Summary(de.UTF-8):      ALSA Kernel Module
533 Summary(pl.UTF-8):      Sterowniki dźwiÄ™ku ALSA
534 Group:          Base/Kernel
535 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
536 Requires:       %{name} = %{epoch}:%{version}-%{release}
537 Obsoletes:      kernel-smp-sound-alsa
538 AutoReqProv:    no
539
540 %description sound-alsa
541 ALSA (Advanced Linux Sound Architecture) sound drivers.
542
543 %description sound-alsa -l de.UTF-8
544 ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
545
546 %description sound-alsa -l pl.UTF-8
547 Sterowniki dźwiÄ™ku ALSA (Advanced Linux Sound Architecture).
548
549 %package sound-oss
550 Summary:        OSS kernel modules
551 Summary(de.UTF-8):      OSS Kernel Module
552 Summary(pl.UTF-8):      Sterowniki dźwiÄ™ku OSS
553 Group:          Base/Kernel
554 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
555 Requires:       %{name} = %{epoch}:%{version}-%{release}
556 Obsoletes:      kernel-smp-sound-oss
557 AutoReqProv:    no
558
559 %description sound-oss
560 OSS (Open Sound System) drivers.
561
562 %description sound-oss -l de.UTF-8
563 OSS (Open Sound System) Treiber.
564
565 %description sound-oss -l pl.UTF-8
566 Sterowniki dźwiÄ™ku OSS (Open Sound System).
567
568 %package headers
569 Summary:        Header files for the Linux kernel
570 Summary(de.UTF-8):      Header Dateien für den Linux-Kernel
571 Summary(pl.UTF-8):      Pliki nagłówkowe jÄ…dra Linuksa
572 Group:          Development/Building
573 Provides:       %{name}-headers(netfilter) = %{netfilter_snap}
574 AutoReqProv:    no
575
576 %description headers
577 These are the C header files for the Linux kernel, which define
578 structures and constants that are needed when rebuilding the kernel or
579 building kernel modules.
580
581 %description headers -l de.UTF-8
582 Dies sind die C Header Dateien für den Linux-Kernel, die definierte
583 Strukturen und Konstante beinhalten, die beim rekompilieren des
584 Kernels oder bei Kernel Modul kompilationen gebraucht werden.
585
586 %description headers -l pl.UTF-8
587 Pakiet zawiera pliki nagłówkowe jÄ…dra, niezbÄ™dne do rekompilacji jÄ…dra
588 oraz budowania modułów jÄ…dra.
589
590 %package module-build
591 Summary:        Development files for building kernel modules
592 Summary(de.UTF-8):      Development Dateien die beim Kernel Modul kompilationen gebraucht werden
593 Summary(pl.UTF-8):      Pliki sÅ‚użące do budowania modułów jÄ…dra
594 Group:          Development/Building
595 Requires:       %{name}-headers = %{epoch}:%{version}-%{release}
596 Conflicts:      rpmbuild(macros) < 1.550
597 AutoReqProv:    no
598
599 %description module-build
600 Development files from kernel source tree needed to build Linux kernel
601 modules from external packages.
602
603 %description module-build -l de.UTF-8
604 Development Dateien des Linux-Kernels die beim kompilieren externer
605 Kernel Module gebraucht werden.
606
607 %description module-build -l pl.UTF-8
608 Pliki ze drzewa ÅºródeÅ‚ jÄ…dra potrzebne do budowania modułów jÄ…dra
609 Linuksa z zewnÄ™trznych pakietów.
610
611 %package source
612 Summary:        Kernel source tree
613 Summary(de.UTF-8):      Der Kernel Quelltext
614 Summary(pl.UTF-8):      Kod ÅºródÅ‚owy jÄ…dra Linuksa
615 Group:          Development/Building
616 Requires:       %{name}-module-build = %{epoch}:%{version}-%{release}
617 AutoReqProv:    no
618
619 %description source
620 This is the source code for the Linux kernel. You can build a custom
621 kernel that is better tuned to your particular hardware.
622
623 %description source -l de.UTF-8
624 Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des
625 Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
626 C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die
627 im Kernel-Source definiert sind. Die Source-Dateien können auch
628 benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre
629 Hardware ausgerichtet ist.
630
631 %description source -l fr.UTF-8
632 Le package pour le kernel-source contient le code source pour le noyau
633 linux. Ces sources sont nécessaires pour compiler la plupart des
634 programmes C, car il dépend de constantes définies dans le code
635 source. Les sources peuvent Ãªtre aussi utilisée pour compiler un noyau
636 personnalisé pour avoir de meilleures performances sur des matériels
637 particuliers.
638
639 %description source -l pl.UTF-8
640 Pakiet zawiera kod ÅºródÅ‚owy jÄ…dra systemu.
641
642 %package doc
643 Summary:        Kernel documentation
644 Summary(de.UTF-8):      Kernel Dokumentation
645 Summary(pl.UTF-8):      Dokumentacja do jÄ…dra Linuksa
646 Group:          Documentation
647 AutoReqProv:    no
648
649 %description doc
650 This is the documentation for the Linux kernel, as found in
651 /usr/src/linux/Documentation directory.
652
653 %description doc -l de.UTF-8
654 Dies ist die Kernel Dokumentation wie sie im 'Documentation'
655 Verzeichniss vorgefunden werden kann.
656
657 %description doc -l pl.UTF-8
658 Pakiet zawiera dokumentacjÄ™ do jÄ…dra Linuksa pochodzÄ…cÄ… z katalogu
659 /usr/src/linux/Documentation.
660
661 %prep
662 %setup -qc
663 ln -s %{SOURCE7} kernel-module-build.pl
664 ln -s %{SOURCE10} Makefile
665 cd linux-%{basever}
666
667 # hack against warning in pax/grsec
668 sed -i 's/-Werror//' arch/alpha/kernel/Makefile
669
670 %if "%{postver}" != "%{nil}"
671 %{__bzip2} -dc %{SOURCE1} | patch -p1 -s
672 %endif
673
674 # tuxonice:
675 %if %{with tuxonice}
676 %patch69 -p1
677 %patch70 -p1
678 %endif
679
680 %if %{with fbcondecor}
681 %patch3 -p1
682 %endif
683 %patch4 -p1
684
685 ## netfilter
686 #
687
688 # kernel-pom-ng-IPV4OPTSSTRIP.patch
689 %patch10 -p1
690
691 # kernel-pom-ng-ipv4options.patch
692 %patch11 -p1
693
694 # kernel-pom-ng-mms-conntrack-nat.patch
695 %patch16 -p1
696
697 # kernel-pom-ng-rsh.patch
698 %patch22 -p1
699
700 # kernel-pom-ng-rpc.patch
701 %patch23 -p1
702
703 # kernel-nf_rtsp.patch
704 %patch36 -p1
705
706 # kernel-owner-xid.patch
707 %if %{with vserver}
708 %patch37 -p1
709 %endif
710
711 # kernel-layer7.patch
712 %patch40 -p1
713
714 # ipvs-nfct
715 %patch41 -p1
716
717 ##
718 # end of netfilter
719
720 # zph
721 %patch49 -p1
722
723 %if %{with imq}
724 %patch50 -p1
725 %endif
726
727 # reiser4
728 %if %{with reiser4}
729 %patch51 -p1
730 %endif
731
732 # esfq
733 %if %{with esfq}
734 %patch53 -p1
735 %endif
736
737 %if %{with wrr}
738 %patch52 -p1
739 %endif
740
741 # toshiba_acpi
742 %patch54 -p1
743
744 %patch55 -p1
745 %patch56 -p1
746
747 # squashfs lzma support
748 %patch57 -p1
749
750 # kernel-rndis_host-wm5.patch
751 %patch59 -p1
752
753 # hostap enhancements from/for aircrack-ng
754 %patch85 -p1
755
756 # vserver
757 %if %{with vserver}
758 %patch100 -p1
759 %patch101 -p1
760 %endif
761
762 # forcedeth
763 %patch130 -p1
764
765 %patch131 -p1
766
767 # aufs2
768 %if %{with reiser4}
769 %patch148 -p1
770 %endif
771 %patch145 -p1
772 %patch146 -p1
773
774 # unionfs
775 %patch140 -p1
776
777 %patch2500 -p1
778
779 %if %{with rescuecd}
780 %patch7000 -p1
781 %endif
782
783 # grsecurity & pax stuff
784 #
785
786 %if %{with grsecurity}
787 %patch9999 -p1
788 # aufs2 needs to modify those pointers
789 %patch147 -p1
790 %{?with_vserver:%patch10000 -p1}
791 %{?with_vserver:%patch10001 -p1}
792 %{?with_vserver:%patch10002 -p1}
793 %endif
794 #
795 # end of grsecurity & pax stuff
796
797 # apparmor
798 %patch5000 -p1
799
800 %patch250 -p1
801
802 # routes
803 %patch300 -p1
804
805 # Small fixes:
806 %patch2000 -p1
807 %patch2001 -p1
808 #%patch2003 -p1
809
810 # Fix EXTRAVERSION in main Makefile
811 sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{postver}%{?alt_kernel:_%{alt_kernel}}#g' Makefile
812
813 # cleanup backups after patching
814 find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
815
816 %build
817 install -d %{objdir}
818 cat > %{targetobj}.mk <<'EOF'
819 # generated by %{name}.spec
820 KERNELSRC               := %{_builddir}/%{name}-%{version}/linux-%{basever}
821 KERNELOUTPUT    := %{objdir}
822
823 SRCARCH         := %{target_arch_dir}
824 ARCH            := %{_target_base_arch}
825 Q                       := %{!?with_verbose:@}
826 MAKE_OPTS       := %{MakeOpts}
827 DEFCONFIG   := %{defconfig}
828 EOF
829
830 PaXconfig() {
831         set -x
832         cat <<-EOCONFIG > $1
833         %ifarch %{ix86}
834                 CONFIG_PAX_SEGMEXEC=y
835                 # performance impact on CPUs without NX bit
836                 CONFIG_PAX_PAGEEXEC=n
837                 # Testing KERNEXEC
838
839                 CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=n
840                 CONFIG_PCI_BIOS=n
841                 CONFIG_EFI=n
842         %endif
843
844         %ifarch ppc64
845                 CONFIG_PAX_NOELFRELOCS=n
846         %endif
847         %ifarch ppc
848                 CONFIG_PAX_EMUTRAMP=y
849                 CONFIG_PAX_EMUSIGRT=y
850                 CONFIG_PAX_EMUPLT=y
851         %endif
852
853         %ifarch sparc sparc64 alpha
854                 CONFIG_PAX_EMUPLT=y
855         %endif
856
857         # Now we have to check MAC system integration. Grsecurity uses PAX_HAVE_ACL_FLAGS
858         # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably
859         # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used
860         # PAX_HOOK_ACL_FLAGS.
861
862         %if %{with grsecurity}
863                 # Hardening grsec options if with pax
864                 CONFIG_GRKERNSEC_PROC_MEMMAP=y
865                 # almost rational (see HIDESYM help)
866                 CONFIG_GRKERNSEC_HIDESYM=y
867
868                 # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config
869         %else
870                 CONFIG_PAX_HAVE_ACL_FLAGS=n
871                 CONFIG_PAX_HOOK_ACL_FLAGS=y
872         %endif
873 EOCONFIG
874
875         return 0
876 }
877
878 RescueConfig() {
879         set -x
880         cat <<-EOCONFIG > $1
881                 # CONFIG_SOUND is not set
882                 # CONFIG_AUDIT is not set
883                 # CONFIG_TR is not set
884                 # CONFIG_BT is not set
885                 # CONFIG_VIDEO_DEV is not set
886                 # CONFIG_DVB_CORE is not set
887                 # CONFIG_HAMRADIO is not set
888                 # CONFIG_ARCNET is not set
889                 # CONFIG_FB is not set
890                 # CONFIG_DRM is not set
891                 # CONFIG_WATCHDOG is not set
892                 # CONFIG_INPUT_JOYSTICK is not set
893                 # CONFIG_DEBUG_KERNEL is not set
894                 # CONFIG_ISDN is not set
895                 # CONFIG_AGP is not set
896                 # CONFIG_SECURITY is not set
897                 # CONFIG_PARIDE is not set
898                 # CONFIG_CPU_FREQ is not set
899                 # CONFIG_GAMEPORT is not set
900                 # CONFIG_KVM is not set
901                 # CONFIG_PHONE is not set
902                 # CONFIG_STRICT_DEVMEM is not set
903                 # CONFIG_IMA is not set
904                 CONFIG_AUFS=y
905                 CONFIG_AUFS_FS=y
906                 CONFIG_AUFS_BR_RAMFS=y
907                 CONFIG_AUFS_RDU=y
908                 CONFIG_BLK_DEV_LOOP=y
909                 CONFIG_ISO9660_FS=y
910                 CONFIG_NLS_UTF8=y
911 EOCONFIG
912
913         return 0
914 }
915
916 BuildConfig() {
917         %{?debug:set -x}
918         set -e
919
920         Config="kernel-%{target_arch_dir}.config"
921         echo >&2 "Building config file for %{_target_cpu} using $Config et al."
922
923         # prepare local and important options
924         cat <<-EOCONFIG > important.config
925                 LOCALVERSION="-%{localversion}"
926
927 %if 0%{?debug:1}
928                 CONFIG_DEBUG_SLAB=y
929                 CONFIG_DEBUG_SLAB_LEAK=y
930                 CONFIG_DEBUG_PREEMPT=y
931                 CONFIG_RT_DEADLOCK_DETECT=y
932 %endif
933
934 %if %{without ipv6}
935                 CONFIG_IPV6=n
936 %endif
937
938 %ifarch i686 athlon pentium3 pentium4
939   %if %{with pae}
940                 CONFIG_HIGHMEM4G=n
941                 CONFIG_HIGHMEM64G=y
942                 CONFIG_X86_PAE=y
943                 CONFIG_NUMA=n
944   %endif
945 %endif
946
947 %if %{without pcmcia}
948                 CONFIG_PCMCIA=n
949 %endif
950
951 %if %{with fbcondecor}
952                 CONFIG_FB_S3=n
953                 CONFIG_FB_VT8623=n
954                 CONFIG_FB_ARK=n
955                 CONFIG_FB_TILEBLITTING=n
956                 CONFIG_FB_CON_DECOR=y
957 %endif
958
959 %if %{with nfsroot}
960                 CONFIG_NFS_FS=y
961                 CONFIG_ROOT_NFS=y
962 %endif
963
964 # Temporary disabled RELOCATABLE. Needed only on x86??
965 %if %{with pax} || %{with grsecurity}
966                 CONFIG_RELOCATABLE=n
967 %endif
968 EOCONFIG
969
970 %if %{with rescuecd}
971         RescueConfig rescue.config
972 %endif
973 %if %{with pax}
974         PaXconfig pax.config
975 %endif
976
977         # prepare kernel-style config file from multiple config files
978         %{__awk} -v arch="all %{target_arch_dir} %{_target_base_arch} %{_target_cpu}" -f %{SOURCE6} \
979 %if %{with myown}
980                 $RPM_SOURCE_DIR/kernel-%{alt_kernel}.config \
981 %endif
982                 important.config \
983 %if %{with rescuecd}
984                 %{SOURCE58} \
985                 %{SOURCE59} \
986                 rescue.config \
987 %endif
988                 \
989 %if %{with pax}
990                 %{SOURCE45} \
991                 %{SOURCE49} \
992                 pax.config \
993 %else
994   %if %{with grsecurity}
995                 %{SOURCE45} \
996                 %{SOURCE50} \
997   %endif
998 %endif
999                 \
1000 %if %{with reiser4}
1001                 %{SOURCE56} \
1002 %endif
1003 %if %{with wrr}
1004                 %{SOURCE57} \
1005 %endif
1006 %if %{with imq}
1007                 %{SOURCE55} \
1008 %endif
1009 %if %{with vserver}
1010                 %{SOURCE43} \
1011 %endif
1012 %if %{with tuxonice}
1013 %ifarch %{ix86} %{x8664} ia64 ppc ppc64
1014                 %{SOURCE42} \
1015 %endif
1016 %endif
1017                 %{SOURCE40} %{?0:netfilter} \
1018                 %{SOURCE41} %{?0:patches} \
1019                 %{SOURCE20} \
1020                 $RPM_SOURCE_DIR/$Config
1021 }
1022
1023 cd %{objdir}
1024 install -d arch/%{target_arch_dir}
1025 BuildConfig > %{defconfig}
1026 ln -sf %{defconfig} .config
1027 cd -
1028
1029 %{__make} \
1030         TARGETOBJ=%{targetobj} \
1031         %{?with_verbose:V=1} \
1032         oldconfig
1033
1034 %{__awk} %{?debug:-v dieOnError=1} -v infile=%{objdir}/%{defconfig} -f %{SOURCE8} %{objdir}/.config
1035
1036 # build kernel
1037 %{__make} \
1038         TARGETOBJ=%{targetobj} \
1039         %{?with_verbose:V=1} \
1040         all
1041
1042 %install
1043 rm -rf $RPM_BUILD_ROOT
1044 %{__make} %{MakeOpts} -j1 %{!?with_verbose:-s} modules_install firmware_install \
1045         -C %{objdir} \
1046         %{?with_verbose:V=1} \
1047         DEPMOD=%{DepMod} \
1048         INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
1049         INSTALL_FW_PATH=$RPM_BUILD_ROOT/lib/firmware/%{kernel_release} \
1050         KERNELRELEASE=%{kernel_release}
1051
1052 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc
1053
1054 # create directories which may be missing, to simplyfy %files
1055 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/{arch,sound,mm}
1056
1057 # rpm obeys filelinkto checks for ghosted symlinks, convert to files
1058 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1059 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1060
1061 # no point embed content for %ghost files. empty them
1062 for a in \
1063         dep{,.bin} \
1064         alias{,.bin} \
1065         symbols{,.bin} \
1066         {pci,usb,ccw,isapnp,input,ieee1394,serio,of}map \
1067 ; do
1068         test -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
1069         > $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
1070 done
1071
1072 # /boot
1073 install -d $RPM_BUILD_ROOT/boot
1074 cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
1075 %ifarch %{ix86} %{x8664}
1076         cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1077         install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
1078 %endif
1079 %ifarch ppc ppc64
1080         install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1081         install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
1082 %endif
1083 %ifarch ia64
1084         %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
1085         cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/efi/vmlinuz-%{kernel_release}
1086         ln -sf efi/vmlinuz-%{kernel_release} $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1087 %endif
1088 %ifarch alpha sparc sparc64
1089         %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
1090         cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1091         install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1092         %ifarch sparc
1093                 elftoaout %{objdir}/arch/sparc/boot/image -o %{objdir}/vmlinux.aout
1094                 install -p %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
1095         %endif
1096         %ifarch sparc64
1097                 elftoaout %{objdir}/arch/sparc64/boot/image -o %{objdir}/vmlinux.aout
1098                 install -p %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
1099         %endif
1100 %endif
1101 %ifarch arm
1102         install -p %{objdir}/arch/arm/boot/zImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1103 %endif
1104
1105 # ghosted initrd
1106 touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz
1107
1108 %if "%{_target_base_arch}" != "%{_arch}"
1109 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
1110 %endif
1111
1112 # /etc/modrobe.d
1113 install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
1114
1115 # /usr/src/linux
1116 install -d $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated
1117 # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
1118 if cp -al %{srcdir}/COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
1119         l=l
1120         rm -f $RPM_BUILD_ROOT/COPYING
1121 fi
1122
1123 cp -a$l %{srcdir}/* $RPM_BUILD_ROOT%{_kernelsrcdir}
1124 cp -a %{objdir}/Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}/Module.symvers-dist
1125 cp -aL %{objdir}/.config $RPM_BUILD_ROOT%{_kernelsrcdir}/config-dist
1126 cp -a %{objdir}/include/generated/autoconf.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated/autoconf-dist.h
1127 cp -a %{objdir}/include/generated/utsrelease.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated
1128 cp -a %{objdir}/include/linux/version.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
1129 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/generated/autoconf.h
1130 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
1131
1132 # collect module-build files and directories
1133 # Usage: kernel-module-build.pl $rpmdir $fileoutdir
1134 fileoutdir=$(pwd)
1135 cd $RPM_BUILD_ROOT%{_kernelsrcdir}
1136 %{__perl} %{topdir}/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir
1137 cd -
1138
1139 # move to %{_docdir} so we wouldn't depend on any kernel package for dirs
1140 install -d $RPM_BUILD_ROOT%{_docdir}
1141 mv $RPM_BUILD_ROOT{%{_kernelsrcdir}/Documentation,%{_docdir}/%{name}-%{version}}
1142
1143 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff
1144 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile
1145 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile
1146 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile
1147
1148 %clean
1149 rm -rf $RPM_BUILD_ROOT
1150
1151 %preun
1152 if [ -x /sbin/new-kernel-pkg ]; then
1153         /sbin/new-kernel-pkg --remove %{kernel_release}
1154 fi
1155
1156 %post
1157 %ifarch ia64
1158 mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
1159 %{?alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1160 ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
1161 %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}}
1162 %endif
1163 mv -f /boot/vmlinuz{,.old} 2> /dev/null
1164 %{?alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1165 mv -f /boot/System.map{,.old} 2> /dev/null
1166 %{?alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null}
1167 ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
1168 %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}}
1169 ln -sf System.map-%{kernel_release} /boot/System.map
1170 %{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}}
1171
1172 %depmod %{kernel_release}
1173
1174 %posttrans
1175 # generate initrd after all dependant modules are installed
1176 /sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
1177 mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
1178 %{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null}
1179 ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
1180 %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
1181
1182 # update boot loaders when old package files are gone from filesystem
1183 if [ -x /sbin/update-grub -a -f /etc/sysconfig/grub ]; then
1184         if [ "$(. /etc/sysconfig/grub; echo ${UPDATE_GRUB:-no})" = "yes" ]; then
1185                 /sbin/update-grub >/dev/null
1186         fi
1187 fi
1188 if [ -x /sbin/new-kernel-pkg ]; then
1189         /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
1190 fi
1191 if [ -x /sbin/rc-boot ]; then
1192         /sbin/rc-boot 1>&2 || :
1193 fi
1194
1195 %post vmlinux
1196 mv -f /boot/vmlinux{,.old} 2> /dev/null
1197 %{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null}
1198 ln -sf vmlinux-%{kernel_release} /boot/vmlinux
1199 %{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
1200
1201 %post drm
1202 %depmod %{kernel_release}
1203
1204 %postun drm
1205 %depmod %{kernel_release}
1206
1207 %post pcmcia
1208 %depmod %{kernel_release}
1209
1210 %postun pcmcia
1211 %depmod %{kernel_release}
1212
1213 %post sound-alsa
1214 %depmod %{kernel_release}
1215
1216 %postun sound-alsa
1217 %depmod %{kernel_release}
1218
1219 %post sound-oss
1220 %depmod %{kernel_release}
1221
1222 %postun sound-oss
1223 %depmod %{kernel_release}
1224
1225 %post headers
1226 ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
1227
1228 %postun headers
1229 if [ "$1" = "0" ]; then
1230         if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
1231                 if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
1232                         rm -f %{_prefix}/src/linux%{_alt_kernel}
1233                 fi
1234         fi
1235 fi
1236
1237 %triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
1238 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
1239 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
1240
1241 %triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
1242 if [ "$1" = 0 ]; then
1243         rm -f /lib/modules/%{kernel_release}/{build,source}
1244 fi
1245
1246 %files
1247 %defattr(644,root,root,755)
1248 %ifarch sparc sparc64
1249 /boot/vmlinux.aout-%{kernel_release}
1250 %endif
1251 %ifarch ia64
1252 /boot/efi/vmlinuz-%{kernel_release}
1253 %endif
1254 /boot/vmlinuz-%{kernel_release}
1255 /boot/System.map-%{kernel_release}
1256 %ghost %{initrd_dir}/initrd-%{kernel_release}.gz
1257 /lib/firmware/%{kernel_release}
1258
1259 %dir /lib/modules/%{kernel_release}
1260 %dir /lib/modules/%{kernel_release}/kernel
1261 /lib/modules/%{kernel_release}/kernel/arch
1262 /lib/modules/%{kernel_release}/kernel/crypto
1263 /lib/modules/%{kernel_release}/kernel/drivers
1264 %if %{have_drm}
1265 %exclude /lib/modules/%{kernel_release}/kernel/drivers/gpu
1266 %endif
1267 /lib/modules/%{kernel_release}/kernel/fs
1268 /lib/modules/%{kernel_release}/kernel/kernel
1269 /lib/modules/%{kernel_release}/kernel/lib
1270 /lib/modules/%{kernel_release}/kernel/net
1271 /lib/modules/%{kernel_release}/kernel/mm
1272 %if %{have_sound}
1273 %dir /lib/modules/%{kernel_release}/kernel/sound
1274 /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1275 /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1276 %ifnarch sparc
1277 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1278 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1279 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1280 %endif
1281 %endif
1282 %dir /lib/modules/%{kernel_release}/misc
1283 %if %{have_pcmcia}
1284 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]*
1285 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko*
1286 %exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1287 %if %{without rescuecd}
1288 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1289 %exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1290 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1291 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1292 %exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1293 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1294 %endif
1295 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
1296 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1297 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1298 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1299 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1300 %exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1301 %exclude /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1302 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1303 %endif
1304 %if %{with myown}
1305 /lib/modules/%{kernel_release}/kernel/sound
1306 %endif
1307
1308 %dir %{_sysconfdir}/modprobe.d/%{kernel_release}
1309
1310 # provided by build
1311 /lib/modules/%{kernel_release}/modules.order
1312 /lib/modules/%{kernel_release}/modules.builtin
1313
1314 # rest modules.* are ghost (regenerated by post depmod -a invocation)
1315 %ghost /lib/modules/%{kernel_release}/modules.alias
1316 %ghost /lib/modules/%{kernel_release}/modules.alias.bin
1317 %ghost /lib/modules/%{kernel_release}/modules.ccwmap
1318 %ghost /lib/modules/%{kernel_release}/modules.dep
1319 %ghost /lib/modules/%{kernel_release}/modules.dep.bin
1320 %ghost /lib/modules/%{kernel_release}/modules.ieee1394map
1321 %ghost /lib/modules/%{kernel_release}/modules.inputmap
1322 %ghost /lib/modules/%{kernel_release}/modules.isapnpmap
1323 %ghost /lib/modules/%{kernel_release}/modules.ofmap
1324 %ghost /lib/modules/%{kernel_release}/modules.pcimap
1325 %ghost /lib/modules/%{kernel_release}/modules.seriomap
1326 %ghost /lib/modules/%{kernel_release}/modules.symbols
1327 %ghost /lib/modules/%{kernel_release}/modules.symbols.bin
1328 %ghost /lib/modules/%{kernel_release}/modules.usbmap
1329
1330 # symlinks pointing to kernelsrcdir
1331 %ghost /lib/modules/%{kernel_release}/build
1332 %ghost /lib/modules/%{kernel_release}/source
1333
1334 %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
1335 %files vmlinux
1336 %defattr(644,root,root,755)
1337 /boot/vmlinux-%{kernel_release}
1338 %endif
1339
1340 %if %{have_drm}
1341 %files drm
1342 %defattr(644,root,root,755)
1343 /lib/modules/%{kernel_release}/kernel/drivers/gpu
1344 %endif
1345
1346 %if %{have_pcmcia}
1347 %files pcmcia
1348 %defattr(644,root,root,755)
1349 /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko*
1350 /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1351 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko*
1352 %if %{without rescuecd}
1353 /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1354 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1355 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1356 /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1357 %endif
1358 /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1359 /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
1360 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1361 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1362 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1363 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1364 /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1365 /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1366 /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1367 %endif
1368
1369 %if %{have_sound}
1370 %files sound-alsa
1371 %defattr(644,root,root,755)
1372 /lib/modules/%{kernel_release}/kernel/sound
1373 %exclude %dir /lib/modules/%{kernel_release}/kernel/sound
1374 %exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1375 %exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1376 %if %{have_oss}
1377 %exclude /lib/modules/%{kernel_release}/kernel/sound/oss
1378 %endif
1379 %ifnarch sparc
1380 /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1381 /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1382 /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1383 /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1384 %endif
1385
1386 %if %{have_oss}
1387 %files sound-oss
1388 %defattr(644,root,root,755)
1389 /lib/modules/%{kernel_release}/kernel/sound/oss
1390 %endif
1391 %endif
1392
1393 %files headers -f files.headers_exclude_kbuild
1394 %defattr(644,root,root,755)
1395 %dir %{_kernelsrcdir}
1396 %{_kernelsrcdir}/include
1397 %dir %{_kernelsrcdir}/arch
1398 %dir %{_kernelsrcdir}/arch/[!K]*
1399 %{_kernelsrcdir}/arch/*/include
1400 %dir %{_kernelsrcdir}/security
1401 %dir %{_kernelsrcdir}/security/selinux
1402 %{_kernelsrcdir}/security/selinux/include
1403 %{_kernelsrcdir}/config-dist
1404 %{_kernelsrcdir}/Module.symvers-dist
1405
1406 %files module-build -f files.mb_include_modulebuild_and_dirs
1407 %defattr(644,root,root,755)
1408 %ifarch ppc ppc64
1409 %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
1410 %endif
1411 %exclude %dir %{_kernelsrcdir}/arch/m68knommu
1412 %exclude %dir %{_kernelsrcdir}/arch/um
1413 %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1414 %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1415 %{_kernelsrcdir}/drivers/lguest/lg.h
1416 %{_kernelsrcdir}/kernel/bounds.c
1417 %dir %{_kernelsrcdir}/scripts
1418 %{_kernelsrcdir}/scripts/Kbuild.include
1419 %{_kernelsrcdir}/scripts/Makefile*
1420 %{_kernelsrcdir}/scripts/basic
1421 %{_kernelsrcdir}/scripts/kconfig
1422 %{_kernelsrcdir}/scripts/mkcompile_h
1423 %{_kernelsrcdir}/scripts/mkmakefile
1424 %{_kernelsrcdir}/scripts/mod
1425 %{_kernelsrcdir}/scripts/module-common.lds
1426 %{_kernelsrcdir}/scripts/setlocalversion
1427 %{_kernelsrcdir}/scripts/*.c
1428 %{_kernelsrcdir}/scripts/*.sh
1429 %dir %{_kernelsrcdir}/scripts/selinux
1430 %{_kernelsrcdir}/scripts/selinux/Makefile
1431 %dir %{_kernelsrcdir}/scripts/selinux/genheaders
1432 %{_kernelsrcdir}/scripts/selinux/genheaders/Makefile
1433 %{_kernelsrcdir}/scripts/selinux/genheaders/*.c
1434 %dir %{_kernelsrcdir}/scripts/selinux/mdp
1435 %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
1436 %{_kernelsrcdir}/scripts/selinux/mdp/*.c
1437 %exclude %dir %{_kernelsrcdir}/security
1438 %exclude %dir %{_kernelsrcdir}/security/selinux
1439
1440 %if %{with doc}
1441 %files doc
1442 %defattr(644,root,root,755)
1443 %dir %{_docdir}/%{name}-%{version}
1444
1445 %{_docdir}/%{name}-%{version}/[!jkz]*
1446 %{_docdir}/%{name}-%{version}/[jkz]*.txt
1447 %{_docdir}/%{name}-%{version}/kbuild
1448 %{_docdir}/%{name}-%{version}/kdump
1449 %{_docdir}/%{name}-%{version}/kvm
1450 %lang(ja) %{_docdir}/%{name}-%{version}/ja_JP
1451 %lang(ko) %{_docdir}/%{name}-%{version}/ko_KR
1452 %lang(zh_CN) %{_docdir}/%{name}-%{version}/zh_CN
1453 %endif
1454
1455 %if %{with source}
1456 %files source -f files.source_exclude_modulebuild_and_dirs
1457 %defattr(644,root,root,755)
1458 %{_kernelsrcdir}/arch/*/[!Mik]*
1459 %{_kernelsrcdir}/arch/*/kernel/[!M]*
1460 %{_kernelsrcdir}/arch/ia64/install.sh
1461 %{_kernelsrcdir}/arch/m68k/ifpsp060/[!M]*
1462 %{_kernelsrcdir}/arch/m68k/ifpsp060/MISC
1463 %{_kernelsrcdir}/arch/m68k/install.sh
1464 %{_kernelsrcdir}/arch/parisc/install.sh
1465 %{_kernelsrcdir}/arch/x86/ia32/[!M]*
1466 %{_kernelsrcdir}/arch/ia64/kvm
1467 %{_kernelsrcdir}/arch/powerpc/kvm
1468 %ifarch ppc ppc64
1469 %exclude %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
1470 %endif
1471 %{_kernelsrcdir}/arch/s390/kvm
1472 %{_kernelsrcdir}/arch/x86/kvm
1473 %exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1474 %exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1475 %exclude %{_kernelsrcdir}/drivers/lguest/lg.h
1476 %{_kernelsrcdir}/block
1477 %{_kernelsrcdir}/crypto
1478 %{_kernelsrcdir}/drivers
1479 %{_kernelsrcdir}/firmware
1480 %{_kernelsrcdir}/fs
1481 %if %{with grsecurity} && %{without rescuecd}
1482 %{_kernelsrcdir}/grsecurity
1483 %endif
1484 %{_kernelsrcdir}/init
1485 %{_kernelsrcdir}/ipc
1486 %{_kernelsrcdir}/kernel
1487 %exclude %{_kernelsrcdir}/kernel/bounds.c
1488 %{_kernelsrcdir}/lib
1489 %{_kernelsrcdir}/mm
1490 %{_kernelsrcdir}/net
1491 %{_kernelsrcdir}/virt
1492 %{_kernelsrcdir}/samples
1493 %{_kernelsrcdir}/scripts/*
1494 %exclude %{_kernelsrcdir}/scripts/Kbuild.include
1495 %exclude %{_kernelsrcdir}/scripts/Makefile*
1496 %exclude %{_kernelsrcdir}/scripts/basic
1497 %exclude %{_kernelsrcdir}/scripts/kconfig
1498 %exclude %{_kernelsrcdir}/scripts/mkcompile_h
1499 %exclude %{_kernelsrcdir}/scripts/mkmakefile
1500 %exclude %{_kernelsrcdir}/scripts/mod
1501 %exclude %{_kernelsrcdir}/scripts/module-common.lds
1502 %exclude %{_kernelsrcdir}/scripts/setlocalversion
1503 %exclude %{_kernelsrcdir}/scripts/*.c
1504 %exclude %{_kernelsrcdir}/scripts/*.sh
1505 %exclude %dir %{_kernelsrcdir}/scripts/selinux
1506 %exclude %{_kernelsrcdir}/scripts/selinux/Makefile
1507 %exclude %dir %{_kernelsrcdir}/scripts/selinux/genheaders
1508 %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/Makefile
1509 %exclude %{_kernelsrcdir}/scripts/selinux/genheaders/*.c
1510 %exclude %dir %{_kernelsrcdir}/scripts/selinux/mdp
1511 %exclude %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
1512 %exclude %{_kernelsrcdir}/scripts/selinux/mdp/*.c
1513 %{_kernelsrcdir}/sound
1514 %{_kernelsrcdir}/security
1515 %exclude %{_kernelsrcdir}/security/selinux/include
1516 %{_kernelsrcdir}/tools
1517 %{_kernelsrcdir}/usr
1518 %{_kernelsrcdir}/COPYING
1519 %{_kernelsrcdir}/CREDITS
1520 %{_kernelsrcdir}/MAINTAINERS
1521 %{_kernelsrcdir}/README
1522 %{_kernelsrcdir}/REPORTING-BUGS
1523 %endif
This page took 0.126751 seconds and 3 git commands to generate.