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