]> git.pld-linux.org Git - packages/kernel.git/blob - kernel.spec
- rel 0.2; addr selection fixes
[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.30
115 %define         postver         .5
116 %define         rel             0.2
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:  7a80058a6382e5108cdb5554d1609615
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.30.patch-20090620-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.30.2-vs2.3.0.36.14-pre4.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 # kill some thousands of warnings
315 # (only warnings, so just remove parts of this patch if conflics)
316 Patch2500:      kernel-warnings.patch
317
318 # git://kernel.ubuntu.com/jj/apparmor-karmic-tree.git
319 # git diff 0c9f19b4dd23620fb32116922b0d93e8aca6c911..HEAD
320 Patch5000:      kernel-apparmor.patch
321
322 # for rescuecd
323 # based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
324 Patch7000:      kernel-inittmpfs.patch
325
326 # based on http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.30.4-200908132040.patch
327 # NOTE: put raw upstream patches on kernel-grsec_full.patch:GRSECURITY_RAW for reference
328 #       (since upstream deletes older patches)
329 Patch9999:      kernel-grsec_full.patch
330 Patch10000:     kernel-grsec-caps.patch
331 Patch10001:     kernel-grsec-common.patch
332 Patch10002:     kernel-grsec_fixes.patch
333 Patch10003:     kernel-grsec-no-stupid-SbO.patch
334
335 URL:            http://www.kernel.org/
336 BuildRequires:  binutils >= 3:2.18
337 %ifarch sparc sparc64
338 BuildRequires:  elftoaout
339 %endif
340 %ifarch ppc
341 BuildRequires:  uboot-mkimage
342 %endif
343 AutoReqProv:    no
344 BuildRequires:  /sbin/depmod
345 BuildRequires:  gcc >= 5:3.2
346 BuildRequires:  xz >= 1:4.999.7
347 # for hostname command
348 BuildRequires:  net-tools
349 BuildRequires:  perl-base
350 BuildRequires:  rpm-build >= 4.5-24
351 BuildRequires:  rpmbuild(macros) >= 1.217
352 Requires(post): coreutils
353 Requires(post): geninitrd >= 10000-3
354 Requires(post): module-init-tools >= 0.9.9
355 Requires:       /sbin/depmod
356 Requires:       coreutils
357 Requires:       geninitrd >= 10000-3
358 Requires:       module-init-tools >= 0.9.9
359 Provides:       %{name}(netfilter) = %{netfilter_snap}
360 Provides:       %{name}(vermagic) = %{kernel_release}
361 Obsoletes:      kernel%{_alt_kernel}-isdn-mISDN
362 Obsoletes:      kernel-misc-acer_acpi
363 Obsoletes:      kernel-misc-fuse
364 Obsoletes:      kernel-misc-uvc
365 Obsoletes:      kernel-modules
366 Obsoletes:      kernel-net-ar81
367 Obsoletes:      kernel-net-hostap
368 Obsoletes:      kernel-net-ieee80211
369 Obsoletes:      kernel-net-ipp2p
370 Obsoletes:      kernel-net-rt61
371 Obsoletes:      kernel-smp
372 Conflicts:      e2fsprogs < 1.29
373 Conflicts:      isdn4k-utils < 3.1pre1
374 Conflicts:      jfsutils < 1.1.3
375 Conflicts:      module-init-tools < 0.9.10
376 Conflicts:      nfs-utils < 1.0.5
377 Conflicts:      oprofile < 0.9
378 Conflicts:      ppp < 1:2.4.0
379 Conflicts:      procps < 3.2.0
380 Conflicts:      quota-tools < 3.09
381 %if %{with reiserfs4}
382 Conflicts:      reiser4progs < 1.0.0
383 %endif
384 Conflicts:      reiserfsprogs < 3.6.3
385 Conflicts:      udev < 1:081
386 Conflicts:      util-linux < 2.10o
387 Conflicts:      util-vserver < 0.30.216
388 Conflicts:      xfsprogs < 2.6.0
389 %if %{with pae}
390 ExcludeArch:    i386 i486 i586
391 %else
392 ExclusiveArch:  %{ix86} %{x8664} alpha arm ia64 ppc ppc64 sparc sparc64
393 %endif
394 ExclusiveOS:    Linux
395 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
396
397 %ifarch %{ix86} %{x8664}
398 %define         target_arch_dir         x86
399 %endif
400 %ifarch ppc ppc64
401 %define         target_arch_dir         powerpc
402 %endif
403 %ifarch sparc sparc64
404 %define         target_arch_dir         sparc
405 %endif
406 %ifnarch %{ix86} %{x8664} ppc ppc64 sparc sparc64
407 %define         target_arch_dir         %{_target_base_arch}
408 %endif
409
410 %define         defconfig       arch/%{target_arch_dir}/defconfig
411
412 # No ELF objects there to strip (skips processing 27k files)
413 %define         _noautostrip    .*%{_kernelsrcdir}/.*
414 %define         _noautochrpath  .*%{_kernelsrcdir}/.*
415
416 %ifarch ia64
417 %define         initrd_dir      /boot/efi
418 %else
419 %define         initrd_dir      /boot
420 %endif
421
422 %define         topdir          %{_builddir}/%{name}-%{version}
423 %define         srcdir          %{topdir}/linux-%{basever}
424 %define         objdir          %{topdir}/%{targetobj}
425 %define         targetobj       %{_target_base_arch}-gcc-%(%{kgcc} -dumpversion)
426
427 %define         _kernelsrcdir   /usr/src/linux%{_alt_kernel}-%{version}
428
429 %if "%{_target_base_arch}" != "%{_arch}"
430         %define CrossOpts ARCH=%{_target_base_arch} CROSS_COMPILE=%{_target_cpu}-pld-linux-
431         %define DepMod /bin/true
432
433         %if "%{_arch}" == "sparc" && "%{_target_base_arch}" == "sparc64"
434         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
435         %define DepMod /sbin/depmod
436         %endif
437
438         %if "%{_arch}" == "sparc64" && "%{_target_base_arch}" == "sparc"
439         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
440         %define DepMod /sbin/depmod
441         %endif
442
443         %if "%{_arch}" == "x86_64" && "%{_target_base_arch}" == "i386"
444         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
445         %define DepMod /sbin/depmod
446         %endif
447
448         %if "%{_target_base_arch}" == "ppc" || "%{_target_base_arch}" == "ppc64"
449         %define CrossOpts ARCH=powerpc CROSS_COMPILE=%{_target_cpu}-pld-linux-
450         %endif
451 %else
452         %ifarch ppc ppc64
453         %define CrossOpts ARCH=powerpc CC="%{__cc}"
454         %else
455         %define CrossOpts ARCH=%{_target_base_arch} CC="%{__cc}"
456         %endif
457         %define DepMod /sbin/depmod
458 %endif
459 %define MakeOpts %{CrossOpts} HOSTCC="%{__cc}"
460
461 %define __features Netfilter module dated: %{netfilter_snap}\
462 %{?with_grsec_full:Grsecurity support - enabled}\
463 %{?with_grsec_minimal:Grsecurity minimal support /proc,link,fifo,shm/ - enabled}\
464 %{?with_pax:PaX support - enabled}\
465 %{?with_fbcondecor:Fbsplash/fbcondecor - enabled }\
466 %{?with_nfsroot:Root on NFS - enabled}\
467 %{?with_apparmor:apparmor support - enabled}\
468
469 %define Features %(echo "%{__features}" | sed '/^$/d')
470
471 %description
472 This package contains the Linux kernel that is used to boot and run
473 your system. It contains few device drivers for specific hardware.
474 Most hardware is instead supported by modules loaded after booting.
475
476 %{Features}
477
478 %description -l de.UTF-8
479 Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des
480 Linux-Betriebssystems. Der Kernel ist für grundliegende
481 Systemfunktionen verantwortlich: Speicherreservierung,
482 Prozeß-Management, Geräte Ein- und Ausgaben, usw.
483
484 %{Features}
485
486 %description -l fr.UTF-8
487 Le package kernel contient le kernel linux (vmlinuz), la partie
488 centrale d'un système d'exploitation Linux. Le noyau traite les
489 fonctions basiques d'un système d'exploitation: allocation mémoire,
490 allocation de process, entrée/sortie de peripheriques, etc.
491
492 %{Features}
493
494 %description -l pl.UTF-8
495 Pakiet zawiera jÄ…dro Linuksa niezbÄ™dne do prawidÅ‚owego dziaÅ‚ania
496 Twojego komputera. Zawiera w sobie sterowniki do sprzÄ™tu znajdujÄ…cego
497 siÄ™ w komputerze, takiego jak sterowniki dysków itp.
498
499 %{Features}
500
501 %package vmlinux
502 Summary:        vmlinux - uncompressed kernel image
503 Summary(de.UTF-8):      vmlinux - dekompressiertes Kernel Bild
504 Summary(pl.UTF-8):      vmlinux - rozpakowany obraz jÄ…dra
505 Group:          Base/Kernel
506 Obsoletes:      kernel-smp-vmlinux
507
508 %description vmlinux
509 vmlinux - uncompressed kernel image.
510
511 %description vmlinux -l de.UTF-8
512 vmlinux - dekompressiertes Kernel Bild.
513
514 %description vmlinux -l pl.UTF-8
515 vmlinux - rozpakowany obraz jÄ…dra.
516
517 %package dirs
518 Summary:        common dirs for kernel packages
519 Summary(pl.UTF-8):      Katalogi wspólne dla pakietów kernela
520 Group:          Base/Kernel
521
522 %description dirs
523 This package provides common dirs shared between various kernel
524 packages.
525
526 %description dirs -l pl.UTF-8
527 Katalog ten udostepnia katalogi współdzielone pomiÄ™dzy różnymi
528 pakietami kernela.
529
530 %package drm
531 Summary:        DRM kernel modules
532 Summary(de.UTF-8):      DRM Kernel Treiber
533 Summary(pl.UTF-8):      Sterowniki DRM
534 Group:          Base/Kernel
535 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
536 Requires:       %{name} = %{epoch}:%{version}-%{release}
537 Obsoletes:      kernel-smp-drm
538 Autoreqprov:    no
539
540 %description drm
541 DRM kernel modules.
542
543 %description drm -l de.UTF-8
544 DRM Kernel Treiber.
545
546 %description drm -l pl.UTF-8
547 Sterowniki DRM.
548
549 %package pcmcia
550 Summary:        PCMCIA modules
551 Summary(de.UTF-8):      PCMCIA Module
552 Summary(pl.UTF-8):      ModuÅ‚y PCMCIA
553 Group:          Base/Kernel
554 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
555 Requires:       %{name} = %{epoch}:%{version}-%{release}
556 Obsoletes:      kernel-smp-pcmcia
557 Conflicts:      pcmcia-cs < 3.1.21
558 Conflicts:      pcmciautils < 004
559 Autoreqprov:    no
560
561 %description pcmcia
562 PCMCIA modules.
563
564 %description pcmcia -l de.UTF-8
565 PCMCIA Module.
566
567 %description pcmcia -l pl.UTF-8
568 ModuÅ‚y PCMCIA.
569
570 %package libs
571 Summary:        Libraries for preparing bootable kernel on PowerPCs
572 Summary(pl.UTF-8):      Biblioteki do przygotowania bootowalnego jÄ…dra dla PowerPC
573 Group:          Base/Kernel
574 Requires:       %{name} = %{epoch}:%{version}-%{release}
575 Requires:       mkvmlinuz >= 1.3
576 Obsoletes:      kernel-smp-libs
577 Autoreqprov:    no
578
579 %description libs
580 Libraries for preparing bootable kernel on PowerPCs. Script called
581 mkvmlinuz may be useful for this.
582
583 %description libs -l pl.UTF-8
584 Biblioteki do przygotowania bootowalnego jÄ…dra dla PowerPC. Skrypt
585 mkvmlinuz może być do tego przydatny.
586
587 %package sound-alsa
588 Summary:        ALSA kernel modules
589 Summary(de.UTF-8):      ALSA Kernel Module
590 Summary(pl.UTF-8):      Sterowniki dźwiÄ™ku ALSA
591 Group:          Base/Kernel
592 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
593 Requires:       %{name} = %{epoch}:%{version}-%{release}
594 Obsoletes:      kernel-smp-sound-alsa
595 Autoreqprov:    no
596
597 %description sound-alsa
598 ALSA (Advanced Linux Sound Architecture) sound drivers.
599
600 %description sound-alsa -l de.UTF-8
601 ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
602
603 %description sound-alsa -l pl.UTF-8
604 Sterowniki dźwiÄ™ku ALSA (Advanced Linux Sound Architecture).
605
606 %package sound-oss
607 Summary:        OSS kernel modules
608 Summary(de.UTF-8):      OSS Kernel Module
609 Summary(pl.UTF-8):      Sterowniki dźwiÄ™ku OSS
610 Group:          Base/Kernel
611 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
612 Requires:       %{name} = %{epoch}:%{version}-%{release}
613 Obsoletes:      kernel-smp-sound-oss
614 Autoreqprov:    no
615
616 %description sound-oss
617 OSS (Open Sound System) drivers.
618
619 %description sound-oss -l de.UTF-8
620 OSS (Open Sound System) Treiber.
621
622 %description sound-oss -l pl.UTF-8
623 Sterowniki dźwiÄ™ku OSS (Open Sound System).
624
625 %package headers
626 Summary:        Header files for the Linux kernel
627 Summary(de.UTF-8):      Header Dateien für den Linux-Kernel
628 Summary(pl.UTF-8):      Pliki nagłówkowe jÄ…dra Linuksa
629 Group:          Development/Building
630 Provides:       %{name}-headers(netfilter) = %{netfilter_snap}
631 Autoreqprov:    no
632
633 %description headers
634 These are the C header files for the Linux kernel, which define
635 structures and constants that are needed when rebuilding the kernel or
636 building kernel modules.
637
638 %description headers -l de.UTF-8
639 Dies sind die C Header Dateien für den Linux-Kernel, die definierte
640 Strukturen und Konstante beinhalten, die beim rekompilieren des
641 Kernels oder bei Kernel Modul kompilationen gebraucht werden.
642
643 %description headers -l pl.UTF-8
644 Pakiet zawiera pliki nagłówkowe jÄ…dra, niezbÄ™dne do rekompilacji jÄ…dra
645 oraz budowania modułów jÄ…dra.
646
647 %package module-build
648 Summary:        Development files for building kernel modules
649 Summary(de.UTF-8):      Development Dateien die beim Kernel Modul kompilationen gebraucht werden
650 Summary(pl.UTF-8):      Pliki sÅ‚użące do budowania modułów jÄ…dra
651 Group:          Development/Building
652 Requires:       %{name}-headers = %{epoch}:%{version}-%{release}
653 Conflicts:      rpmbuild(macros) < 1.321
654 Autoreqprov:    no
655
656 %description module-build
657 Development files from kernel source tree needed to build Linux kernel
658 modules from external packages.
659
660 %description module-build -l de.UTF-8
661 Development Dateien des Linux-Kernels die beim kompilieren externer
662 Kernel Module gebraucht werden.
663
664 %description module-build -l pl.UTF-8
665 Pliki ze drzewa ÅºródeÅ‚ jÄ…dra potrzebne do budowania modułów jÄ…dra
666 Linuksa z zewnÄ™trznych pakietów.
667
668 %package source
669 Summary:        Kernel source tree
670 Summary(de.UTF-8):      Der Kernel Quelltext
671 Summary(pl.UTF-8):      Kod ÅºródÅ‚owy jÄ…dra Linuksa
672 Group:          Development/Building
673 Requires:       %{name}-module-build = %{epoch}:%{version}-%{release}
674 Autoreqprov:    no
675
676 %description source
677 This is the source code for the Linux kernel. You can build a custom
678 kernel that is better tuned to your particular hardware.
679
680 %description source -l de.UTF-8
681 Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des
682 Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
683 C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die
684 im Kernel-Source definiert sind. Die Source-Dateien können auch
685 benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre
686 Hardware ausgerichtet ist.
687
688 %description source -l fr.UTF-8
689 Le package pour le kernel-source contient le code source pour le noyau
690 linux. Ces sources sont nécessaires pour compiler la plupart des
691 programmes C, car il dépend de constantes définies dans le code
692 source. Les sources peuvent Ãªtre aussi utilisée pour compiler un noyau
693 personnalisé pour avoir de meilleures performances sur des matériels
694 particuliers.
695
696 %description source -l pl.UTF-8
697 Pakiet zawiera kod ÅºródÅ‚owy jÄ…dra systemu.
698
699 %package doc
700 Summary:        Kernel documentation
701 Summary(de.UTF-8):      Kernel Dokumentation
702 Summary(pl.UTF-8):      Dokumentacja do jÄ…dra Linuksa
703 Group:          Documentation
704 Autoreqprov:    no
705
706 %description doc
707 This is the documentation for the Linux kernel, as found in
708 /usr/src/linux/Documentation directory.
709
710 %description doc -l de.UTF-8
711 Dies ist die Kernel Dokumentation wie sie im 'Documentation'
712 Verzeichniss vorgefunden werden kann.
713
714 %description doc -l pl.UTF-8
715 Pakiet zawiera dokumentacjÄ™ do jÄ…dra Linuksa pochodzÄ…cÄ… z katalogu
716 /usr/src/linux/Documentation.
717
718 %prep
719 %setup -qc
720 ln -s %{SOURCE7} kernel-module-build.pl
721 ln -s %{SOURCE10} Makefile
722 cd linux-%{basever}
723
724 # hack against warning in pax/grsec
725 %ifarch alpha
726 sed -i 's/-Werror//' arch/alpha/kernel/Makefile
727 %endif
728
729 %ifarch ppc
730 install %{SOURCE5} Makefile.ppclibs
731 %endif
732
733 %if "%{postver}" != "%{nil}"
734 %{__bzip2} -dc %{SOURCE1} | patch -p1 -s
735 %endif
736
737 # tuxonice:
738 %if %{with tuxonice}
739 %patch69 -p1
740 %patch70 -p1
741 %endif
742
743 # tahoe9xx: 2.6.29 - need update
744 #%patch2 -p1
745
746 %if %{with fbcondecor}
747 %patch3 -p1
748 %endif
749 %patch4 -p1
750
751 ## netfilter
752 #
753
754 # kernel-pom-ng-IPV4OPTSSTRIP.patch
755 %patch10 -p1
756
757 # kernel-pom-ng-ipv4options.patch
758 %patch11 -p1
759
760 # kernel-pom-ng-ROUTE.patch
761 %patch14 -p1
762
763 # kernel-pom-ng-mms-conntrack-nat.patch
764 %patch16 -p1
765
766 # kernel-pom-ng-rsh.patch
767 %patch22 -p1
768
769 # kernel-pom-ng-rpc.patch
770 %patch23 -p1
771
772 # kernel-nf_rtsp.patch
773 %patch36 -p1
774
775 # kernel-owner-xid.patch
776 %if %{with vserver}
777 %patch37 -p1
778 %endif
779
780 # kernel-ipt_account.patch
781 %patch38 -p1
782
783 # kernel-ipt_ACCOUNT.patch
784 %patch39 -p1
785
786 # kernel-layer7.patch
787 %patch40 -p1
788
789 # ipvs-nfct
790 %patch41 -p1
791
792 ##
793 # end of netfilter
794
795 # zph
796 %patch49 -p1
797
798 %if %{with imq}
799 %patch50 -p1
800 %endif
801
802 # reiser4
803 %if %{with reiser4}
804 %patch51 -p1
805 %endif
806
807 # esfq
808 %if %{with esfq}
809 %patch53 -p1
810 %endif
811
812 %if %{with wrr}
813 %patch52 -p1
814 %endif
815
816 # toshiba_acpi
817 %patch54 -p1
818
819 %patch55 -p1
820 %patch56 -p1
821
822 %patch58 -p1
823
824 # kernel-rndis_host-wm5.patch
825 %patch59 -p1
826
827 # hostap enhancements from/for aircrack-ng
828 %patch85 -p1
829
830 # LSI MPT Fusion driver update (by LSI via SUSE folks)
831 # FIXME!
832 #%patch90 -p1
833
834 # vserver
835 %if %{with vserver}
836 %patch100 -p1
837 %patch101 -p1
838 %endif
839
840 # forcedeth
841 %patch130 -p1
842
843 # unionfs (disabled for rescuecd - problems with aufs2)
844 %if %{without rescuecd}
845 %patch140 -p1
846 %endif
847
848 %if %{with rescuecd}
849 # aufs2
850 %patch148 -p1
851 %else
852 # aufs1: 2.6.29 FIXME - needs port to creds
853 #%patch145 -p1
854 #%patch146 -p1
855 %endif
856
857 %patch2500 -p1
858
859 %if %{with rescuecd}
860 %patch7000 -p1
861 %endif
862
863 # grsecurity & pax stuff
864 #
865
866 # remember that we have the same config file for grsec_minimal and
867 # grsec_full, but the patches are different.
868
869 %if %{with grsecurity}
870 %if %{with grsec_minimal}
871 %patch1000 -p1
872 %else
873 # grsec_full and/or pax
874 %patch9999 -p1
875 %{?with_vserver:%patch10000 -p1}
876 %{?with_vserver:%patch10001 -p1}
877 %{?with_vserver:%patch10002 -p1}
878 %{?with_vserver:%patch10003 -p1}
879 %endif
880 %endif
881 #
882 # end of grsecurity & pax stuff
883
884 # apparmor
885 %if %{with apparmor}
886 %patch5000 -p1
887 %endif
888
889 %patch150 -p1
890
891 %ifarch ppc ppc64
892 #patch200 -p1
893 %endif
894
895 # routes
896 %patch300 -p1
897
898 # Small fixes:
899 %patch2000 -p1
900 %patch2001 -p1
901 #%patch2003 -p1
902
903 # Fix EXTRAVERSION in main Makefile
904 sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{postver}%{?alt_kernel:_%{alt_kernel}}#g' Makefile
905
906 # cleanup backups after patching
907 find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
908
909 %build
910 install -d %{objdir}
911 cat > %{targetobj}.mk <<'EOF'
912 # generated by %{name}.spec
913 KERNELSRC               := %{_builddir}/%{name}-%{version}/linux-%{basever}
914 KERNELOUTPUT    := %{objdir}
915
916 SRCARCH         := %{target_arch_dir}
917 ARCH            := %{_target_base_arch}
918 Q                       := %{!?with_verbose:@}
919 MAKE_OPTS       := %{MakeOpts}
920 DEFCONFIG   := %{defconfig}
921 EOF
922
923 PaXconfig() {
924         set -x
925         cat <<-EOCONFIG > $1
926         %ifarch %{ix86}
927                 CONFIG_PAX_SEGMEXEC=y
928                 # performance impact on CPUs without NX bit
929                 CONFIG_PAX_PAGEEXEC=n
930                 # Testing KERNEXEC
931
932                 CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=n
933                 CONFIG_PCI_BIOS=n
934                 CONFIG_EFI=n
935         %endif
936
937         %ifarch ppc64
938                 CONFIG_PAX_NOELFRELOCS=n
939         %endif
940         %ifarch ppc
941                 CONFIG_PAX_EMUTRAMP=y
942                 CONFIG_PAX_EMUSIGRT=y
943                 CONFIG_PAX_EMUPLT=y
944         %endif
945
946         %ifarch sparc sparc64 alpha
947                 CONFIG_PAX_EMUPLT=y
948         %endif
949
950         # Now we have to check MAC system integration. Grsecurity (full) uses PAX_HAVE_ACL_FLAGS
951         # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably
952         # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used
953         # PAX_HOOK_ACL_FLAGS. 
954
955         %if %{with grsec_full}
956                 # Hardening grsec options if with pax
957                 CONFIG_GRKERNSEC_PROC_MEMMAP=y
958                 # almost rational (see HIDESYM help)
959                 CONFIG_GRKERNSEC_HIDESYM=y
960
961                 # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config
962         %else
963                 CONFIG_PAX_HAVE_ACL_FLAGS=n
964                 CONFIG_PAX_HOOK_ACL_FLAGS=y
965         %endif
966 EOCONFIG
967
968         return 0
969 }
970
971 RescueConfig() {
972         set -x
973         cat <<-EOCONFIG > $1
974                 # CONFIG_SOUND is not set
975                 # CONFIG_AUDIT is not set
976                 # CONFIG_TR is not set
977                 # CONFIG_BT is not set
978                 # CONFIG_VIDEO_DEV is not set
979                 # CONFIG_DVB_CORE is not set
980                 # CONFIG_HAMRADIO is not set
981                 # CONFIG_ARCNET is not set
982                 # CONFIG_FB is not set
983                 # CONFIG_DRM is not set
984                 # CONFIG_WATCHDOG is not set
985                 # CONFIG_INPUT_JOYSTICK is not set
986                 # CONFIG_DEBUG_KERNEL is not set
987                 # CONFIG_ISDN is not set
988                 # CONFIG_AGP is not set
989                 # CONFIG_SECURITY is not set
990                 # CONFIG_PARIDE is not set
991                 # CONFIG_CPU_FREQ is not set
992                 # CONFIG_GAMEPORT is not set
993                 # CONFIG_KVM is not set
994                 # CONFIG_PHONE is not set
995                 # CONFIG_STRICT_DEVMEM is not set
996                 # CONFIG_IMA is not set
997                 CONFIG_AUFS=y
998                 CONFIG_AUFS_FS=y
999                 CONFIG_AUFS_BR_RAMFS=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   %endif
1044 %endif
1045
1046 %if %{without pcmcia}
1047                 CONFIG_PCMCIA=n
1048 %endif
1049
1050 %if %{with fbcondecor}
1051                 CONFIG_FB_S3=n
1052                 CONFIG_FB_VT8623=n
1053                 CONFIG_FB_ARK=n
1054                 CONFIG_FB_TILEBLITTING=n
1055                 CONFIG_FB_CON_DECOR=y
1056 %endif
1057
1058 %if %{with nfsroot}
1059                 CONFIG_NFS_FS=y
1060                 CONFIG_ROOT_NFS=y
1061 %endif
1062
1063 # Temporary disabled RELOCATABLE. Needed only on x86??
1064 %if %{with pax} || %{with grsec_full}
1065                 CONFIG_RELOCATABLE=n
1066 %endif
1067 EOCONFIG
1068
1069 %if %{with rescuecd}
1070         RescueConfig rescue.config
1071 %endif
1072 %if %{with pax}
1073         PaXconfig pax.config
1074 %endif
1075
1076         # prepare kernel-style config file from multiple config files
1077         %{__awk} -v arch="all %{target_arch_dir} %{_target_base_arch} %{_target_cpu}" -f %{SOURCE6} \
1078 %if %{with myown}
1079                 $RPM_SOURCE_DIR/kernel-%{alt_kernel}.config \
1080 %endif
1081                 important.config \
1082 %if %{with rescuecd}
1083                 %{SOURCE58} \
1084                 %{SOURCE59} \
1085                 rescue.config \
1086 %endif
1087                 \
1088 %if %{with pax}
1089                 %{SOURCE45} \
1090                 %{SOURCE49} \
1091                 pax.config \
1092 %else
1093   %if %{with grsec_full}
1094                 %{SOURCE45} \
1095                 %{SOURCE50} \
1096   %else
1097         %if %{with grsec_minimal}
1098                 %{SOURCE51} \
1099         %endif
1100   %endif
1101 %endif
1102                 \
1103 %if %{with reiser4}
1104                 %{SOURCE56} \
1105 %endif
1106 %if %{with wrr}
1107                 %{SOURCE57} \
1108 %endif
1109 %if %{with imq}
1110                 %{SOURCE55} \
1111 %endif
1112 %if %{with vserver}
1113                 %{SOURCE43} \
1114 %endif
1115 %if %{with tuxonice}
1116 %ifarch %{ix86} %{x8664} ia64 ppc ppc64
1117                 %{SOURCE42} \
1118 %endif
1119 %endif
1120                 %{SOURCE40} %{?0:netfilter} \
1121                 %{SOURCE41} %{?0:patches} \
1122                 %{SOURCE20} \
1123                 $RPM_SOURCE_DIR/$Config
1124 }
1125
1126 cd %{objdir}
1127 install -d arch/%{target_arch_dir}
1128 BuildConfig > %{defconfig}
1129 ln -sf %{defconfig} .config
1130 cd -
1131
1132 %{__make} \
1133         TARGETOBJ=%{targetobj} \
1134         %{?with_verbose:V=1} \
1135         oldconfig
1136
1137 %{__awk} %{?debug:-v dieOnError=1} -v infile=%{objdir}/%{defconfig} -f %{SOURCE8} %{objdir}/.config
1138
1139 # build kernel
1140 %{__make} \
1141         TARGETOBJ=%{targetobj} \
1142         %{?with_verbose:V=1} \
1143         all
1144
1145 %install
1146 rm -rf $RPM_BUILD_ROOT
1147 %{__make} %{MakeOpts} %{!?with_verbose:-s} modules_install firmware_install \
1148         -C %{objdir} \
1149         %{?with_verbose:V=1} \
1150         DEPMOD=%{DepMod} \
1151         INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
1152         INSTALL_FW_PATH=$RPM_BUILD_ROOT/lib/firmware/%{kernel_release} \
1153         KERNELRELEASE=%{kernel_release}
1154
1155 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc
1156
1157 %if %{with myown}
1158 # create directories which may be missing, to simplyfy %files
1159 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/sound
1160 %endif
1161
1162 # rpm obeys filelinkto checks for ghosted symlinks, convert to files
1163 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1164 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1165
1166 # /boot
1167 install -d $RPM_BUILD_ROOT/boot
1168 cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
1169 %ifarch %{ix86} %{x8664}
1170 cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1171 install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
1172 %endif
1173 %ifarch ppc ppc64
1174 install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1175 install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
1176 %endif
1177 %ifarch ia64
1178 %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
1179 cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/efi/vmlinuz-%{kernel_release}
1180 ln -sf efi/vmlinuz-%{kernel_release} $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1181 %endif
1182 %ifarch alpha sparc sparc64
1183         %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
1184         cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1185         install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1186 %ifarch sparc
1187         elftoaout %{objdir}/arch/sparc/boot/image -o %{objdir}/vmlinux.aout
1188         install %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
1189 %endif
1190 %ifarch sparc64
1191         elftoaout %{objdir}/arch/sparc64/boot/image -o %{objdir}/vmlinux.aout
1192         install %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
1193 %endif
1194 %ifarch arm
1195         install %{objdir}/arch/arm/boot/zImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1196 %endif
1197 %endif
1198
1199 # ghosted initrd
1200 touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz
1201
1202 %if "%{_target_base_arch}" != "%{_arch}"
1203 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
1204 %endif
1205
1206 # /etc/modrobe.d
1207 install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
1208
1209 # /usr/src/linux
1210 install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
1211 # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
1212 if cp -al %{srcdir}/COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
1213         l=l
1214         rm -f $RPM_BUILD_ROOT/COPYING
1215 fi
1216
1217 cp -a$l %{srcdir}/* $RPM_BUILD_ROOT%{_kernelsrcdir}
1218 cp -a %{objdir}/Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}/Module.symvers-dist
1219 cp -aL %{objdir}/.config $RPM_BUILD_ROOT%{_kernelsrcdir}/config-dist
1220 cp -a %{objdir}/include/linux/autoconf.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf-dist.h
1221 cp -a %{objdir}/include/linux/{utsrelease,version}.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
1222 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf.h
1223 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
1224
1225 # collect module-build files and directories
1226 # Usage: kernel-module-build.pl $rpmdir $fileoutdir
1227 fileoutdir=$(pwd)
1228 cd $RPM_BUILD_ROOT%{_kernelsrcdir}
1229 %{__perl} %{topdir}/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir
1230 cd -
1231
1232 %clean
1233 rm -rf $RPM_BUILD_ROOT
1234
1235 %preun
1236 if [ -x /sbin/new-kernel-pkg ]; then
1237         /sbin/new-kernel-pkg --remove %{kernel_release}
1238 fi
1239
1240 %post
1241 %ifarch ia64
1242 mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
1243 %{?alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1244 ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
1245 %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}}
1246 %endif
1247 mv -f /boot/vmlinuz{,.old} 2> /dev/null
1248 %{?alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1249 mv -f /boot/System.map{,.old} 2> /dev/null
1250 %{?alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null}
1251 ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
1252 %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}}
1253 ln -sf System.map-%{kernel_release} /boot/System.map
1254 %{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}}
1255
1256 %depmod %{kernel_release}
1257
1258 /sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
1259 mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
1260 %{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null}
1261 ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
1262 %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
1263
1264 if [ -x /sbin/new-kernel-pkg ]; then
1265         /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
1266 elif [ -x /sbin/rc-boot ]; then
1267         /sbin/rc-boot 1>&2 || :
1268 fi
1269
1270 %post vmlinux
1271 mv -f /boot/vmlinux{,.old} 2> /dev/null
1272 %{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null}
1273 ln -sf vmlinux-%{kernel_release} /boot/vmlinux
1274 %{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
1275
1276 %post libs
1277 %{_sbindir}/mkvmlinuz /boot/zImage-%{kernel_release} %{kernel_release}
1278
1279 %post drm
1280 %depmod %{kernel_release}
1281
1282 %postun drm
1283 %depmod %{kernel_release}
1284
1285 %post pcmcia
1286 %depmod %{kernel_release}
1287
1288 %postun pcmcia
1289 %depmod %{kernel_release}
1290
1291 %post sound-alsa
1292 %depmod %{kernel_release}
1293
1294 %postun sound-alsa
1295 %depmod %{kernel_release}
1296
1297 %post sound-oss
1298 %depmod %{kernel_release}
1299
1300 %postun sound-oss
1301 %depmod %{kernel_release}
1302
1303 %post headers
1304 ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
1305
1306 %postun headers
1307 if [ "$1" = "0" ]; then
1308         if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
1309                 if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
1310                         rm -f %{_prefix}/src/linux%{_alt_kernel}
1311                 fi
1312         fi
1313 fi
1314
1315 %triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
1316 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
1317 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
1318
1319 %triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
1320 if [ "$1" = 0 ]; then
1321         rm -f /lib/modules/%{kernel_release}/{build,source}
1322 fi
1323
1324 %files
1325 %defattr(644,root,root,755)
1326 %ifarch sparc sparc64
1327 /boot/vmlinux.aout-%{kernel_release}
1328 %endif
1329 %ifarch ia64
1330 /boot/efi/vmlinuz-%{kernel_release}
1331 %endif
1332 /boot/vmlinuz-%{kernel_release}
1333 /boot/System.map-%{kernel_release}
1334 %ghost %{initrd_dir}/initrd-%{kernel_release}.gz
1335 /lib/firmware/%{kernel_release}
1336
1337 %dir /lib/modules/%{kernel_release}
1338 %dir /lib/modules/%{kernel_release}/kernel
1339 %ifnarch sparc
1340 /lib/modules/%{kernel_release}/kernel/arch
1341 %endif
1342 /lib/modules/%{kernel_release}/kernel/crypto
1343 /lib/modules/%{kernel_release}/kernel/drivers
1344 %if %{have_drm}
1345 %exclude /lib/modules/%{kernel_release}/kernel/drivers/gpu
1346 %endif
1347 /lib/modules/%{kernel_release}/kernel/fs
1348 /lib/modules/%{kernel_release}/kernel/kernel
1349 /lib/modules/%{kernel_release}/kernel/lib
1350 /lib/modules/%{kernel_release}/kernel/net
1351 %if %{have_sound}
1352 %dir /lib/modules/%{kernel_release}/kernel/sound
1353 /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1354 /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1355 %ifnarch sparc
1356 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1357 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1358 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1359 %endif
1360 %endif
1361 %dir /lib/modules/%{kernel_release}/misc
1362 %if %{have_pcmcia}
1363 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]*
1364 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko*
1365 %exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1366 %if %{without rescuecd}
1367 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1368 %exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1369 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1370 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1371 %exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1372 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1373 %endif
1374 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
1375 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1376 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1377 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1378 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1379 %exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1380 %exclude /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1381 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1382 %endif
1383 %if %{with myown}
1384 /lib/modules/%{kernel_release}/kernel/sound
1385 %endif
1386 %ghost /lib/modules/%{kernel_release}/modules.*
1387 # symlinks pointing to kernelsrcdir
1388 %ghost /lib/modules/%{kernel_release}/build
1389 %ghost /lib/modules/%{kernel_release}/source
1390 %dir %{_sysconfdir}/modprobe.d/%{kernel_release}
1391
1392 %files dirs
1393 %defattr(644,root,root,755)
1394 %dir %{_kernelsrcdir}
1395
1396 %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
1397 %files vmlinux
1398 %defattr(644,root,root,755)
1399 /boot/vmlinux-%{kernel_release}
1400 %endif
1401
1402 %if %{have_drm}
1403 %files drm
1404 %defattr(644,root,root,755)
1405 /lib/modules/%{kernel_release}/kernel/drivers/gpu
1406 %endif
1407
1408 %if %{have_pcmcia}
1409 %files pcmcia
1410 %defattr(644,root,root,755)
1411 /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko*
1412 /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1413 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko*
1414 %if %{without rescuecd}
1415 /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1416 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1417 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1418 /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1419 %endif
1420 /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1421 /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
1422 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1423 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1424 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1425 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1426 /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1427 /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1428 /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1429 %endif
1430
1431 %ifarch ppc-broken
1432 %if "%{_arch}" == "ppc"
1433 %files libs
1434 %defattr(644,root,root,755)
1435 %dir /boot/libs-%{kernel_release}
1436 /boot/libs-%{kernel_release}/common
1437 /boot/libs-%{kernel_release}/kernel
1438 /boot/libs-%{kernel_release}/lib
1439 /boot/libs-%{kernel_release}/of1275
1440 /boot/libs-%{kernel_release}/openfirmware
1441 /boot/libs-%{kernel_release}/simple
1442 %dir /boot/libs-%{kernel_release}/utils
1443 %attr(755,root,root) /boot/libs-%{kernel_release}/utils/*
1444 /boot/libs-%{kernel_release}/ld.script
1445 %endif
1446 %endif
1447
1448 %if %{have_sound}
1449 %files sound-alsa
1450 %defattr(644,root,root,755)
1451 /lib/modules/%{kernel_release}/kernel/sound
1452 %exclude %dir /lib/modules/%{kernel_release}/kernel/sound
1453 %exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1454 %exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1455 %if %{have_oss}
1456 %exclude /lib/modules/%{kernel_release}/kernel/sound/oss
1457 %endif
1458 %ifnarch sparc
1459 /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1460 /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1461 /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1462 /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1463 %endif
1464
1465 %if %{have_oss}
1466 %files sound-oss
1467 %defattr(644,root,root,755)
1468 /lib/modules/%{kernel_release}/kernel/sound/oss
1469 %endif
1470 %endif
1471
1472 %files headers
1473 %defattr(644,root,root,755)
1474 %{_kernelsrcdir}/include
1475 %dir %{_kernelsrcdir}/arch
1476 %dir %{_kernelsrcdir}/arch/[!K]*
1477 %{_kernelsrcdir}/arch/*/include
1478 %dir %{_kernelsrcdir}/security
1479 %dir %{_kernelsrcdir}/security/selinux
1480 %{_kernelsrcdir}/security/selinux/include
1481 %{_kernelsrcdir}/config-dist
1482 %{_kernelsrcdir}/Module.symvers-dist
1483
1484 %files module-build -f aux_files
1485 %defattr(644,root,root,755)
1486 %ifarch ppc ppc64
1487 %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
1488 %endif
1489 %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1490 %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1491 %{_kernelsrcdir}/drivers/lguest/lg.h
1492 %{_kernelsrcdir}/kernel/bounds.c
1493 %dir %{_kernelsrcdir}/scripts
1494 %dir %{_kernelsrcdir}/scripts/kconfig
1495 %{_kernelsrcdir}/scripts/Kbuild.include
1496 %{_kernelsrcdir}/scripts/Makefile*
1497 %{_kernelsrcdir}/scripts/basic
1498 %{_kernelsrcdir}/scripts/mkmakefile
1499 %{_kernelsrcdir}/scripts/mod
1500 %{_kernelsrcdir}/scripts/setlocalversion
1501 %{_kernelsrcdir}/scripts/*.c
1502 %{_kernelsrcdir}/scripts/*.sh
1503 %{_kernelsrcdir}/scripts/kconfig/*
1504 %{_kernelsrcdir}/scripts/mkcompile_h
1505 %dir %{_kernelsrcdir}/scripts/selinux
1506 %{_kernelsrcdir}/scripts/selinux/Makefile
1507 %dir %{_kernelsrcdir}/scripts/selinux/mdp
1508 %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
1509 %{_kernelsrcdir}/scripts/selinux/mdp/*.c
1510
1511 %files doc
1512 %defattr(644,root,root,755)
1513 %{_kernelsrcdir}/Documentation
1514
1515 %if %{with source}
1516 %files source -f aux_files_exc
1517 %defattr(644,root,root,755)
1518 %{_kernelsrcdir}/arch/*/[!Mik]*
1519 %{_kernelsrcdir}/arch/*/kernel/[!M]*
1520 %{_kernelsrcdir}/arch/ia64/ia32/[!M]*
1521 %{_kernelsrcdir}/arch/ia64/install.sh
1522 %{_kernelsrcdir}/arch/m68k/ifpsp060/[!M]*
1523 %{_kernelsrcdir}/arch/m68k/ifpsp060/MISC
1524 %{_kernelsrcdir}/arch/parisc/install.sh
1525 %{_kernelsrcdir}/arch/x86/ia32/[!M]*
1526 %{_kernelsrcdir}/arch/ia64/kvm
1527 %{_kernelsrcdir}/arch/powerpc/kvm
1528 %ifarch ppc ppc64
1529 %exclude %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
1530 %endif
1531 %{_kernelsrcdir}/arch/s390/kvm
1532 %{_kernelsrcdir}/arch/x86/kvm
1533 %exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1534 %exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1535 %exclude %{_kernelsrcdir}/drivers/lguest/lg.h
1536 %{_kernelsrcdir}/block
1537 %{_kernelsrcdir}/crypto
1538 %{_kernelsrcdir}/drivers
1539 %{_kernelsrcdir}/firmware
1540 %{_kernelsrcdir}/fs
1541 %if %{with grsecurity} && %{without rescuecd}
1542 %{_kernelsrcdir}/grsecurity
1543 %endif
1544 %{_kernelsrcdir}/init
1545 %{_kernelsrcdir}/ipc
1546 %{_kernelsrcdir}/kernel
1547 %exclude %{_kernelsrcdir}/kernel/bounds.c
1548 %{_kernelsrcdir}/lib
1549 %{_kernelsrcdir}/mm
1550 %{_kernelsrcdir}/net
1551 %{_kernelsrcdir}/virt
1552 %{_kernelsrcdir}/samples
1553 %{_kernelsrcdir}/scripts/*
1554 %exclude %{_kernelsrcdir}/scripts/Kbuild.include
1555 %exclude %{_kernelsrcdir}/scripts/Makefile*
1556 %exclude %{_kernelsrcdir}/scripts/basic
1557 %exclude %{_kernelsrcdir}/scripts/kconfig
1558 %exclude %{_kernelsrcdir}/scripts/mkmakefile
1559 %exclude %{_kernelsrcdir}/scripts/mod
1560 %exclude %{_kernelsrcdir}/scripts/setlocalversion
1561 %exclude %{_kernelsrcdir}/scripts/*.c
1562 %exclude %{_kernelsrcdir}/scripts/*.sh
1563 %{_kernelsrcdir}/sound
1564 %{_kernelsrcdir}/security
1565 %exclude %{_kernelsrcdir}/security/selinux/include
1566 %{_kernelsrcdir}/usr
1567 %{_kernelsrcdir}/COPYING
1568 %{_kernelsrcdir}/CREDITS
1569 %{_kernelsrcdir}/MAINTAINERS
1570 %{_kernelsrcdir}/README
1571 %{_kernelsrcdir}/REPORTING-BUGS
1572 %endif
This page took 1.119333 seconds and 4 git commands to generate.