]> git.pld-linux.org Git - packages/kernel.git/blob - kernel.spec
- added CONFIG_PDC202XXX_FORCE, for new ide drivers
[packages/kernel.git] / kernel.spec
1 %define         ow_version              2.2.20-ow1
2 %define         pcmcia_version          3.1.30
3 %define         freeswan_version        1.8
4 %define         reiserfs_version        3.5.34
5 %define         i2c_version             2.6.2
6 %define         bttv_version            0.7.87
7 %define         wlan_version            0.3.4
8 %define         tun_version             1.1
9 %define         vlan_version            1.0.1
10 %define         aic7xxx_version         6.2.3-2.2.19
11 %define         symncr_version          1.7.3c-ncr-3.4.3b
12 %define         jfs_version             1.0.5
13 Summary:        The Linux kernel (the core of the Linux operating system)
14 Summary(de):    Der Linux-Kernel (Kern des Linux-Betriebssystems)
15 Summary(fr):    Le Kernel-Linux (La partie centrale du systeme)
16 Summary(pl):    J±dro Linuksa
17 Name:           kernel
18 Version:        2.2.20
19 Release:        6
20 License:        GPL
21 Group:          Base/Kernel
22 Group(de):      Grundsätzlich/Kern
23 Group(pl):      Podstawowe/J±dro
24
25 # in this place i will include Sources
26
27 Source0:        ftp://ftp.kernel.org/pub/linux/kernel/v2.2/linux-%{version}.tar.bz2
28 Source1:        %{name}-autoconf.h
29 Source2:        %{name}-BuildASM.sh
30 Source3:        ftp://ftp.openwall.com/linux/linux-%{ow_version}.tar.gz
31 Source4:        http://www.garloff.de/kurt/linux/dc395/dc395-133.tar.gz
32 Source5:        ftp://ftp.sourceforge.net/pub/sourceforge/pcmcia-cs/pcmcia-cs-%{pcmcia_version}.tar.gz
33 Source6:        ftp://ftp.tux.org/tux/roudier/drivers/linux/stable/sym-%{symncr_version}.tar.gz
34 Source7:        ftp://ftp.linux-wlan.com/linux-wlan/linux-wlan-%{wlan_version}.tar.gz
35 Source8:        http://www.dandelion.com/Linux/DAC960-2.2.10.tar.gz
36 Source9:        serial-5.05.tar.gz
37 Source10:       http://vtun.sourceforge.net/tun/tun-%{tun_version}.tar.gz
38 Source11:       http://scry.wanfear.com/~greear/vlan/vlan.%{vlan_version}.tar.gz
39 Source12:       http://www10.software.ibm.com/developer/opensource/jfs/project/pub/jfs-2.2-%{jfs_version}-patch.tar.gz
40 Source13:       %{name}-i386.config
41 Source14:       %{name}-i386-smp.config
42 Source15:       %{name}-i386-BOOT.config
43 Source16:       %{name}-i586.config
44 Source17:       %{name}-i586-smp.config
45 Source18:       %{name}-i686.config
46 Source19:       %{name}-i686-smp.config
47 Source20:       %{name}-sparc.config
48 Source21:       %{name}-sparc-smp.config
49 Source22:       %{name}-sparc-BOOT.config
50 Source23:       %{name}-sparc64.config
51 Source24:       %{name}-sparc64-smp.config
52 Source25:       %{name}-sparc64-BOOT.config
53 Source26:       %{name}-alpha.config
54 Source27:       %{name}-alpha-smp.config
55 Source28:       %{name}-alpha-BOOT.config
56 Source50:       http://www.netroedge.com/~lm78/archive/i2c-%{i2c_version}.tar.gz
57 Source51:       http://www.strusel007.de/linux/bttv/bttv-%{bttv_version}.tar.gz
58
59 # in this place i will include Patches
60
61 Patch0:         %{name}-pldfblogo.patch
62 Patch1:         pcmcia-cs-%{pcmcia_version}-smp-compilation-fix.patch
63 Patch2:         http://people.freebsd.org/~gibbs/linux/linux-aic7xxx-%{aic7xxx_version}.patch.gz
64 Patch3:         ftp://ftp.reiserfs.org/pub/reiserfs-for-2.2/linux-2.2.19-reiserfs-%{reiserfs_version}-patch.bz2
65 Patch4:         ftp://ftp.kernel.org/pub/linux/kernel/crypto/v2.2/patch-int-2.2.18.3.gz
66 Patch5:         linux-2.2.18-freeswan-%{freeswan_version}.patch
67 Patch6:         wanrouter-v2215.patch.gz
68 Patch7:         linux-ipv6-addrconf.patch
69 # based on http://support.3com.com/infodeli/tools/nic/linux/3c90x-1.0.0i.tar.gz
70 Patch8:         %{name}-3c90x.patch
71 Patch9:         linux-ipv6-glibc2.2.patch
72 # based on http://bridge.sourceforge.net/patches/bridge-1.0.1-against-2.2.20.diff
73 # but diffrent
74 Patch10:        bridge-1.0.1-against-2.2.20.diff
75
76 Patch20:        http://download.sourceforge.net/linux1394/ieee1394-2.2.19-20010527.gz
77 Patch21:        linux-tasks.patch
78 Patch22:        %{name}-ipvs-1.0.8-2.2.19.patch
79 Patch23:        linux-raw.patch
80 Patch24:        %{name}-panaview_kbd.patch
81 Patch25:        linux-2.2.19-pci.patch
82 Patch26:        %{name}-sysctl-ipv6.patch
83 Patch27:        %{name}-udf.patch
84
85 # based on      http://people.redhat.com/mingo/raid-patches/raid-2.2.20-A0
86 Patch30:        raid-2.2.20-A0.patch.bz2
87 # based on      ftp://ftp.kernel.org/pub/linux/kernel/people/hedrick/ide-2.2.19/ide.2.2.19.05042001.patch.bz2
88 Patch31:        ide.2.2.21.05042001-Ole.patch.gz
89 Patch32:        linux-2.2.18-atm-0.59-fore200e-0.1f.patch.gz
90
91 Patch40:        %{name}-flip.patch
92 Patch41:        %{name}-flip-serial5.05.patch
93 Patch42:        %{name}-serial-initialisation.patch
94
95 # in this place will be PLD patches
96
97 Patch100:       bridge-include.patch
98 Patch101:       bridge-netsyms.patch
99 Patch102:       %{name}-ipsec-bridge.patch
100
101 Patch104:       jfs-2.2.20-v%{jfs_version}-patch
102 Patch105:       %{name}-wanrouter-bridge.patch
103 Patch106:       linux-netdrivers_vlan.patch
104 Patch107:       linux-atm.patch
105 Patch108:       atm-unresolved.patch
106 Patch109:       af-unresolved.patch
107 Patch110:       linux-2.2.20-pcmcia-without-iee1394.patch.bz2
108 # based on ftp://ftp.kernel.org/people/andrea/kernels/v2.2/2.2.20pre9aa2/40_lfs-2.2.20pre9aa2-27.bz2
109 #Patch111:       linux-2.2.20-lfs.patch
110 Patch112:       %{name}-scripts-include-dir.patch
111 Patch120:       bttv-makefile.patch
112 Patch121:       tulip-patch-0.91.patch.bz2
113 Patch122:       bttv-symbols.patch.bz2
114 Patch123:       bridge-module_build.patch.bz2
115
116 # HTB from http://luxik.cdi.cz/~devik/qos/htb/
117 Patch200:       htb2_2.2.17.diff
118
119 Patch300:       ftp://ftp.kernel.org/pub/linux/kernel/people/alan/v2.2/2.2.21pre/patch-2.2.21-pre2.bz2
120 Patch320:       fix-prename.patch
121 Patch321:       ow1-fix-2.2.21-pre1.patch
122
123 ExclusiveOS:    Linux
124 URL:            http://www.kernel.org/
125 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
126 %ifarch sparc64
127 BuildRequires:  egcs64
128 %else
129 BuildRequires:  egcs
130 %endif
131 %ifarch sparc
132 BuildRequires:  sparc32
133 %endif
134 Provides:       %{name}-up = %{version}
135 %ifarch %{x86}
136 Provides:       %{name}(reiserfs) = %{version}
137 Provides:       %{name}(i2c) = %{i2c_version}
138 %endif
139 Provides:       %{name}(ipvs) = %{version}
140 Provides:       %{name}(rawio) = %{version}
141 Autoreqprov:    no
142 Prereq:         modutils
143 Prereq:         fileutils
144 Prereq:         geninitrd
145 #Prereq:                rc-boot
146 Obsoletes:      kernel-modules
147 ExclusiveArch:  %{ix86} sparc sparc64 alpha
148 %ifarch         %{ix86}
149 BuildRequires:  bin86
150 BuildRequires:  autoconf
151 BuildRequires:  automake
152 %endif
153
154 %description
155 This package contains the Linux kernel that is used to boot and run
156 your system. It contains few device drivers for specific hardware.
157 Most hardware is instead supported by modules loaded after booting.
158
159 %description -l de
160 Das Kernel-Paket enthält den Linux-Kernel (vmlinuz), den Kern des
161 Linux-Betriebssystems. Der Kernel ist für grundliegende
162 Systemfunktionen verantwortlich: Speicherreservierung,
163 Prozeß-Management, Geräte Ein- und Ausgaben, usw.
164
165 %description -l fr
166 Le package kernel contient le kernel linux (vmlinuz), la partie
167 centrale d'un système d'exploitation Linux. Le noyau traite les
168 fonctions basiques d'un système d'exploitation: allocation mémoire,
169 allocation de process, entrée/sortie de peripheriques, etc.
170
171 %description -l pl
172 Pakiet zawiera j±dro Linuxa niezbêdne do prawid³owego dzia³ania
173 Twojego komputera.
174
175 %package smp
176 Summary:        Kernel version %{version} compiled for SMP machines
177 Summary(de):    Kernel version %{version} für Multiprozessor-Maschinen
178 Summary(fr):    Kernel version %{version} compiler pour les machine Multi-Processeur
179 Group:          Base/Kernel
180 Group(de):      Grundsätzlich/Kern
181 Group(pl):      Podstawowe/J±dro
182 Provides:       %{name} = %{version}
183 %ifarch %{x86}
184 Provides:       %{name}(reiserfs) = %{version}
185 %endif
186 Provides:       %{name}(ipvs) = %{version}
187 Provides:       %{name}(rawio) = %{version}
188 Prereq:         modutils
189 Prereq:         fileutils
190 Prereq:         geninitrd
191 #Prereq:                rc-boot
192 Autoreqprov:    no
193
194 %description smp
195 This package includes a SMP version of the Linux %{version} kernel. It
196 is required only on machines with two or more CPUs, although it should
197 work fine on single-CPU boxes.
198
199 %description -l fr smp
200 Ce package inclu une version SMP du noyau de Linux version {version}.
201 Il et nécessaire seulement pour les machine avec deux processeurs ou
202 plus, il peut quand même fonctionner pour les système mono-processeur.
203
204 %description -l de smp
205 Dieses Paket enthält eine SMP (Multiprozessor)-Version von
206 Linux-Kernel %{version}. Es wird für Maschinen mit zwei oder mehr
207 Prozessoren gebraucht, sollte aber auch auf Computern mit nur einer
208 CPU laufen.
209
210 %package fb
211 Summary:        Kernel version %{version} with framebuffer support
212 Summary(de):    Kernel version %{version} mit Framebuffer-Support
213 Summary(fr):    Kernel version %{version} avec framebuffer
214 Group:          Base/Kernel
215 Group(de):      Grundsätzlich/Kern
216 Group(pl):      Podstawowe/J±dro
217 Provides:       %{name} = %{version}
218 %ifarch %{x86}
219 Provides:       %{name}(reiserfs) = %{version}
220 %endif
221 Provides:       %{name}(ipvs) = %{version}
222 Provides:       %{name}(rawio) = %{version}
223 Prereq:         modutils
224 Prereq:         fileutils
225 Prereq:         geninitrd
226 #Prereq:                rc-boot
227 Autoreqprov:    no
228
229 %description fb
230 This package includes a version of the Linux %{version} kernel with
231 framebuffer support.
232
233 %description -l fr fb
234 Ce package inclu une version de Linux version %{version} avec
235 framebuffer.
236
237 %description -l de fb
238 Dieses Paket enthält eine Version von Linux-Kernel %{version} mit
239 framebuffer-Support.
240
241 %package smp-fb
242 Summary:        Kernel version %{version} compiled for SMP machines with fb
243 Summary(de):    Kernel version %{version} für Multiprozessor-Maschinen mit framebuffer
244 Summary(fr):    Kernel version %{version} compiler pour les machine Multi-Processeur avec fb
245 Group:          Base/Kernel
246 Group(de):      Grundsätzlich/Kern
247 Group(pl):      Podstawowe/J±dro
248 Provides:       %{name} = %{version}
249 %ifarch %{x86}
250 Provides:       %{name}(reiserfs) = %{version}
251 %endif
252 Provides:       %{name}(ipvs) = %{version}
253 Provides:       %{name}(rawio) = %{version}
254 Prereq:         modutils
255 Prereq:         fileutils
256 Prereq:         geninitrd
257 #Prereq:                rc-boot
258 Autoreqprov:    no
259
260 %description smp-fb
261 This package includes a SMP version of the Linux %{version} kernel. It
262 is required only on machines with two or more CPUs, although it should
263 work fine on single-CPU boxes. It also contains support for
264 framebuffer (graphical console) devices.
265
266 %description -l fr smp-fb
267 Ce package inclu une version SMP du noyau de Linux version %{version}
268 avec framebuffer. Il et nécessaire seulement pour les machine avec
269 deux processeurs ou plus, il peut quand même fonctionner pour les
270 système mono-processeur.
271
272 %description -l de smp-fb
273 Dieses Paket enthält eine SMP (Multiprozessor)-Version von
274 Linux-Kernel %{version}. Es wird für Maschinen mit zwei oder mehr
275 Prozessoren gebraucht, sollte aber auch auf Computern mit nur einer
276 CPU laufen. Außerdem ist Support für Framebuffer-Devices (Console im
277 Grafikmodus) enthalten.
278
279 %package BOOT
280 Summary:        Kernel version %{version} used on the installation boot disks
281 Summary(de):    Kernel version %{version} für Installationsdisketten
282 Summary(fr):    Kernel version %{version} utiliser pour les disquettes d'installation
283 Group:          Base/Kernel
284 Group(de):      Grundsätzlich/Kern
285 Group(pl):      Podstawowe/J±dro
286 Prereq:         modutils
287 Prereq:         fileutils
288 Autoreqprov:    no
289
290 %description BOOT
291 This package includes a trimmed down version of the Linux %{version}
292 kernel. This kernel is used on the installation boot disks only and
293 should not be used for an installed system, as many features in this
294 kernel are turned off because of the size constraints.
295
296 %description -l fr BOOT
297 Ce package inclut une version allégée du noyau de Linux version
298 %{version}. Ce kernel et utilisé pour les disquettes de boot
299 d'installation et ne doivent pas être utilisées pour un système
300 classique, beaucoup d'options dans le kernel ont étaient désactivées a
301 cause de la contrainte d'espace.
302
303 %description -l de BOOT
304 Dieses Paket enthält eine verkleinerte Version vom Linux-Kernel
305 version %{version}. Dieser Kernel wird auf den
306 Installations-Bootdisketten benutzt und sollte nicht auf einem
307 installierten System verwendet werden, da viele Funktionen wegen der
308 Platzprobleme abgeschaltet sind.
309
310 %package headers
311 Summary:        Header files for the Linux kernel
312 Summary(pl):    Pliki nag³ówkowe j±dra
313 Group:          Base/Kernel
314 Group(de):      Grundsätzlich/Kern
315 Group(pl):      Podstawowe/J±dro
316 %ifarch %{x86}
317 Provides:       %{name}-headers(reiserfs) = %{version}
318 Provides:       i2c-devel = %{i2c_version}
319 %endif
320 Provides:       %{name}-headers(ipvs) = %{version}
321 Provides:       %{name}-headers(rawio) = %{version}
322 Provides:       %{name}-headers(bridging) = %{version}
323 Autoreqprov:    no
324
325 %description headers
326 These are the C header files for the Linux kernel, which define
327 structures and constants that are needed when building most standard
328 programs under Linux, as well as to rebuild the kernel.
329
330 %description headers -l pl
331 Pakiet zawiera pliki nag³ówkowe j±dra, niezbedne do rekompilacji j±dra
332 oraz niektórych programów.
333
334 %package doc
335 Summary:        Kernel documentation
336 Summary(pl):    Dokumentacja j±dra
337 Group:          Base/Kernel
338 Group(de):      Grundsätzlich/Kern
339 Group(pl):      Podstawowe/J±dro
340 Provides:       %{name}-doc = %{version}
341 Autoreqprov:    no
342
343 %description doc
344 This is the documentation for the Linux kernel, as found in
345 /usr/src/linux/Documentation directory.
346
347 %description doc -l pl
348 Pakiet zawiera dokumentacjê j±dra z katalogu
349 /usr/src/linux/Documentation.
350
351 %package source
352 Summary:        Kernel source tree
353 Summary(pl):    Kod ¼ród³owy j±dra Linuxa
354 Group:          Base/Kernel
355 Group(de):      Grundsätzlich/Kern
356 Group(pl):      Podstawowe/J±dro
357 Autoreqprov:    no
358 Requires:       %{name}-headers = %{version}
359 %ifarch %{ix86}
360 Requires:       bin86
361 %endif
362
363 %description source
364 This is the source code for the Linux kernel. It is required to build
365 most C programs as they depend on constants defined in here. You can
366 also build a custom kernel that is better tuned to your particular
367 hardware.
368
369 %description -l de source
370 Das Kernel-Source-Paket enthält den source code (C/Assembler-Code) des
371 Linux-Kernels. Die Source-Dateien werden gebraucht, um viele
372 C-Programme zu compilieren, da sie auf Konstanten zurückgreifen, die
373 im Kernel-Source definiert sind. Die Source-Dateien können auch
374 benutzt werden, um einen Kernel zu compilieren, der besser auf Ihre
375 Hardware ausgerichtet ist.
376
377 %description -l fr source
378 Le package pour le kernel-source contient le code source pour le noyau
379 linux. Ces sources sont nécessaires pour compiler la plupart des
380 programmes C, car il dépend de constantes définies dans le code
381 source. Les sources peuvent être aussi utilisée pour compiler un noyau
382 personnalisé pour avoir de meilleures performances sur des matériels
383 particuliers.
384
385 %description source -l pl
386 Pakiet zawiera kod ¼ród³owy jadra systemu.
387
388 %prep
389 %setup -q -a3 -a4 -a5 -a6 -a7 -a8 -a9 -a10 -a11 -a12 -a50 -a51 -n linux
390
391 # here  patch will be executabling, for now we have just patch in the 
392 # tar.gz sources
393
394 %patch300 -p1
395 %patch320 -p1
396
397 %patch0 -p1
398 %patch1 -p0
399 # disable aic7xxx patch on sparc (this must be reported to aic7xxx driver maintainer)
400 %ifnarch sparc sparc64
401 %patch2 -p1
402 %endif
403 %patch3 -p1
404 %patch4 -p1
405 %patch5 -p1
406 %patch6 -p1
407 %patch7 -p1
408 %patch8 -p1
409 %patch9 -p1
410 %patch10 -p1
411
412 %patch20 -p1
413 %patch21 -p1
414 %patch22 -p1
415 %patch23 -p1
416 %patch24 -p1
417 %patch25 -p1
418 %patch26 -p1
419 %patch27 -p1
420
421 %patch30 -p1
422 %patch31 -p1
423 %patch32 -p1
424
425 %patch40 -p1
426
427 %patch100 -p1
428 %patch101 -p1
429 %patch102 -p1
430 %patch105 -p1
431 %patch106 -p1
432 %patch108 -p1
433 %patch109 -p1
434 %patch110 -p1
435 %patch112 -p1
436
437 # 802.1Q VLANs
438 patch -p1 -s <vlan.%{vlan_version}/vlan_2.2.patch
439
440 cd serial-5.05
441 %patch41 -p1
442 %patch42 -p1
443 ./install-in-kernel ../
444 cd .. 
445
446 # Dac drivers
447 mv RELEASE_NOTES.DAC960 README.DAC960 Documentation
448 mv DAC960.[ch] drivers/block
449
450 # i2c
451 %ifarch %{ix86}
452 cd i2c-%{i2c_version}
453 mkpatch/mkpatch.pl . ../../linux | (cd ../../linux; patch -p1 -s)
454 cd ..
455 %endif
456
457 # 2.2.20ow1
458 %patch321 -p1
459 patch -p1 -s <linux-%{ow_version}/linux-%{ow_version}.diff
460
461 # symbios drivers
462 mv sym-%{symncr_version}/*.{c,h} drivers/scsi
463 mv sym-%{symncr_version}/{README,ChangeLog}.* Documentation
464
465 # Tekram DC395/315 U/UW SCSI host driver
466 install dc395/dc395x_trm.? dc395/README.dc395x drivers/scsi/
467
468 # JFS 1.0.5
469 # make a copy of README
470 %patch104 -p1
471 patch -p1 -s <jfs-2.2.common-v%{jfs_version}-patch
472
473 %patch107 -p1
474
475 %patch200 -p1
476
477 %patch120 -p1
478 %patch121 -p1
479 %patch122 -p1
480 %patch123 -p1
481
482 #%patch111 -p1
483
484 %build
485 BuildKernel() {
486         %{?verbose:set -x}
487         # is this a special kernel we want to build?
488         if [ "$1" = "BOOT" ]; then
489                 Config="%{_target_cpu}-BOOT"
490                 KernelVer=%{version}
491                 echo BUILDING A KERNEL FOR BOOT...
492         elif [ -n "$1" ] ; then
493                 Config="%{_target_cpu}"-$1
494                 KernelVer=%{version}-%{release}$1
495                 echo BUILDING A KERNEL FOR $1...
496         else
497                 Config="%{_target_cpu}"
498                 KernelVer=%{version}-%{release}
499                 echo BUILDING THE NORMAL KERNEL...
500         fi
501         cp $RPM_SOURCE_DIR/kernel-$Config.config arch/$RPM_ARCH/defconfig
502
503 %ifarch %{ix86}
504         perl -p -i -e "s/-m486//" arch/i386/Makefile
505         perl -p -i -e "s/-DCPU=486/-m486 -DCPU=486/" arch/i386/Makefile
506         perl -p -i -e "s/-DCPU=586/-mpentium -DCPU=586/" arch/i386/Makefile
507         perl -p -i -e "s/-DCPU=686/-mpentiumpro -DCPU=686/" arch/i386/Makefile
508 %endif
509
510         %{__make} mrproper
511         ln -sf arch/$RPM_ARCH/defconfig .config
512
513 %ifarch sparc
514         sparc32 %{__make} oldconfig
515         sparc32 %{__make} dep 
516 %else
517         %{__make} oldconfig
518         %{__make} dep
519 %endif
520         make include/linux/version.h 
521
522 %ifarch %{ix86} alpha sparc
523         KERNELCC="egcs"
524 %endif
525 %ifarch sparc64
526         KERNELCC="sparc64-linux-gcc"
527 %endif
528
529 %ifarch %{ix86}
530         %{__make} bzImage EXTRAVERSION="-%{release}"
531 %else
532 %ifarch sparc
533         sparc32 %{__make} boot EXTRAVERSION="-%{release}"
534 %else
535         %{__make} boot EXTRAVERSION="-%{release}"
536 %endif
537 %endif
538 %ifarch sparc
539         sparc32 %{__make} modules EXTRAVERSION="-%{release}"
540 %else
541         %{__make} modules EXTRAVERSION="-%{release}"
542 %endif
543
544         mkdir -p $KERNEL_INSTALL_DIR/boot
545         install System.map $KERNEL_INSTALL_DIR/boot/System.map-$KernelVer
546 %ifarch %{ix86}
547         cp arch/i386/boot/bzImage $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
548 %endif
549 %ifarch alpha sparc sparc64
550         gzip -cfv vmlinux > vmlinuz
551         install vmlinux $KERNEL_INSTALL_DIR/boot/vmlinux-$KernelVer
552         install vmlinuz $KERNEL_INSTALL_DIR/boot/vmlinuz-$KernelVer
553 %endif
554      %{__make} INSTALL_MOD_PATH=$KERNEL_INSTALL_DIR modules_install KERNELRELEASE=$KernelVer
555 }
556
557 BuildPCMCIA() {
558 if [ "$1" = "BOOT" ]; then
559         PCMCIA_APM=--apm
560         KernelVer=%{version}
561         echo BUILDING A KERNEL PCMCIA MODULES FOR BOOT...
562 elif [ -n "$1" ] ; then
563         PCMCIA_APM=--apm
564         KernelVer=%{version}-%{release}$1
565         echo BUILDING A KERNEL PCMCIA MODULES FOR $1...
566 else
567         PCMCIA_APM=--noapm
568         KernelVer=%{version}-%{release}
569         echo BUILDING THE NORMAL KERNEL PCMCIA MODULES...
570 fi
571 cd pcmcia-cs-%{pcmcia_version}
572 %{__make} clean
573 ./Configure \
574         --noprompt \
575         --trust \
576         --cardbus \
577         --current \
578         --pnp \
579         --srctree \
580         $PCMCIA_APM \
581         --kernel=$KERNEL_BUILD_DIR \
582         --moddir=/lib/modules/$KernelVer \
583         --kflags="-march=%{_target_cpu}" \
584         --target=$KERNEL_INSTALL_DIR
585
586 mv config.mk config.mk.bak
587 mv Makefile Makefile.bak
588 mv clients/Makefile clients/Makefile.bak
589 sed "s/^MODDIR=.*/MODDIR=\/lib\/modules\/$KernelVer/" config.mk.bak > config.mk
590 sed "s/^DIRS =.*//" Makefile.bak > Makefile
591 sed "s/.*= 8390\..$//" clients/Makefile.bak > clients/Makefile
592
593 %{__make} all
594 #       CC=egcs \
595 #       CFLAGS="$RPM_OPT_FLAGS -Wall -Wstrict-prototypes -pipe" \
596 #       MFLAG="$RPM_OPT_FLAGS -O"
597
598 #       XFLAGS="$RPM_OPT_FLAGS -O -pipe -I../include -I$KERNEL_BUILD_DIR/include -D__KERNEL__ -DEXPORT_SYMTAB"
599
600 %{__make} PREFIX=$KERNEL_INSTALL_DIR install
601 cd ..
602
603 # Linux WLAN package extension for PCMCIA
604 cd linux-wlan-%{wlan_version}
605 %{__make} clean
606 mv config.mk config.mk.bak
607 kernelbase=`echo $KERNEL_BUILD_DIR| sed -e "sm/m\\\\\/mg"`
608 sed "s/^MODULES_DIR=.*/MODULES_DIR=$kernelbase-installed\/lib\/modules\/$KernelVer/" config.mk.bak > config.mk.bak2
609 sed "s/^MAKE_CS=.*/MAKE_CS=y/" config.mk.bak2 > config.mk.bak3
610 sed "s/^LINUX_SRC=.*/LINUX_SRC=$kernelbase/" config.mk.bak3 > config.mk.bak4
611 sed "s/^PCMCIA_SRC=.*/PCMCIA_SRC=$kernelbase\/pcmcia-cs-%{pcmcia_version}/" config.mk.bak4 > config.mk
612
613 cd driver
614 %{__make} all
615         CC=egcs \
616         CFLAGS="$RPM_OPT_FLAGS -Wall -Wstrict-prototypes -pipe" \
617         XFLAGS="$RPM_OPT_FLAGS -O -pipe -I../include -I$KERNEL_BUILD_DIR/include -I$KERNEL_BUILD_DIR/pcmcia-cs-%{pcmcia_version}/include -D__KERNEL__ -DEXPORT_SYMTAB"
618
619 %{__make} PREFIX=$KERNEL_INSTALL_DIR install
620
621 cd ../..
622
623 cd tun-%{tun_version}
624 aclocal
625 autoconf
626 (cd linux
627 aclocal
628 autoconf)
629 %configure \
630         --with-kernel="$KERNEL_BUILD_DIR"
631 make
632 install linux/tun.o "$KERNEL_INSTALL_DIR/lib/modules/$KernelVer/net"
633 cd ..
634
635 #  bttv
636 cd bttv-%{bttv_version}
637 cd driver/
638 cp Makefile Makefile.new
639 sed -e "s/^CURRENT[     ]*:=.*/CURRENT := $KernelVer/" Makefile.new > Makefile
640 cd ..
641 %{__make} EXTRA_CFLAGS="$RPM_OPT_FLAGS"
642 %{__make} -C driver install DESTDIR=$KERNEL_INSTALL_DIR
643 cd ..
644
645 }
646
647
648 KERNEL_BUILD_DIR=`pwd`
649 KERNEL_INSTALL_DIR=$KERNEL_BUILD_DIR-installed
650
651 rm -rf $KERNEL_INSTALL_DIR
652 install -d $KERNEL_INSTALL_DIR
653
654
655 # NORMAL KERNEL
656 BuildKernel
657 %ifarch %{ix86}
658 BuildPCMCIA
659 %endif
660
661 # FB-ENABLED KERNEL
662 #BuildKernel fb
663
664 # SMP-ENABLED KERNEL
665 BuildKernel smp
666 %ifarch %{ix86}
667 BuildPCMCIA smp
668 %endif
669
670 # BOOT kernel
671 %ifnarch i586 i686
672 KERNEL_INSTALL_DIR="$KERNEL_BUILD_DIR-installed/%{_libdir}/bootdisk"
673 rm -rf $KERNEL_INSTALL_DIR
674 install -d $KERNEL_INSTALL_DIR
675
676 BuildKernel BOOT
677 %ifarch %{ix86}
678 BuildPCMCIA BOOT
679 %endif
680 %endif
681
682 %install
683 rm -rf $RPM_BUILD_ROOT
684 install -d $RPM_BUILD_ROOT%{_prefix}/{include,src}
685
686 KERNEL_BUILD_DIR=`pwd`
687 KERNEL_INSTALL_DIR="$KERNEL_BUILD_DIR-installed"
688 cp -a $KERNEL_INSTALL_DIR/* $RPM_BUILD_ROOT
689
690 ln -sf ../src/linux/include/linux $RPM_BUILD_ROOT%{_includedir}/linux
691 ln -sf ../src/linux/include/asm $RPM_BUILD_ROOT%{_includedir}/asm
692
693 bzip2 -dc %{SOURCE0} | tar -xf - -C $RPM_BUILD_ROOT%{_prefix}/src/
694 mv -f $RPM_BUILD_ROOT%{_prefix}/src/linux $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
695 ln -sf linux-%{version} $RPM_BUILD_ROOT%{_prefix}/src/linux
696 gzip -dc %{SOURCE9} | tar -xf - -C $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
697
698 bzip2 -dc %{PATCH300} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
699 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH320}
700 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH0}
701 %ifnarch sparc sparc64
702 gzip -dc %{PATCH2} | patch -s -p1 -d $RPM_BUILD_ROOT/usr/src/linux-%{version}
703 %endif
704 bzip2 -dc %{PATCH3} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
705 gzip -dc %{PATCH4} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
706 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH5}
707 gzip -dc %{PATCH6} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
708 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH7}
709 patch -s -p1 -d $RPM_BUILD_ROOT/usr/src/linux-%{version} < %{PATCH8}
710 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH9}
711 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH10}
712
713 gzip -dc %{PATCH20} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
714 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH21}
715 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH22}
716 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH23}
717 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH24}
718 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH25}
719 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH26}
720 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH27}
721
722 bzip2 -dc %{PATCH30} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
723 gzip -dc %{PATCH31} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
724 gzip -dc %{PATCH32} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
725
726 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH40}
727
728 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH100}
729 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH101}
730 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH102}
731
732 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH105}
733 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH106}
734
735 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH108}
736 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH109}
737
738 # VLAN
739 patch -p1 -s -d $RPM_BUILD_ROOT/usr/src/linux-%{version} <vlan.%{vlan_version}/vlan_2.2.patch
740
741 #serial
742 cd serial-5.05
743 patch -s -p1 -d $RPM_BUILD_ROOT/usr/src/linux-%{version}/serial-5.05 < %{PATCH41}
744 patch -s -p1 -d $RPM_BUILD_ROOT/usr/src/linux-%{version}/serial-5.05 < %{PATCH42}
745 ./install-in-kernel $RPM_BUILD_ROOT/usr/src/linux-%{version}
746 cd ..
747
748 #DAC960 drivers
749 tar xfz %{SOURCE8}
750 mv RELEASE_NOTES.DAC960 README.DAC960 Documentation
751 mv DAC960.[ch] drivers/block
752
753 # i2c
754 %ifarch %{ix86}
755 tar xfz %{SOURCE50}
756 cd i2c-%{i2c_version}
757 mkpatch/mkpatch.pl . $RPM_BUILD_ROOT/usr/src/linux-%{version} | (cd $RPM_BUILD_ROOT/usr/src/linux-%{version}; patch -p1 -s)
758 cd ..
759 %endif
760
761 # 2.2.20ow
762 patch -s -p1 -d $RPM_BUILD_ROOT/usr/src/linux-%{version} <linux-%{ow_version}/linux-%{ow_version}.diff
763
764 # symbios drivers
765 tar zxf %{SOURCE6}
766 mv sym-%{symncr_version}/*.{c,h} $RPM_BUILD_ROOT/usr/src/linux-%{version}/drivers/scsi
767 mv sym-%{symncr_version}/{README,ChangeLog}.* $RPM_BUILD_ROOT/usr/src/linux-%{version}/Documentation
768 rm -rf sym-%{symncr_version}
769
770 # jfs 1.0.5
771 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH104}
772 patch -s -p1 -d $RPM_BUILD_ROOT/usr/src/linux-%{version} < jfs-2.2.common-v%{jfs_version}-patch
773
774 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH107}
775
776 bzip2 -dc %{PATCH121} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
777 bzip2 -dc %{PATCH123} | patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version}
778
779 patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH200}
780
781 #patch -s -p1 -d $RPM_BUILD_ROOT%{_prefix}/src/linux-%{version} < %{PATCH111}
782
783 cd $RPM_BUILD_ROOT/usr/src/linux-%{version}
784
785 %{__make} mrproper
786 find  -name "*~" -print | xargs rm -f
787 find  -name "*.orig" -print | xargs rm -f
788
789 install $RPM_SOURCE_DIR/kernel-%{_target_cpu}.config .config
790
791 %{__make} oldconfig
792 mv include/linux/autoconf.h include/linux/autoconf-up.h
793
794 install $RPM_SOURCE_DIR/kernel-%{_target_cpu}-smp.config .config
795 %{__make} oldconfig
796 mv include/linux/autoconf.h include/linux/autoconf-smp.h
797
798 install %{SOURCE1} $RPM_BUILD_ROOT/usr/src/linux-%{version}/include/linux/autoconf.h
799
800 # this generates modversions info which we want to include and we may as
801 # well include the depends stuff as well
802 %{__make} symlinks 
803 %{__make} include/linux/version.h
804 %{__make} "`pwd`/include/linux/modversions.h"
805
806 # this generates modversions info which we want to include and we may as
807 # well include the depends stuff as well, after we fix the paths
808
809 %{__make} depend 
810 find $RPM_BUILD_ROOT/usr/src/linux-%{version} -name ".*depend" | \
811 while read file ; do
812         mv $file $file.old
813         sed -e "s|$RPM_BUILD_ROOT\(/usr/src/linux\)|\1|g" < $file.old > $file
814         rm -f $file.old
815 done
816
817 %{__make} clean
818 rm -f scripts/mkdep
819
820 # add a rc-boot info
821 #install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/rc-boot/images
822 #cat >$RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/rc-boot/images/pld-%{version}-%{release} <<EOF
823 #TYPE=linux
824 #ROOT=auto
825 #KERNEL=/boot/vmlinuz-%{version}-%{release}
826 #INITRD=/boot/initrd-%{version}-%{release}.gz
827 #EOF
828
829 %clean
830 rm -rf $RPM_BUILD_ROOT
831 rm -rf $RPM_BUILD_DIR/linux-installed
832
833
834 %post
835 test ! -f /boot/vmlinuz || mv -f /boot/vmlinuz /boot/vmlinuz.old
836 test ! -f /boot/System.map || mv -f /boot/System.map /boot/System.map.old
837 ln -sf vmlinuz-%{version}-%{release} /boot/vmlinuz
838 ln -sf System.map-%{version}-%{release} /boot/System.map
839
840 geninitrd /boot/initrd-%{version}-%{release}.gz %{version}-%{release}
841 test ! -f /boot/initrd || mv -f /boot/initrd /boot/initrd.old
842 ln -sf initrd-%{version}-%{release}.gz /boot/initrd
843
844 if [ -x /sbin/rc-boot ] ; then
845         /sbin/rc-boot 1>&2 || :
846 fi
847
848 rm -f /lib/modules/%{version}
849 ln -snf %{version}-%{release} /lib/modules/%{version}
850
851 depmod -a -F /boot/System.map %{version}-%{release}
852
853 %post smp
854 mv -f /boot/vmlinuz /boot/vmlinuz.old 2> /dev/null > /dev/null
855 mv -f /boot/System.map /boot/System.map.old 2> /dev/null > /dev/null
856 ln -sf vmlinuz-%{version}-%{release}smp /boot/vmlinuz
857 ln -sf System.map-%{version}-%{release}smp /boot/System.map
858
859 geninitrd /boot/initrd-%{version}-%{release}smp.gz %{version}-%{release}smp
860 test ! -f /boot/initrd || mv -f /boot/initrd /boot/initrd.old 2> /dev/null > /dev/null
861 ln -sf initrd-%{version}-%{release}smp.gz /boot/initrd
862
863 if [ -x /sbin/rc-boot ] ; then
864         /sbin/rc-boot 1>&2 || :
865 fi
866
867 rm -f /lib/modules/%{version}
868 ln -snf %{version}-%{release}smp /lib/modules/%{version}
869
870 depmod -a -F /boot/System.map %{version}-%{release}
871
872 %postun
873 if [ -L /lib/modules/%{version} ]; then 
874         if [ "`ls -l /lib/modules/%{version} | awk '{ print $11 }'`" = "%{version}-%{release}" ]; then
875                 if [ "$1" = "0" ]; then
876                         rm -f /lib/modules/%{version}
877                 fi
878         fi
879 fi
880 rm -f /boot/initrd-%{version}-%{release}.gz
881
882 %postun smp
883 if [ -L /lib/modules/%{version} ]; then 
884         if [ "`ls -l /lib/modules/%{version} | awk '{ print $11 }'`" = "%{version}-%{release}smp" ]; then
885                 if [ "$1" = "0" ]; then
886                         rm -f /lib/modules/%{version}
887                 fi
888         fi
889 fi
890 rm -f /boot/initrd-%{version}-%{release}smp.gz
891
892
893 %post headers
894 rm -f /usr/src/linux
895 ln -snf linux-%{version} /usr/src/linux
896
897 %postun headers
898 if [ -L /usr/src/linux ]; then 
899         if [ "`ls -l /usr/src/linux | awk '{ print $11 }'`" = "linux-%{version}" ]; then
900                 if [ "$1" = "0" ]; then
901                         rm -f /usr/src/linux
902                 fi
903         fi
904 fi
905
906 %files
907 %defattr(644,root,root,755)
908 %ifarch alpha sparc
909 %attr(600,root,root) /boot/vmlinux-%{version}-%{release}
910 %endif
911 %attr(600,root,root) /boot/vmlinuz-%{version}-%{release}
912 %attr(600,root,root) /boot/System.map-%{version}-%{release}
913 %dir /lib/modules/%{version}-%{release}
914 /lib/modules/%{version}-%{release}/atm
915 /lib/modules/%{version}-%{release}/block
916 %ifnarch sparc sparc64
917 /lib/modules/%{version}-%{release}/cdrom
918 %endif
919 /lib/modules/%{version}-%{release}/fs
920 /lib/modules/%{version}-%{release}/ipv4
921 /lib/modules/%{version}-%{release}/ipv6
922 /lib/modules/%{version}-%{release}/misc
923 /lib/modules/%{version}-%{release}/net
924 /lib/modules/%{version}-%{release}/scsi
925 %ifarch %{ix86}
926 /lib/modules/%{version}-%{release}/usb
927 /lib/modules/%{version}-%{release}/video
928 %endif
929 %ifarch %{ix86}
930 /lib/modules/%{version}-%{release}/pcmcia
931 %endif
932 #%config(missingok) %{_sysconfdir}/sysconfig/rc-boot/images
933
934 %files smp
935 %defattr(644,root,root,755)
936 %ifarch alpha sparc
937 %attr(600,root,root) /boot/vmlinux-%{version}-%{release}smp
938 %endif
939 %attr(600,root,root) /boot/vmlinuz-%{version}-%{release}smp
940 %attr(600,root,root) /boot/System.map-%{version}-%{release}smp
941 %dir /lib/modules/%{version}-%{release}smp
942 /lib/modules/%{version}-%{release}smp/atm
943 /lib/modules/%{version}-%{release}smp/block
944 %ifnarch sparc sparc64
945 /lib/modules/%{version}-%{release}smp/cdrom
946 %endif
947 /lib/modules/%{version}-%{release}smp/fs
948 /lib/modules/%{version}-%{release}smp/ipv4
949 /lib/modules/%{version}-%{release}smp/ipv6
950 /lib/modules/%{version}-%{release}smp/misc
951 /lib/modules/%{version}-%{release}smp/net
952 /lib/modules/%{version}-%{release}smp/scsi
953 %ifarch %{ix86} 
954 /lib/modules/%{version}-%{release}smp/usb
955 /lib/modules/%{version}-%{release}smp/video
956 %endif
957 %ifarch %{ix86}
958 /lib/modules/%{version}-%{release}smp/pcmcia
959 %endif
960 #%config(missingok) %{_sysconfdir}/sysconfig/rc-boot/images
961
962 %ifnarch i586 i686
963 %files BOOT
964 %defattr(644,root,root,755)
965 %ifarch alpha sparc
966 %{_libdir}/bootdisk/boot/vmlinux-%{version}
967 %endif
968 %{_libdir}/bootdisk/boot/vmlinuz-%{version}
969 %{_libdir}/bootdisk/boot/System.map-%{version}
970 %dir %{_libdir}/bootdisk/lib/modules/%{version}
971 #%{_libdir}/bootdisk/lib/modules/%{version}/atm
972 %{_libdir}/bootdisk/lib/modules/%{version}/block
973 %ifnarch sparc sparc64 alpha
974 %{_libdir}/bootdisk/lib/modules/%{version}/cdrom
975 %endif
976 %{_libdir}/bootdisk/lib/modules/%{version}/fs
977 #%{_libdir}/bootdisk/lib/modules/%{version}/ipv4
978 %{_libdir}/bootdisk/lib/modules/%{version}/ipv6
979 %{_libdir}/bootdisk/lib/modules/%{version}/misc
980 %{_libdir}/bootdisk/lib/modules/%{version}/net
981 %{_libdir}/bootdisk/lib/modules/%{version}/scsi
982 %ifarch %{ix86} 
983 %{_libdir}/bootdisk/lib/modules/%{version}/usb
984 %endif
985 %ifarch i386
986 %{_libdir}/bootdisk/lib/modules/%{version}/pcmcia
987 %endif
988 %endif
989
990 %files headers
991 %defattr(644,root,root,755)
992 %dir %{_prefix}/src/linux-%{version}
993 %{_prefix}/src/linux-%{version}/include
994 %{_includedir}/asm
995 %ifarch sparc sparc64
996 %{_includedir}/asm-sparc*
997 %endif
998 %{_includedir}/linux
999
1000 %files doc
1001 %defattr(644,root,root,755)
1002 %{_prefix}/src/linux-%{version}/Documentation
1003
1004 %files source
1005 %defattr(644,root,root,755)
1006 %{_prefix}/src/linux-%{version}/arch
1007 %{_prefix}/src/linux-%{version}/crypto
1008 %{_prefix}/src/linux-%{version}/drivers
1009 %{_prefix}/src/linux-%{version}/fs
1010 %{_prefix}/src/linux-%{version}/init
1011 %{_prefix}/src/linux-%{version}/ipc
1012 %{_prefix}/src/linux-%{version}/kernel
1013 %{_prefix}/src/linux-%{version}/lib
1014 %{_prefix}/src/linux-%{version}/mm
1015 %{_prefix}/src/linux-%{version}/modules
1016 %{_prefix}/src/linux-%{version}/net
1017 %{_prefix}/src/linux-%{version}/scripts
1018 %{_prefix}/src/linux-%{version}/security
1019 %{_prefix}/src/linux-%{version}/.config
1020 %{_prefix}/src/linux-%{version}/.depend
1021 %{_prefix}/src/linux-%{version}/.hdepend
1022 %{_prefix}/src/linux-%{version}/COPYING
1023 %{_prefix}/src/linux-%{version}/CREDITS
1024 %{_prefix}/src/linux-%{version}/MAINTAINERS
1025 %{_prefix}/src/linux-%{version}/Makefile
1026 %{_prefix}/src/linux-%{version}/README
1027 %{_prefix}/src/linux-%{version}/REPORTING-BUGS
1028 %{_prefix}/src/linux-%{version}/Rules.make
This page took 0.252418 seconds and 3 git commands to generate.