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