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