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