]> git.pld-linux.org Git - packages/kernel.git/blob - kernel.spec
fix patch apply
[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 # LATEST VERSION CHECKER:
10 # # curl -s http://www.kernel.org/kdist/finger_banner
11 #
12 # TODO:
13 # - benchmark NO_HZ & HZ=1000 vs HZ=300 on i686
14 # - update or remove tahoe9xx patch2
15 # - update or remove mpt-fusion patch90
16 # - update grsec_minimal patch1000:
17 #   fs/proc/base.c:1484: error: 'struct task_struct' has no member named 'uid'
18 #
19 # HOWTO update configuration files:
20 # - run build
21 # - add new options to proper config (kernel-multiarch.config, kernel-x86.config, kernel-powerpc.config etc)
22 # - sort configuration files using:
23 #   ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version}/ -a x86 kernel-x86_84.config
24 #   ./kernel-config-sort.pl ~/rpm/BUILD/kernel-%{version}/linux-%{version} kernel-multiarch.config
25 #
26 # Conditional build:
27 %bcond_without  source          # don't build kernel-source package
28 %bcond_without  doc                     # don't build kernel-doc package
29 %bcond_without  pcmcia          # don't build pcmcia
30
31 %bcond_with     verbose         # verbose build (V=1)
32 %bcond_without  reiser4         # support for reiser4 fs (experimental)
33
34 %bcond_without  grsecurity      # don't build grsecurity nor pax at all
35 %bcond_without  grsec_full      # build full grsecurity
36 %bcond_with     grsec_minimal   # build only minimal subset (proc,link,fifo,shm)
37 %bcond_with     pax             # build pax and full grsecurity (ie. grsec_full && pax)
38
39 %bcond_with     fbcondecor      # build fbcondecor (disable FB_TILEBLITTING and affected fb modules)
40 %bcond_with     pae             # build PAE (HIGHMEM64G) support on uniprocessor
41 %bcond_with     nfsroot         # build with root on NFS support
42
43 %bcond_without  imq             # imq support
44 %bcond_without  wrr             # wrr support
45 %bcond_without  esfq            # esfq support
46 %bcond_without  ipv6            # ipv6 support
47
48 %bcond_without  vserver         # support for VServer (enabled by default)
49 %bcond_without  tuxonice        # support for tuxonice (ex-suspend2) (enabled by default)
50 %bcond_without  apparmor        # build kernel with apparmor (exerimental mix)
51
52 %bcond_with     rescuecd        # build kernel for our rescue
53
54 %bcond_with     myown           # build with your own config (kernel-myown.config)
55
56 %{?debug:%define with_verbose 1}
57
58 %if %{without grsecurity}
59 %unglobal       with_grsec_full
60 %unglobal       with_grsec_minimal
61 %unglobal       with_pax
62 %endif
63
64 %if %{with pax}
65 %unglobal       with_grsec_minimal
66 %define         with_grsec_full         1
67 %define         with_grsecurity         1
68 %define         with_pax                1
69 %endif
70
71 %if %{with grsec_minimal}
72 %unglobal       with_pax
73 %unglobal       with_grsec_full
74 %define         with_grsecurity         1
75 %endif
76
77 %if %{with grsec_full}
78 %unglobal       with_grsec_minimal
79 %define         with_grsecurity         1
80 %endif
81
82 %define         have_drm        1
83 %define         have_oss        1
84 %define         have_sound      1
85 %define         have_pcmcia     1
86
87 %if %{with rescuecd}
88 %unglobal       with_apparmor
89 %unglobal       with_tuxonice
90 %unglobal       with_grsecurity
91 %unglobal       with_grsec_full
92 %unglobal       with_grsec_minimal
93 %unglobal       with_pax
94 %unglobal       with_vserver
95 %define         have_drm        0
96 %define         have_sound      0
97 %endif
98
99 %if %{with myown}
100 %define         have_drm        0
101 %define         have_oss        0
102 %define         have_sound      0
103 %define         have_pcmcia     0
104 %endif
105
106 %ifarch sparc sparc64
107 %unglobal       with_pcmcia
108 %define         have_drm        0
109 %define         have_oss        0
110 %endif
111
112 %if %{without pcmcia}
113 %define         have_pcmcia     0
114 %endif
115
116 %define         basever         2.6.32
117 %define         postver         .63
118 %define         rel             1
119
120 %define         _enable_debug_packages                  0
121
122 %define         tuxonice_version        3.0.1
123 %define         netfilter_snap          20070806
124
125 %if %{with myown}
126 %if "%{_alt_kernel}" == ""
127 %define         alt_kernel      myown
128 %endif
129 %else
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 %endif
135
136 %if %{with rescuecd}
137 %define         alt_kernel      rescuecd
138 %endif
139
140 # kernel release (used in filesystem and eventually in uname -r)
141 # modules will be looked from /lib/modules/%{kernel_release}
142 # localversion is just that without version for "> localversion"
143 %define         localversion    %{rel}
144 %define         kernel_release  %{version}%{?alt_kernel:_%{alt_kernel}}-%{localversion}
145
146 Summary:        The Linux kernel (the core of the Linux operating system)
147 Summary(de.UTF-8):      Der Linux-Kernel (Kern des Linux-Betriebssystems)
148 Summary(et.UTF-8):      Linuxi kernel (ehk operatsioonisüsteemi tuum)
149 Summary(fr.UTF-8):      Le Kernel-Linux (La partie centrale du systeme)
150 Summary(pl.UTF-8):      JÄ…dro Linuksa
151 Name:           kernel%{_alt_kernel}
152 Version:        %{basever}%{postver}
153 Release:        %{rel}
154 Epoch:          3
155 License:        GPL v2
156 Group:          Base/Kernel
157 Source0:        http://www.kernel.org/pub/linux/kernel/v2.6/linux-%{basever}.tar.bz2
158 # Source0-md5:  260551284ac224c3a43c4adac7df4879
159 %if "%{postver}" != "%{nil}"
160 Patch1:         http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v%{basever}/patch-%{version}.xz
161 # Patch1-md5:   bcde8b57108d4989765a616b4b8ff301
162 %endif
163 Source3:        kernel-autoconf.h
164 Source4:        kernel-config.h
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 # http://www.linuximq.net/patchs/linux-2.6.32-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://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch
259 Patch59:        kernel-rndis_host-wm5.patch
260
261 # Project suspend2 renamed to tuxonice
262 # http://www.tuxonice.net/downloads/all/tuxonice-3.0.99.32-for-2.6.32.patch.bz2
263 Patch69:        kernel-tuxonice.patch
264 Patch70:        kernel-tuxonice-headers.patch
265
266 # adds some ids for hostap suported cards and monitor_enable from/for aircrack-ng
267 # http://patches.aircrack-ng.org/hostap-kernel-2.6.18.patch
268 Patch85:        kernel-hostap.patch
269
270 # Taken from http://download.opensuse.org/factory/repo/src-oss/suse/src/kernel-source-2.6.30-10.3.src.rpm
271 Patch90:        kernel-mpt-fusion.patch
272
273 # based on http://vserver.13thfloor.at/Experimental/patch-2.6.32.63-vs2.3.0.36.30.diff
274 Patch100:       kernel-vserver-2.3.patch
275 Patch101:       kernel-vserver-fixes.patch
276
277 # Wake-On-Lan fix for nForce drivers; using http://atlas.et.tudelft.nl/verwei90/nforce2/wol.html
278 # Fix verified for that kernel version.
279 Patch130:       kernel-forcedeth-WON.patch
280
281 # http://download.filesystems.org/unionfs/unionfs-2.x/unionfs-2.5.3_for_2.6.31.diff.gz
282 Patch140:       kernel-unionfs.patch
283
284 # aufs1, http://aufs.sourceforge.net/
285 # aufs1 is NOT maintained since Jan 2009.
286 Patch145:       kernel-aufs.patch
287 Patch146:       kernel-aufs-support.patch
288
289 Patch148:       kernel-aufs2.patch
290
291 Patch150:       kernel-ppc-crtsavres.patch
292
293 # git://git.kernel.org/pub/scm/linux/kernel/git/pkl/squashfs-devel.git
294 Patch160:       kernel-squashfs-lzma.patch
295
296 Patch200:       kernel-ppc-ICE-hacks.patch
297
298 # The following patch extend the routing functionality in Linux
299 # to support static routes (defined by user), new way to use the
300 # alternative routes, the reverse path protection (rp_filter),
301 # the NAT processing to use correctly the routing when multiple
302 # gateways are used.
303 # http://www.ssi.bg/~ja/routes-2.6.28-16.diff
304 Patch300:       kernel-routes.patch
305
306 Patch1000:      kernel-grsec-minimal.patch
307
308 Patch2000:      kernel-small_fixes.patch
309 Patch2001:      kernel-pwc-uncompress.patch
310 Patch2003:      kernel-regressions.patch
311
312 # kill some thousands of warnings
313 # (only warnings, so just remove parts of this patch if conflics)
314 Patch2500:      kernel-warnings.patch
315
316 # git://kernel.ubuntu.com/ubuntu/ubuntu-karmic.git
317 # see ubuntu/apparmor dir
318 Patch5000:      kernel-apparmor.patch
319
320 # for rescuecd
321 # based on http://ftp.leg.uct.ac.za/pub/linux/rip/inittmpfs-2.6.14.diff.gz
322 Patch7000:      kernel-inittmpfs.patch
323
324 # based on http://www.grsecurity.net/~spender/grsecurity-2.1.14-2.6.32.7-201001291848.patch kernel-grsec_full.patch
325 # NOTE: put raw upstream patches on kernel-grsec_full.patch:GRSECURITY_RAW for reference
326 #       (since upstream deletes older patches)
327 Patch9999:      kernel-grsec_full.patch
328 Patch10000:     kernel-grsec-caps.patch
329 Patch10001:     kernel-grsec-common.patch
330 Patch10002:     kernel-grsec_fixes.patch
331
332 URL:            http://www.kernel.org/
333 BuildRequires:  binutils >= 3:2.18
334 %ifarch sparc sparc64
335 BuildRequires:  elftoaout
336 %endif
337 %ifarch ppc
338 BuildRequires:  uboot-mkimage
339 %endif
340 ##BuildRequires:        gcc < 6:4.6
341 BuildRequires:  /sbin/depmod
342 BuildRequires:  gcc >= 5:3.2
343 BuildRequires:  tar >= 1:1.22
344 BuildRequires:  xz >= 1:4.999.7
345 AutoReqProv:    no
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-firmware
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}/.*\\|.*/vmlinux.*\\)
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-%(%{__cc} -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 drm
518 Summary:        DRM kernel modules
519 Summary(de.UTF-8):      DRM Kernel Treiber
520 Summary(pl.UTF-8):      Sterowniki DRM
521 Group:          Base/Kernel
522 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
523 Requires:       %{name} = %{epoch}:%{version}-%{release}
524 Obsoletes:      kernel-smp-drm
525 AutoReqProv:    no
526
527 %description drm
528 DRM kernel modules.
529
530 %description drm -l de.UTF-8
531 DRM Kernel Treiber.
532
533 %description drm -l pl.UTF-8
534 Sterowniki DRM.
535
536 %package pcmcia
537 Summary:        PCMCIA modules
538 Summary(de.UTF-8):      PCMCIA Module
539 Summary(pl.UTF-8):      ModuÅ‚y PCMCIA
540 Group:          Base/Kernel
541 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
542 Requires:       %{name} = %{epoch}:%{version}-%{release}
543 Obsoletes:      kernel-smp-pcmcia
544 Conflicts:      pcmcia-cs < 3.1.21
545 Conflicts:      pcmciautils < 004
546 AutoReqProv:    no
547
548 %description pcmcia
549 PCMCIA modules.
550
551 %description pcmcia -l de.UTF-8
552 PCMCIA Module.
553
554 %description pcmcia -l pl.UTF-8
555 ModuÅ‚y PCMCIA.
556
557 %package sound-alsa
558 Summary:        ALSA kernel modules
559 Summary(de.UTF-8):      ALSA Kernel Module
560 Summary(pl.UTF-8):      Sterowniki dźwiÄ™ku ALSA
561 Group:          Base/Kernel
562 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
563 Requires:       %{name} = %{epoch}:%{version}-%{release}
564 Obsoletes:      kernel-smp-sound-alsa
565 AutoReqProv:    no
566
567 %description sound-alsa
568 ALSA (Advanced Linux Sound Architecture) sound drivers.
569
570 %description sound-alsa -l de.UTF-8
571 ALSA (Advanced Linux Sound Architecture) Sound-Treiber.
572
573 %description sound-alsa -l pl.UTF-8
574 Sterowniki dźwiÄ™ku ALSA (Advanced Linux Sound Architecture).
575
576 %package sound-oss
577 Summary:        OSS kernel modules
578 Summary(de.UTF-8):      OSS Kernel Module
579 Summary(pl.UTF-8):      Sterowniki dźwiÄ™ku OSS
580 Group:          Base/Kernel
581 Requires(postun):       %{name} = %{epoch}:%{version}-%{release}
582 Requires:       %{name} = %{epoch}:%{version}-%{release}
583 Obsoletes:      kernel-smp-sound-oss
584 AutoReqProv:    no
585
586 %description sound-oss
587 OSS (Open Sound System) drivers.
588
589 %description sound-oss -l de.UTF-8
590 OSS (Open Sound System) Treiber.
591
592 %description sound-oss -l pl.UTF-8
593 Sterowniki dźwiÄ™ku OSS (Open Sound System).
594
595 %package headers
596 Summary:        Header files for the Linux kernel
597 Summary(de.UTF-8):      Header Dateien für den Linux-Kernel
598 Summary(pl.UTF-8):      Pliki nagłówkowe jÄ…dra Linuksa
599 Group:          Development/Building
600 Provides:       %{name}-headers(netfilter) = %{netfilter_snap}
601 AutoReqProv:    no
602
603 %description headers
604 These are the C header files for the Linux kernel, which define
605 structures and constants that are needed when rebuilding the kernel or
606 building kernel modules.
607
608 %description headers -l de.UTF-8
609 Dies sind die C Header Dateien für den Linux-Kernel, die definierte
610 Strukturen und Konstante beinhalten, die beim rekompilieren des
611 Kernels oder bei Kernel Modul kompilationen gebraucht werden.
612
613 %description headers -l pl.UTF-8
614 Pakiet zawiera pliki nagłówkowe jÄ…dra, niezbÄ™dne do rekompilacji jÄ…dra
615 oraz budowania modułów jÄ…dra.
616
617 %package module-build
618 Summary:        Development files for building kernel modules
619 Summary(de.UTF-8):      Development Dateien die beim Kernel Modul kompilationen gebraucht werden
620 Summary(pl.UTF-8):      Pliki sÅ‚użące do budowania modułów jÄ…dra
621 Group:          Development/Building
622 Requires:       %{name}-headers = %{epoch}:%{version}-%{release}
623 Conflicts:      rpmbuild(macros) < 1.321
624 AutoReqProv:    no
625
626 %description module-build
627 Development files from kernel source tree needed to build Linux kernel
628 modules from external packages.
629
630 %description module-build -l de.UTF-8
631 Development Dateien des Linux-Kernels die beim kompilieren externer
632 Kernel Module gebraucht werden.
633
634 %description module-build -l pl.UTF-8
635 Pliki ze drzewa ÅºródeÅ‚ jÄ…dra potrzebne do budowania modułów jÄ…dra
636 Linuksa z zewnÄ™trznych pakietów.
637
638 %package source
639 Summary:        Kernel source tree
640 Summary(de.UTF-8):      Der Kernel Quelltext
641 Summary(pl.UTF-8):      Kod ÅºródÅ‚owy jÄ…dra Linuksa
642 Group:          Development/Building
643 Requires:       %{name}-module-build = %{epoch}:%{version}-%{release}
644 AutoReqProv:    no
645
646 %description source
647 This is the source code for the Linux kernel. You can build a custom
648 kernel that is better tuned to your particular hardware.
649
650 %description source -l de.UTF-8
651 Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des
652 Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
653 C-Programme zu kompilieren, da sie auf Konstanten zurückgreifen, die
654 im Kernel-Source definiert sind. Die Source-Dateien können auch
655 benutzt werden, um einen Kernel zu kompilieren, der besser auf Ihre
656 Hardware ausgerichtet ist.
657
658 %description source -l fr.UTF-8
659 Le package pour le kernel-source contient le code source pour le noyau
660 linux. Ces sources sont nécessaires pour compiler la plupart des
661 programmes C, car il dépend de constantes définies dans le code
662 source. Les sources peuvent Ãªtre aussi utilisée pour compiler un noyau
663 personnalisé pour avoir de meilleures performances sur des matériels
664 particuliers.
665
666 %description source -l pl.UTF-8
667 Pakiet zawiera kod ÅºródÅ‚owy jÄ…dra systemu.
668
669 %package doc
670 Summary:        Kernel documentation
671 Summary(de.UTF-8):      Kernel Dokumentation
672 Summary(pl.UTF-8):      Dokumentacja do jÄ…dra Linuksa
673 Group:          Documentation
674 AutoReqProv:    no
675
676 %description doc
677 This is the documentation for the Linux kernel, as found in
678 /usr/src/linux/Documentation directory.
679
680 %description doc -l de.UTF-8
681 Dies ist die Kernel Dokumentation wie sie im 'Documentation'
682 Verzeichniss vorgefunden werden kann.
683
684 %description doc -l pl.UTF-8
685 Pakiet zawiera dokumentacjÄ™ do jÄ…dra Linuksa pochodzÄ…cÄ… z katalogu
686 /usr/src/linux/Documentation.
687
688 %prep
689 %setup -qc
690 ln -s %{SOURCE7} kernel-module-build.pl
691 ln -s %{SOURCE10} Makefile
692 cd linux-%{basever}
693
694 # hack against warning in pax/grsec
695 sed -i 's/-Werror//' arch/alpha/kernel/Makefile
696
697 %if "%{postver}" != "%{nil}"
698 %patch1 -p1
699 %endif
700
701 # tuxonice:
702 %if %{with tuxonice}
703 %patch69 -p1
704 %patch70 -p1
705 %endif
706
707 # tahoe9xx: 2.6.29 - need update
708 #%patch2 -p1
709
710 %if %{with fbcondecor}
711 %patch3 -p1
712 %endif
713 %patch4 -p1
714
715 ## netfilter
716 #
717
718 # kernel-pom-ng-IPV4OPTSSTRIP.patch
719 %patch10 -p1
720
721 # kernel-pom-ng-ipv4options.patch
722 %patch11 -p1
723
724 # kernel-pom-ng-ROUTE.patch
725 %patch14 -p1
726
727 # kernel-pom-ng-mms-conntrack-nat.patch
728 %patch16 -p1
729
730 # kernel-pom-ng-rsh.patch
731 %patch22 -p1
732
733 # kernel-pom-ng-rpc.patch
734 %patch23 -p1
735
736 # kernel-nf_rtsp.patch
737 %patch36 -p1
738
739 # kernel-owner-xid.patch
740 %if %{with vserver}
741 %patch37 -p1
742 %endif
743
744 # kernel-ipt_account.patch
745 %patch38 -p1
746
747 # kernel-ipt_ACCOUNT.patch
748 %patch39 -p1
749
750 # kernel-layer7.patch
751 %patch40 -p1
752
753 # ipvs-nfct
754 %patch41 -p1
755
756 ##
757 # end of netfilter
758
759 # zph
760 %patch49 -p1
761
762 %if %{with imq}
763 %patch50 -p1
764 %endif
765
766 # reiser4
767 %if %{with reiser4}
768 %patch51 -p1
769 %endif
770
771 # esfq
772 %if %{with esfq}
773 %patch53 -p1
774 %endif
775
776 %if %{with wrr}
777 %patch52 -p1
778 %endif
779
780 # toshiba_acpi
781 %patch54 -p1
782
783 %patch55 -p1
784 %patch56 -p1
785
786 # kernel-rndis_host-wm5.patch
787 %patch59 -p1
788
789 # hostap enhancements from/for aircrack-ng
790 %patch85 -p1
791
792 # LSI MPT Fusion driver update (by LSI via SUSE folks)
793 # FIXME!
794 #%patch90 -p1
795
796 # vserver
797 %if %{with vserver}
798 %patch100 -p1
799 %patch101 -p1
800 %endif
801
802 # forcedeth
803 %patch130 -p1
804
805 # unionfs (problems with aufs2, needed for aufs1 patch)
806 %if %{without rescuecd}
807 %patch140 -p1
808 %endif
809
810 %if %{with rescuecd}
811 # aufs2
812 %patch148 -p1
813 %else
814 # aufs1
815 #patch145 -p1
816 #patch146 -p1
817 %endif
818
819 %patch2500 -p1
820
821 %if %{with rescuecd}
822 %patch7000 -p1
823 %endif
824
825 # grsecurity & pax stuff
826 #
827
828 # remember that we have the same config file for grsec_minimal and
829 # grsec_full, but the patches are different.
830
831 %if %{with grsecurity}
832 %if %{with grsec_minimal}
833 %patch1000 -p1
834 %else
835 # grsec_full and/or pax
836 %patch9999 -p1
837 %{?with_vserver:%patch10000 -p1}
838 %{?with_vserver:%patch10001 -p1}
839 %{?with_vserver:%patch10002 -p1}
840 %endif
841 %endif
842 #
843 # end of grsecurity & pax stuff
844
845 # apparmor
846 %if %{with apparmor}
847 %patch5000 -p1
848 %endif
849
850 # FIXME
851 #%patch150 -p1
852
853 %patch160 -p1
854
855 %ifarch ppc ppc64
856 #patch200 -p1
857 %endif
858
859 # routes
860 %patch300 -p1
861
862 # Small fixes:
863 %patch2000 -p1
864 %patch2001 -p1
865 #%patch2003 -p1
866
867 # Fix EXTRAVERSION in main Makefile
868 sed -i 's#EXTRAVERSION =.*#EXTRAVERSION = %{postver}%{?alt_kernel:_%{alt_kernel}}#g' Makefile
869
870 # cleanup backups after patching
871 find '(' -name '*~' -o -name '*.orig' -o -name '.gitignore' ')' -print0 | xargs -0 -r -l512 rm -f
872
873 %build
874 install -d %{objdir}
875 cat > %{targetobj}.mk <<'EOF'
876 # generated by %{name}.spec
877 KERNELSRC               := %{_builddir}/%{name}-%{version}/linux-%{basever}
878 KERNELOUTPUT    := %{objdir}
879
880 SRCARCH         := %{target_arch_dir}
881 ARCH            := %{_target_base_arch}
882 Q                       := %{!?with_verbose:@}
883 MAKE_OPTS       := %{MakeOpts}
884 DEFCONFIG   := %{defconfig}
885 EOF
886
887 PaXconfig() {
888         set -x
889         cat <<-EOCONFIG > $1
890         %ifarch %{ix86}
891                 CONFIG_PAX_SEGMEXEC=y
892                 # performance impact on CPUs without NX bit
893                 CONFIG_PAX_PAGEEXEC=n
894                 # Testing KERNEXEC
895
896                 CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM=n
897                 CONFIG_PCI_BIOS=n
898                 CONFIG_EFI=n
899         %endif
900
901         %ifarch ppc64
902                 CONFIG_PAX_NOELFRELOCS=n
903         %endif
904         %ifarch ppc
905                 CONFIG_PAX_EMUTRAMP=y
906                 CONFIG_PAX_EMUSIGRT=y
907                 CONFIG_PAX_EMUPLT=y
908         %endif
909
910         %ifarch sparc sparc64 alpha
911                 CONFIG_PAX_EMUPLT=y
912         %endif
913
914         # Now we have to check MAC system integration. Grsecurity (full) uses PAX_HAVE_ACL_FLAGS
915         # setting (direct acces). grsec_minimal probably have no idea about PaX so we probably
916         # could use PAX_NO_ACL_FLAGS, but for testing the hooks setting will be used
917         # PAX_HOOK_ACL_FLAGS.
918
919         %if %{with grsec_full}
920                 # Hardening grsec options if with pax
921                 CONFIG_GRKERNSEC_PROC_MEMMAP=y
922                 # almost rational (see HIDESYM help)
923                 CONFIG_GRKERNSEC_HIDESYM=y
924
925                 # no change needed CONFIG=PAX_HAVE_ACL_FLAGS=y is taken from the kernel-pax.config
926         %else
927                 CONFIG_PAX_HAVE_ACL_FLAGS=n
928                 CONFIG_PAX_HOOK_ACL_FLAGS=y
929         %endif
930 EOCONFIG
931
932         return 0
933 }
934
935 RescueConfig() {
936         set -x
937         cat <<-EOCONFIG > $1
938                 # CONFIG_SOUND is not set
939                 # CONFIG_AUDIT is not set
940                 # CONFIG_TR is not set
941                 # CONFIG_BT is not set
942                 # CONFIG_VIDEO_DEV is not set
943                 # CONFIG_DVB_CORE is not set
944                 # CONFIG_HAMRADIO is not set
945                 # CONFIG_ARCNET is not set
946                 # CONFIG_FB is not set
947                 # CONFIG_DRM is not set
948                 # CONFIG_WATCHDOG is not set
949                 # CONFIG_INPUT_JOYSTICK is not set
950                 # CONFIG_DEBUG_KERNEL is not set
951                 # CONFIG_ISDN is not set
952                 # CONFIG_AGP is not set
953                 # CONFIG_SECURITY is not set
954                 # CONFIG_PARIDE is not set
955                 # CONFIG_CPU_FREQ is not set
956                 # CONFIG_GAMEPORT is not set
957                 # CONFIG_KVM is not set
958                 # CONFIG_PHONE is not set
959                 # CONFIG_STRICT_DEVMEM is not set
960                 # CONFIG_IMA is not set
961                 CONFIG_AUFS=y
962                 CONFIG_AUFS_FS=y
963                 CONFIG_AUFS_BR_RAMFS=y
964                 CONFIG_AUFS_RDU=y
965                 CONFIG_BLK_DEV_LOOP=y
966                 CONFIG_ISO9660_FS=y
967                 CONFIG_NLS_UTF8=y
968 EOCONFIG
969
970         return 0
971 }
972
973 BuildConfig() {
974         %{?debug:set -x}
975         set -e
976
977         Config="kernel-%{target_arch_dir}.config"
978         echo >&2 "Building config file for %{_target_cpu} using $Config et al."
979
980         # prepare local and important options
981         cat <<-EOCONFIG > important.config
982                 LOCALVERSION="-%{localversion}"
983
984 %if 0%{?debug:1}
985                 CONFIG_DEBUG_SLAB=y
986                 CONFIG_DEBUG_SLAB_LEAK=y
987                 CONFIG_DEBUG_PREEMPT=y
988                 CONFIG_RT_DEADLOCK_DETECT=y
989 %endif
990
991 # apparmor, will be moved to external file if works
992 %if %{with apparmor}
993                 CONFIG_SECURITY_APPARMOR=y
994                 CONFIG_SECURITY_APPARMOR_BOOTPARAM_VALUE=1
995                 CONFIG_SECURITY_APPARMOR_DISABLE=n
996                 CONFIG_SECURITY_APPARMOR_NETWORK=y
997 %endif
998
999 %if %{without ipv6}
1000                 CONFIG_IPV6=n
1001 %endif
1002
1003 %ifarch i686 athlon pentium3 pentium4
1004   %if %{with pae}
1005                 CONFIG_HIGHMEM4G=n
1006                 CONFIG_HIGHMEM64G=y
1007                 CONFIG_X86_PAE=y
1008                 CONFIG_NUMA=n
1009   %endif
1010 %endif
1011
1012 %if %{without pcmcia}
1013                 CONFIG_PCMCIA=n
1014 %endif
1015
1016 %if %{with fbcondecor}
1017                 CONFIG_FB_S3=n
1018                 CONFIG_FB_VT8623=n
1019                 CONFIG_FB_ARK=n
1020                 CONFIG_FB_TILEBLITTING=n
1021                 CONFIG_FB_CON_DECOR=y
1022 %endif
1023
1024 %if %{with nfsroot}
1025                 CONFIG_NFS_FS=y
1026                 CONFIG_ROOT_NFS=y
1027 %endif
1028
1029 # Temporary disabled RELOCATABLE. Needed only on x86??
1030 %if %{with pax} || %{with grsec_full}
1031                 CONFIG_RELOCATABLE=n
1032 %endif
1033 EOCONFIG
1034
1035 %if %{with rescuecd}
1036         RescueConfig rescue.config
1037 %endif
1038 %if %{with pax}
1039         PaXconfig pax.config
1040 %endif
1041
1042         # prepare kernel-style config file from multiple config files
1043         %{__awk} -v arch="all %{target_arch_dir} %{_target_base_arch} %{_target_cpu}" -f %{SOURCE6} \
1044 %if %{with myown}
1045                 $RPM_SOURCE_DIR/kernel-%{alt_kernel}.config \
1046 %endif
1047                 important.config \
1048 %if %{with rescuecd}
1049                 %{SOURCE58} \
1050                 %{SOURCE59} \
1051                 rescue.config \
1052 %endif
1053                 \
1054 %if %{with pax}
1055                 %{SOURCE45} \
1056                 %{SOURCE49} \
1057                 pax.config \
1058 %else
1059   %if %{with grsec_full}
1060                 %{SOURCE45} \
1061                 %{SOURCE50} \
1062   %else
1063         %if %{with grsec_minimal}
1064                 %{SOURCE51} \
1065         %endif
1066   %endif
1067 %endif
1068                 \
1069 %if %{with reiser4}
1070                 %{SOURCE56} \
1071 %endif
1072 %if %{with wrr}
1073                 %{SOURCE57} \
1074 %endif
1075 %if %{with imq}
1076                 %{SOURCE55} \
1077 %endif
1078 %if %{with vserver}
1079                 %{SOURCE43} \
1080 %endif
1081 %if %{with tuxonice}
1082 %ifarch %{ix86} %{x8664} ia64 ppc ppc64
1083                 %{SOURCE42} \
1084 %endif
1085 %endif
1086                 %{SOURCE40} %{?0:netfilter} \
1087                 %{SOURCE41} %{?0:patches} \
1088                 %{SOURCE20} \
1089                 $RPM_SOURCE_DIR/$Config
1090 }
1091
1092 cd %{objdir}
1093 install -d arch/%{target_arch_dir}
1094 BuildConfig > %{defconfig}
1095 ln -sf %{defconfig} .config
1096 cd -
1097
1098 %{__make} \
1099         TARGETOBJ=%{targetobj} \
1100         %{?with_verbose:V=1} \
1101         oldconfig
1102
1103 %{__awk} %{?debug:-v dieOnError=1} -v infile=%{objdir}/%{defconfig} -f %{SOURCE8} %{objdir}/.config
1104
1105 # build kernel
1106 %{__make} \
1107         TARGETOBJ=%{targetobj} \
1108         %{?with_verbose:V=1} \
1109         all
1110
1111 %install
1112 rm -rf $RPM_BUILD_ROOT
1113 %{__make} %{MakeOpts} %{!?with_verbose:-s} modules_install firmware_install \
1114         -C %{objdir} \
1115         %{?with_verbose:V=1} \
1116         DEPMOD=%{DepMod} \
1117         INSTALL_MOD_PATH=$RPM_BUILD_ROOT \
1118         INSTALL_FW_PATH=$RPM_BUILD_ROOT/lib/firmware/%{kernel_release} \
1119         KERNELRELEASE=%{kernel_release}
1120
1121 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/misc
1122
1123 # create directories which may be missing, to simplyfy %files
1124 install -d $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/kernel/{arch,sound,mm}
1125
1126 # rpm obeys filelinkto checks for ghosted symlinks, convert to files
1127 rm -f $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1128 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/{build,source}
1129
1130 # no point embed content for %ghost files. empty them
1131 for a in \
1132         dep{,.bin} \
1133         alias{,.bin} \
1134         symbols{,.bin} \
1135         {pci,usb,ccw,isapnp,input,ieee1394,serio,of}map \
1136 ; do
1137         > $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.$a
1138 done
1139
1140 # /boot
1141 install -d $RPM_BUILD_ROOT/boot
1142 cp -a %{objdir}/System.map $RPM_BUILD_ROOT/boot/System.map-%{kernel_release}
1143 %ifarch %{ix86} %{x8664}
1144 cp -a %{objdir}/arch/%{target_arch_dir}/boot/bzImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1145 install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
1146 %endif
1147 %ifarch ppc ppc64
1148 install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1149 install -p %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinux-%{kernel_release}
1150 %endif
1151 %ifarch ia64
1152 %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
1153 cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/efi/vmlinuz-%{kernel_release}
1154 ln -sf efi/vmlinuz-%{kernel_release} $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1155 %endif
1156 %ifarch alpha sparc sparc64
1157         %{__gzip} -cfv %{objdir}/vmlinux > %{objdir}/vmlinuz
1158         cp -a %{objdir}/vmlinuz $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1159         install %{objdir}/vmlinux $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1160 %ifarch sparc
1161         elftoaout %{objdir}/arch/sparc/boot/image -o %{objdir}/vmlinux.aout
1162         install %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
1163 %endif
1164 %ifarch sparc64
1165         elftoaout %{objdir}/arch/sparc64/boot/image -o %{objdir}/vmlinux.aout
1166         install %{objdir}/vmlinux.aout $RPM_BUILD_ROOT/boot/vmlinux.aout-%{kernel_release}
1167 %endif
1168 %ifarch arm
1169         install %{objdir}/arch/arm/boot/zImage $RPM_BUILD_ROOT/boot/vmlinuz-%{kernel_release}
1170 %endif
1171 %endif
1172
1173 # ghosted initrd
1174 touch $RPM_BUILD_ROOT%{initrd_dir}/initrd-%{kernel_release}.gz
1175
1176 %if "%{_target_base_arch}" != "%{_arch}"
1177 touch $RPM_BUILD_ROOT/lib/modules/%{kernel_release}/modules.dep
1178 %endif
1179
1180 # /etc/modrobe.d
1181 install -d $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{kernel_release}
1182
1183 # /usr/src/linux
1184 install -d $RPM_BUILD_ROOT%{_kernelsrcdir}
1185 # test if we can hardlink -- %{_builddir} and $RPM_BUILD_ROOT on same partition
1186 if cp -al %{srcdir}/COPYING $RPM_BUILD_ROOT/COPYING 2>/dev/null; then
1187         l=l
1188         rm -f $RPM_BUILD_ROOT/COPYING
1189 fi
1190
1191 cp -a$l %{srcdir}/* $RPM_BUILD_ROOT%{_kernelsrcdir}
1192 cp -a %{objdir}/Module.symvers $RPM_BUILD_ROOT%{_kernelsrcdir}/Module.symvers-dist
1193 cp -aL %{objdir}/.config $RPM_BUILD_ROOT%{_kernelsrcdir}/config-dist
1194 cp -a %{objdir}/include/linux/autoconf.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf-dist.h
1195 cp -a %{objdir}/include/linux/{utsrelease,version}.h $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux
1196 cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/autoconf.h
1197 cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_kernelsrcdir}/include/linux/config.h
1198
1199 # collect module-build files and directories
1200 # Usage: kernel-module-build.pl $rpmdir $fileoutdir
1201 fileoutdir=$(pwd)
1202 cd $RPM_BUILD_ROOT%{_kernelsrcdir}
1203 %{__perl} %{topdir}/kernel-module-build.pl %{_kernelsrcdir} $fileoutdir
1204 cd -
1205
1206 # move to %{_docdir} so we wouldn't depend on any kernel package for dirs
1207 install -d $RPM_BUILD_ROOT%{_docdir}
1208 mv $RPM_BUILD_ROOT{%{_kernelsrcdir}/Documentation,%{_docdir}/%{name}-%{version}}
1209
1210 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/dontdiff
1211 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/Makefile
1212 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/Makefile
1213 rm -f $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/*/*/Makefile
1214
1215 %clean
1216 rm -rf $RPM_BUILD_ROOT
1217
1218 %preun
1219 if [ -x /sbin/new-kernel-pkg ]; then
1220         /sbin/new-kernel-pkg --remove %{kernel_release}
1221 fi
1222
1223 %post
1224 %ifarch ia64
1225 mv -f /boot/efi/vmlinuz{,.old} 2> /dev/null
1226 %{?alt_kernel:mv -f /boot/efi/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1227 ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz
1228 %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/efi/vmlinuz%{_alt_kernel}}
1229 %endif
1230 mv -f /boot/vmlinuz{,.old} 2> /dev/null
1231 %{?alt_kernel:mv -f /boot/vmlinuz%{_alt_kernel}{,.old} 2> /dev/null}
1232 mv -f /boot/System.map{,.old} 2> /dev/null
1233 %{?alt_kernel:mv -f /boot/System%{_alt_kernel}.map{,.old} 2> /dev/null}
1234 ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz
1235 %{?alt_kernel:ln -sf vmlinuz-%{kernel_release} /boot/vmlinuz%{_alt_kernel}}
1236 ln -sf System.map-%{kernel_release} /boot/System.map
1237 %{?alt_kernel:ln -sf System.map-%{kernel_release} /boot/System.map%{_alt_kernel}}
1238
1239 %depmod %{kernel_release}
1240
1241 /sbin/geninitrd -f --initrdfs=rom %{initrd_dir}/initrd-%{kernel_release}.gz %{kernel_release}
1242 mv -f %{initrd_dir}/initrd{,.old} 2> /dev/null
1243 %{?alt_kernel:mv -f %{initrd_dir}/initrd%{_alt_kernel}{,.old} 2> /dev/null}
1244 ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd
1245 %{?alt_kernel:ln -sf initrd-%{kernel_release}.gz %{initrd_dir}/initrd%{_alt_kernel}}
1246
1247 if [ -x /sbin/update-grub ]; then
1248         /sbin/update-grub >/dev/null 2>&1
1249 fi
1250 if [ -x /sbin/new-kernel-pkg ]; then
1251         /sbin/new-kernel-pkg --initrdfile=%{initrd_dir}/initrd-%{kernel_release}.gz --install %{kernel_release} --banner "PLD Linux (%{pld_release})%{?alt_kernel: / %{alt_kernel}}"
1252 fi
1253 if [ -x /sbin/rc-boot ]; then
1254         /sbin/rc-boot 1>&2 || :
1255 fi
1256
1257 %post vmlinux
1258 mv -f /boot/vmlinux{,.old} 2> /dev/null
1259 %{?alt_kernel:mv -f /boot/vmlinux-%{alt_kernel}{,.old} 2> /dev/null}
1260 ln -sf vmlinux-%{kernel_release} /boot/vmlinux
1261 %{?alt_kernel:ln -sf vmlinux-%{kernel_release} /boot/vmlinux-%{alt_kernel}}
1262
1263 %post drm
1264 %depmod %{kernel_release}
1265
1266 %postun drm
1267 %depmod %{kernel_release}
1268
1269 %post pcmcia
1270 %depmod %{kernel_release}
1271
1272 %postun pcmcia
1273 %depmod %{kernel_release}
1274
1275 %post sound-alsa
1276 %depmod %{kernel_release}
1277
1278 %postun sound-alsa
1279 %depmod %{kernel_release}
1280
1281 %post sound-oss
1282 %depmod %{kernel_release}
1283
1284 %postun sound-oss
1285 %depmod %{kernel_release}
1286
1287 %post headers
1288 ln -snf %{basename:%{_kernelsrcdir}} %{_prefix}/src/linux%{_alt_kernel}
1289
1290 %postun headers
1291 if [ "$1" = "0" ]; then
1292         if [ -L %{_prefix}/src/linux%{_alt_kernel} ]; then
1293                 if [ "$(readlink %{_prefix}/src/linux%{_alt_kernel})" = "linux%{_alt_kernel}-%{version}" ]; then
1294                         rm -f %{_prefix}/src/linux%{_alt_kernel}
1295                 fi
1296         fi
1297 fi
1298
1299 %triggerin module-build -- %{name} = %{epoch}:%{version}-%{release}
1300 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/build
1301 ln -sfn %{_kernelsrcdir} /lib/modules/%{kernel_release}/source
1302
1303 %triggerun module-build -- %{name} = %{epoch}:%{version}-%{release}
1304 if [ "$1" = 0 ]; then
1305         rm -f /lib/modules/%{kernel_release}/{build,source}
1306 fi
1307
1308 %files
1309 %defattr(644,root,root,755)
1310 %ifarch sparc sparc64
1311 /boot/vmlinux.aout-%{kernel_release}
1312 %endif
1313 %ifarch ia64
1314 /boot/efi/vmlinuz-%{kernel_release}
1315 %endif
1316 /boot/vmlinuz-%{kernel_release}
1317 /boot/System.map-%{kernel_release}
1318 %ghost %{initrd_dir}/initrd-%{kernel_release}.gz
1319 /lib/firmware/%{kernel_release}
1320
1321 %dir /lib/modules/%{kernel_release}
1322 %dir /lib/modules/%{kernel_release}/kernel
1323 /lib/modules/%{kernel_release}/kernel/arch
1324 /lib/modules/%{kernel_release}/kernel/crypto
1325 /lib/modules/%{kernel_release}/kernel/drivers
1326 %if %{have_drm}
1327 %exclude /lib/modules/%{kernel_release}/kernel/drivers/gpu
1328 %endif
1329 /lib/modules/%{kernel_release}/kernel/fs
1330 /lib/modules/%{kernel_release}/kernel/kernel
1331 /lib/modules/%{kernel_release}/kernel/lib
1332 /lib/modules/%{kernel_release}/kernel/net
1333 /lib/modules/%{kernel_release}/kernel/mm
1334 %if %{have_sound}
1335 %dir /lib/modules/%{kernel_release}/kernel/sound
1336 /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1337 /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1338 %ifnarch sparc
1339 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1340 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1341 %exclude /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1342 %endif
1343 %endif
1344 %dir /lib/modules/%{kernel_release}/misc
1345 %if %{have_pcmcia}
1346 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/[!p]*
1347 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pd6729.ko*
1348 %exclude /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1349 %if %{without rescuecd}
1350 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1351 %exclude /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1352 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1353 %exclude /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1354 %exclude /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1355 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1356 %endif
1357 %exclude /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
1358 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1359 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1360 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1361 %exclude /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1362 %exclude /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1363 %exclude /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1364 %exclude /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1365 %endif
1366 %if %{with myown}
1367 /lib/modules/%{kernel_release}/kernel/sound
1368 %endif
1369
1370 %dir %{_sysconfdir}/modprobe.d/%{kernel_release}
1371
1372 # provided by build
1373 /lib/modules/%{kernel_release}/modules.order
1374
1375 # rest modules.* are ghost (regenerated by post depmod -a invocation)
1376 %ghost /lib/modules/%{kernel_release}/modules.alias
1377 %ghost /lib/modules/%{kernel_release}/modules.alias.bin
1378 %ghost /lib/modules/%{kernel_release}/modules.ccwmap
1379 %ghost /lib/modules/%{kernel_release}/modules.dep
1380 %ghost /lib/modules/%{kernel_release}/modules.dep.bin
1381 %ghost /lib/modules/%{kernel_release}/modules.ieee1394map
1382 %ghost /lib/modules/%{kernel_release}/modules.inputmap
1383 %ghost /lib/modules/%{kernel_release}/modules.isapnpmap
1384 %ghost /lib/modules/%{kernel_release}/modules.ofmap
1385 %ghost /lib/modules/%{kernel_release}/modules.pcimap
1386 %ghost /lib/modules/%{kernel_release}/modules.seriomap
1387 %ghost /lib/modules/%{kernel_release}/modules.symbols
1388 %ghost /lib/modules/%{kernel_release}/modules.symbols.bin
1389 %ghost /lib/modules/%{kernel_release}/modules.usbmap
1390
1391 # symlinks pointing to kernelsrcdir
1392 %ghost /lib/modules/%{kernel_release}/build
1393 %ghost /lib/modules/%{kernel_release}/source
1394
1395 %ifarch alpha %{ix86} %{x8664} ppc ppc64 sparc sparc64
1396 %files vmlinux
1397 %defattr(644,root,root,755)
1398 /boot/vmlinux-%{kernel_release}
1399 %endif
1400
1401 %if %{have_drm}
1402 %files drm
1403 %defattr(644,root,root,755)
1404 /lib/modules/%{kernel_release}/kernel/drivers/gpu
1405 %endif
1406
1407 %if %{have_pcmcia}
1408 %files pcmcia
1409 %defattr(644,root,root,755)
1410 /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/*ko*
1411 /lib/modules/%{kernel_release}/kernel/drivers/*/pcmcia
1412 %exclude /lib/modules/%{kernel_release}/kernel/drivers/pcmcia/pcmcia*ko*
1413 %if %{without rescuecd}
1414 /lib/modules/%{kernel_release}/kernel/drivers/bluetooth/*_cs.ko*
1415 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/avm_cs.ko*
1416 /lib/modules/%{kernel_release}/kernel/drivers/isdn/hardware/avm/b1pcmcia.ko*
1417 /lib/modules/%{kernel_release}/kernel/drivers/telephony/ixj_pcmcia.ko*
1418 %endif
1419 /lib/modules/%{kernel_release}/kernel/drivers/ata/pata_pcmcia.ko*
1420 /lib/modules/%{kernel_release}/kernel/drivers/ide/ide-cs.ko*
1421 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/*_cs.ko*
1422 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/b43
1423 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/hostap/hostap_cs.ko*
1424 /lib/modules/%{kernel_release}/kernel/drivers/net/wireless/libertas/*_cs.ko*
1425 /lib/modules/%{kernel_release}/kernel/drivers/parport/parport_cs.ko*
1426 /lib/modules/%{kernel_release}/kernel/drivers/serial/serial_cs.ko*
1427 /lib/modules/%{kernel_release}/kernel/drivers/usb/host/sl811_cs.ko*
1428 %endif
1429
1430 %if %{have_sound}
1431 %files sound-alsa
1432 %defattr(644,root,root,755)
1433 /lib/modules/%{kernel_release}/kernel/sound
1434 %exclude %dir /lib/modules/%{kernel_release}/kernel/sound
1435 %exclude /lib/modules/%{kernel_release}/kernel/sound/ac97_bus.ko*
1436 %exclude /lib/modules/%{kernel_release}/kernel/sound/sound*.ko*
1437 %if %{have_oss}
1438 %exclude /lib/modules/%{kernel_release}/kernel/sound/oss
1439 %endif
1440 %ifnarch sparc
1441 /lib/modules/%{kernel_release}/kernel/drivers/usb/gadget/g_midi.ko*
1442 /lib/modules/%{kernel_release}/kernel/drivers/media/video/cx88/cx88-alsa.ko*
1443 /lib/modules/%{kernel_release}/kernel/drivers/media/video/em28xx/em28xx-alsa.ko*
1444 /lib/modules/%{kernel_release}/kernel/drivers/media/video/saa7134/saa7134-alsa.ko*
1445 %endif
1446
1447 %if %{have_oss}
1448 %files sound-oss
1449 %defattr(644,root,root,755)
1450 /lib/modules/%{kernel_release}/kernel/sound/oss
1451 %endif
1452 %endif
1453
1454 %files headers -f files.headers_exclude_kbuild
1455 %defattr(644,root,root,755)
1456 %dir %{_kernelsrcdir}
1457 %{_kernelsrcdir}/include
1458 %dir %{_kernelsrcdir}/arch
1459 %dir %{_kernelsrcdir}/arch/[!K]*
1460 %{_kernelsrcdir}/arch/*/include
1461 %dir %{_kernelsrcdir}/security
1462 %dir %{_kernelsrcdir}/security/selinux
1463 %{_kernelsrcdir}/security/selinux/include
1464 %{_kernelsrcdir}/config-dist
1465 %{_kernelsrcdir}/Module.symvers-dist
1466
1467 %files module-build -f files.mb_include_modulebuild_and_dirs
1468 %defattr(644,root,root,755)
1469 %ifarch ppc ppc64
1470 %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
1471 %endif
1472 %exclude %dir %{_kernelsrcdir}/arch/m68knommu
1473 %exclude %dir %{_kernelsrcdir}/arch/um
1474 %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1475 %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1476 %{_kernelsrcdir}/drivers/lguest/lg.h
1477 %{_kernelsrcdir}/kernel/bounds.c
1478 %dir %{_kernelsrcdir}/scripts
1479 %{_kernelsrcdir}/scripts/Kbuild.include
1480 %{_kernelsrcdir}/scripts/Makefile*
1481 %{_kernelsrcdir}/scripts/basic
1482 %{_kernelsrcdir}/scripts/kconfig
1483 %{_kernelsrcdir}/scripts/mkcompile_h
1484 %{_kernelsrcdir}/scripts/mkmakefile
1485 %{_kernelsrcdir}/scripts/mod
1486 %{_kernelsrcdir}/scripts/module-common.lds
1487 %{_kernelsrcdir}/scripts/setlocalversion
1488 %{_kernelsrcdir}/scripts/*.c
1489 %{_kernelsrcdir}/scripts/*.sh
1490 %dir %{_kernelsrcdir}/scripts/selinux
1491 %{_kernelsrcdir}/scripts/selinux/Makefile
1492 %dir %{_kernelsrcdir}/scripts/selinux/mdp
1493 %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
1494 %{_kernelsrcdir}/scripts/selinux/mdp/*.c
1495 %exclude %dir %{_kernelsrcdir}/security
1496 %exclude %dir %{_kernelsrcdir}/security/selinux
1497
1498 %if %{with doc}
1499 %files doc
1500 %defattr(644,root,root,755)
1501 %dir %{_docdir}/%{name}-%{version}
1502
1503 %{_docdir}/%{name}-%{version}/[!jkz]*
1504 %{_docdir}/%{name}-%{version}/[jkz]*.txt
1505 %{_docdir}/%{name}-%{version}/kbuild
1506 %{_docdir}/%{name}-%{version}/kdump
1507 %{_docdir}/%{name}-%{version}/kvm
1508 %lang(ja) %{_docdir}/%{name}-%{version}/ja_JP
1509 %lang(ko) %{_docdir}/%{name}-%{version}/ko_KR
1510 %lang(zh_CN) %{_docdir}/%{name}-%{version}/zh_CN
1511 %endif
1512
1513 %if %{with source}
1514 %files source -f files.source_exclude_modulebuild_and_dirs
1515 %defattr(644,root,root,755)
1516 %{_kernelsrcdir}/arch/*/[!Mik]*
1517 %{_kernelsrcdir}/arch/*/kernel/[!M]*
1518 %{_kernelsrcdir}/arch/ia64/ia32/[!M]*
1519 %{_kernelsrcdir}/arch/ia64/install.sh
1520 %{_kernelsrcdir}/arch/m68k/ifpsp060/[!M]*
1521 %{_kernelsrcdir}/arch/m68k/ifpsp060/MISC
1522 %{_kernelsrcdir}/arch/m68k/install.sh
1523 %{_kernelsrcdir}/arch/parisc/install.sh
1524 %{_kernelsrcdir}/arch/x86/ia32/[!M]*
1525 %{_kernelsrcdir}/arch/ia64/kvm
1526 %{_kernelsrcdir}/arch/powerpc/kvm
1527 %ifarch ppc ppc64
1528 %exclude %{_kernelsrcdir}/arch/powerpc/lib/crtsavres.*
1529 %endif
1530 %{_kernelsrcdir}/arch/s390/kvm
1531 %{_kernelsrcdir}/arch/x86/kvm
1532 %exclude %{_kernelsrcdir}/arch/*/kernel/asm-offsets*
1533 %exclude %{_kernelsrcdir}/arch/*/kernel/sigframe*.h
1534 %exclude %{_kernelsrcdir}/drivers/lguest/lg.h
1535 %{_kernelsrcdir}/block
1536 %{_kernelsrcdir}/crypto
1537 %{_kernelsrcdir}/drivers
1538 %{_kernelsrcdir}/firmware
1539 %{_kernelsrcdir}/fs
1540 %if %{with grsecurity} && %{without rescuecd}
1541 %{_kernelsrcdir}/grsecurity
1542 %endif
1543 %{_kernelsrcdir}/init
1544 %{_kernelsrcdir}/ipc
1545 %{_kernelsrcdir}/kernel
1546 %exclude %{_kernelsrcdir}/kernel/bounds.c
1547 %{_kernelsrcdir}/lib
1548 %{_kernelsrcdir}/mm
1549 %{_kernelsrcdir}/net
1550 %{_kernelsrcdir}/virt
1551 %{_kernelsrcdir}/samples
1552 %{_kernelsrcdir}/scripts/*
1553 %exclude %{_kernelsrcdir}/scripts/Kbuild.include
1554 %exclude %{_kernelsrcdir}/scripts/Makefile*
1555 %exclude %{_kernelsrcdir}/scripts/basic
1556 %exclude %{_kernelsrcdir}/scripts/kconfig
1557 %exclude %{_kernelsrcdir}/scripts/mkcompile_h
1558 %exclude %{_kernelsrcdir}/scripts/mkmakefile
1559 %exclude %{_kernelsrcdir}/scripts/mod
1560 %exclude %{_kernelsrcdir}/scripts/module-common.lds
1561 %exclude %{_kernelsrcdir}/scripts/setlocalversion
1562 %exclude %{_kernelsrcdir}/scripts/*.c
1563 %exclude %{_kernelsrcdir}/scripts/*.sh
1564 %exclude %dir %{_kernelsrcdir}/scripts/selinux
1565 %exclude %{_kernelsrcdir}/scripts/selinux/Makefile
1566 %exclude %dir %{_kernelsrcdir}/scripts/selinux/mdp
1567 %exclude %{_kernelsrcdir}/scripts/selinux/mdp/Makefile
1568 %exclude %{_kernelsrcdir}/scripts/selinux/mdp/*.c
1569 %{_kernelsrcdir}/sound
1570 %{_kernelsrcdir}/security
1571 %exclude %{_kernelsrcdir}/security/selinux/include
1572 %{_kernelsrcdir}/tools
1573 %{_kernelsrcdir}/usr
1574 %{_kernelsrcdir}/COPYING
1575 %{_kernelsrcdir}/CREDITS
1576 %{_kernelsrcdir}/MAINTAINERS
1577 %{_kernelsrcdir}/README
1578 %{_kernelsrcdir}/REPORTING-BUGS
1579 %endif
This page took 0.136557 seconds and 4 git commands to generate.