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