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