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