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