Whamcloud - gitweb
27463b08392a280728028be3a327619cbcc50a94
[fs/lustre-release.git] / lustre / scripts / lustre-kernel-2.4.spec.in
1 Summary: The Linux kernel (the core of the Linux operating system)
2
3 # Versions of various parts
4
5 #
6 # Polite request for people who spin their own kernel rpms:
7 # please modify the "release" field in a way that identifies
8 # that the kernel isn't the stock RHL kernel, for example by
9 # adding some text to the end of the version number.
10 #
11 %define kversion @KERNEL_VERSION@
12 %define release @KERNEL_RELEASE@
13 # /usr/src/%{kslnk} -> /usr/src/linux-%{KVERREL}
14 %define kslnk linux-2.4
15
16 # groups of related archs
17 %define all_x86 i386 i686 i586 athlon
18 #define all_x86 i686 i386 i586 athlon
19
20 %define nptlarchs %{all_x86}
21 #define nptlarchs noarch
22
23 # disable build root strip policy
24 %define __spec_install_post /usr/lib/rpm/brp-compress || :
25 #
26 # RPM foo magic
27 %define _missing_doc_files_terminate_build    0
28 %define _unpackaged_files_terminate_build 0
29 %define debug_package %{nil}
30
31 # Enable this to build a board-specific kernel configuration 
32 # some architectures have LOTS of different setups and this 
33 # is a way to deal with that cleanly.
34 #
35 #define targetboard assabet
36 %define dashtargetboard %{?targetboard:-%{targetboard}}
37 %define withtargetboard 0
38 %{?targetboard: %{expand: %%define withtargetboard 1}}
39         
40 # Override generic defaults with per-arch defaults (which can
41 # themselves be overridden with --with/--without).  These must
42 # ONLY be "0", never "1"
43
44 %define buildbase 0
45 %define buildbigmem 0
46 %define buildBOOT 0
47 %define buildjensen 0
48 %define buildsmp 0
49 %define buildup 0
50 %define buildsrc 0
51
52 %ifarch @BASE_ARCHS@
53 %define buildbase 1
54 %endif
55
56 %ifarch @BIGMEM_ARCHS@
57 %define buildbigmem 1
58 %endif
59
60 %ifarch @BOOT_ARCHS@
61 %define buildBOOT 1
62 %endif
63
64 %ifarch @JENSEN_ARCHS@
65 %define buildjensen 1
66 %endif
67
68 %ifarch @SMP_ARCHS@
69 %define buildsmp 1
70 %endif
71
72 %ifarch @UP_ARCHS@
73 %define buildup 1
74 %endif
75
76 # For board-specific kernels, build only the normal kernel (which may actually be smp, not up).
77 %if %{withtargetboard}
78 %define buildsmp 0
79 %define buildBOOT 0
80 %define buildbigmem 0
81 %define buildjensen 0
82 %endif
83
84 %if 0
85 Second, per-architecture exclusions (ifarch)
86 %ifarch i386
87 %define buildsmp 0
88 %endif
89 %ifarch ia64
90 %define buildBOOT 0
91 %endif
92 %endif
93
94 # we can't test values inline, only whether a macro exists
95 %{expand: %%define buildup_%{buildup} yadda}
96 %{expand: %%define buildsmp_%{buildsmp} yadda}
97 %{expand: %%define buildBOOT_%{buildBOOT} yadda}
98 %{expand: %%define buildbigmem_%{buildbigmem} yadda}
99 %{expand: %%define buildjensen_%{buildjensen} yadda}
100 %{expand: %%define ikd_%{ikd} yadda}
101 %{expand: %%define ibcs_%{ibcs} yadda}
102 %{expand: %%define debuglevel_%{debugging} yadda}
103
104 %{expand: %%define kernel_conflicts  ppp <= 2.3.15, pcmcia-cs <= 3.1.20, isdn4k-utils <= 3.0, mount < 2.10r-5, nfs-utils < 0.3.1, cipe < 1.4.5, tux < 2.1.0, kudzu <= 0.92, e2fsprogs < 1.22, initscripts < 5.84, dev < 3.2-7, iptables < 1.2.5-3, bcm5820 < 1.81, nvidia-rh72 <= 1.0, oprofile < 0.4}
105
106 %define BOOT_kernel_prereq fileutils, modutils >=  2.4.18
107 %define kernel_prereq %{BOOT_kernel_prereq}, initscripts >= 5.83, mkinitrd >= 3.2.6
108 %ifarch ia64
109 %define initrd_dir /boot/efi/redhat
110 %else
111 %define initrd_dir /boot
112 %endif
113
114 %ifarch %{all_x86} x86_64
115 %define kernel_glob vmlinu?-%{KVERREL}
116 %endif
117 %ifarch ia64
118 # <sigh>, no GLOB_BRACE for filelists, efi needs to be done separately
119 %define kernel_glob vmlinuz-%{KVERREL}
120 %endif
121 %ifarch alpha
122 %define kernel_glob vmlinu?-%{KVERREL}
123 %endif
124
125 Name: kernel
126 Version: %{kversion}
127 Release: %{release}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg}
128 %define KVERREL %{PACKAGE_VERSION}-%{PACKAGE_RELEASE}
129 License: GPL
130 Group: System Environment/Kernel
131 ExclusiveArch: %{all_x86} x86_64
132 ExclusiveOS: Linux
133 Obsoletes: kernel-modules, kernel-sparc
134 Provides: kernel = %{version}
135 BuildConflicts: rhbuildsys(DiscFree) < 500Mb
136 %ifarch %{all_x86} ia64 x86_64
137 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
138 %endif
139 Autoreqprov: no
140 Prereq: %{kernel_prereq}
141 Conflicts: %{kernel_conflicts}
142
143 BuildPreReq: patch >= 2.5.4, bash >= 2.03, sh-utils, gnupg, tar
144 BuildPreReq: bzip2, findutils, dev, gzip, m4
145
146 Vendor: Cluster File Systems, Inc.
147 URL: http://www.kernel.org/
148 Buildroot: /var/tmp/%{name}-%{PACKAGE_VERSION}-root
149
150 Source0: @LUSTRE_SOURCE@
151 Source1: @KERNEL_SOURCE@
152
153 Source16: linux-merge-config.awk
154 Source17: linux-merge-modules.awk
155
156 %package source
157 Summary: The source code for the Linux kernel.
158 Group: Development/System
159 Prereq: fileutils
160 Requires: gawk
161 Requires: gcc >= 2.96-98
162
163 %package doc
164 Summary: Various documentation bits found in the kernel source.
165 Group: Documentation
166
167 %description
168 The kernel package contains the Linux kernel (vmlinuz), the core of a
169 Linux operating system.  The kernel handles the basic functions of the
170 operating system: memory allocation, process allocation, device input
171 and output, etc.
172
173 %description source
174 The kernel-source package contains the source code files for the Linux
175 kernel. These source files are needed to build custom/third party device
176 drivers. The source files can also be used to build a custom kernel that is
177 better tuned to your particular hardware, if you are so inclined (and you
178 know what you're doing).
179
180 %description doc
181 This package contains documentation files form the kernel
182 source. Various bits of information about the Linux kernel and the
183 device drivers shipped with it are documented in these files. 
184
185 You'll want to install this package if you need a reference to the
186 options that can be passed to Linux kernel modules at load time.
187
188 %package smp
189 Summary: The Linux kernel compiled for SMP machines.
190 Group: System Environment/Kernel
191 Provides: module-info, kernel = %{version}
192 %ifarch %{all_x86} ia64 x86_64
193 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
194 %endif
195 Prereq: %{kernel_prereq}
196 Conflicts: %{kernel_conflicts}
197
198 %description smp
199 This package includes a SMP version of the Linux kernel. It is
200 required only on machines with two or more CPUs, although it should
201 work fine on single-CPU boxes.
202
203 Install the kernel-smp package if your machine uses two or more CPUs.
204
205 %package bigmem
206 Summary: The Linux Kernel for machines with more than 4 Gigabyte of memory.
207 Group: System Environment/Kernel
208 Provides: module-info, kernel = %{version}
209 %ifarch %{all_x86} ia64 x86_64
210 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
211 %endif
212 Prereq: %{kernel_prereq}
213 Conflicts: %{kernel_conflicts}
214 Obsoletes: kernel-enterprise <= 2.4.10
215
216 %description bigmem
217 This package includes a kernel that has appropriate configuration options
218 enabled for Pentium III machines with 4 Gigabyte of memory or more.
219
220 %package BOOT
221 Summary: The version of the Linux kernel used on installation boot disks.
222 Group: System Environment/Kernel
223 Provides: kernel = %{version}
224 Prereq: %{BOOT_kernel_prereq}
225 Conflicts: %{kernel_conflicts}
226
227 %description BOOT
228 This package includes a trimmed down version of the Linux kernel.
229 This kernel is used on the installation boot disks only and should not
230 be used for an installed system, as many features in this kernel are
231 turned off because of the size constraints.
232
233 %package BOOTsmp
234 Summary: The Linux kernel used on installation boot disks for SMP machines.
235 Group: System Environment/Kernel
236 Provides: kernel = %{version}
237 Prereq: %{BOOT_kernel_prereq}
238 Conflicts: %{kernel_conflicts}
239
240 %description BOOTsmp
241 This package includes a trimmed down version of the Linux kernel. This
242 kernel is used on the installation boot disks only and should not be used
243 for an installed system, as many features in this kernel are turned off
244 because of the size constraints. This kernel is used when booting SMP
245 machines that have trouble coming up to life with the uniprocessor kernel.
246
247 %package jensen
248 Summary: The Linux Kernel compiled for the Alpha Jensen platform.
249 Group: System Environment/Kernel
250 Provides: kernel = %{version}
251 Prereq: %{kernel_prereq}
252 Conflicts: %{kernel_conflicts}
253
254 %description jensen
255 This package includes a kernel that has appropriate configuration
256 options enabled for use on the Alpha Jensen platform.  The Jensen
257 platform is not supported in the normal generic alpha kernel support.
258
259 %package -n lustre-lite-utils
260 Summary: Lustre utils for Linux
261 Group: Applications/System
262
263 %description -n lustre-lite-utils
264 The Lustre Lite file system utilities.  This includes the tools needed
265 to configure, mount, and administer a Lustre filesystem.  This package
266 is necessary if you want to access a Lustre filesystem.
267
268 # the lustre-doc files are just included as %doc wiht
269 # lustre-lite-utils
270
271 #%package -n lustre-doc
272 #Summary: Sample Lustre configurations and documentation
273 #Group: Documentation
274
275 #%description -n lustre-doc
276 #The Lustre book, sample configurations, and other documentation for
277 #Lustre.
278
279 %package -n lustre-ldap
280 Summary: LDAP schema files for Lustre
281 Group: System Environment/Daemons
282
283 %description -n lustre-ldap
284 LDAP schema files for Lustre.  These are needed if you plan to store
285 your Lustre configuration in LDAP, rather than on disk.
286
287 %prep
288 %setup -n lustre-kernel-%{version} -q -c
289 if [ ! -d lustre ] ; then
290     ln -sf lustre* lustre
291 fi
292 pushd lustre >/dev/null
293 sh -x ./scripts/lmake \
294         --unpack-kernel \
295         --target @LUSTRE_TARGET@ \
296         --kerneldir $RPM_SOURCE_DIR
297 popd >/dev/null
298
299 %build
300 # if RPM_BUILD_NCPUS unset, set it
301 if [ -z "$RPM_BUILD_NCPUS" ] ; then
302     RPM_BUILD_NCPUS=$(egrep -c "^cpu[0-9]+" /proc/stat || :)
303     if [ $RPM_BUILD_NCPUS -eq 0 ] ; then
304         RPM_BUILD_NCPUS=1
305     fi
306     if [ $RPM_BUILD_NCPUS -gt 8 ] ; then
307         RPM_BUILD_NCPUS=8
308     fi
309 fi
310
311 rm -rf $RPM_BUILD_ROOT
312 mkdir -p $RPM_BUILD_ROOT
313
314 DependKernel()
315 {
316   target_config=${1:+--target-config $1}
317   sh -x ./scripts/lmake \
318         --depend-kernel \
319         --target @LUSTRE_TARGET@ \
320         --target-arch %{_target_cpu} \
321         ${target_config} \
322         --extraversion %{release} \
323         -j $RPM_BUILD_NCPUS
324 }
325
326 BuildKernel()
327 {
328   target_config=${1:+--target-config $1}
329   sh -x ./scripts/lmake \
330         --build-kernel --build-lustre \
331         --install \
332         --target @LUSTRE_TARGET@ \
333         --target-arch %{_target_cpu} \
334         ${target_config} \
335         --extraversion %{release} \
336         --kerneldir $RPM_SOURCE_DIR \
337         -j $RPM_BUILD_NCPUS \
338         --destdir $RPM_BUILD_ROOT \
339         -- @CONFIGURE_FLAGS@
340 }
341
342 BuildLustre()
343 {
344   target_config=${1:+--target-config $1}
345   sh -x ./scripts/lmake \
346         --build-lustre \
347         --install-lustre \
348         --target @LUSTRE_TARGET@ \
349         --target-arch %{_target_cpu} \
350         ${target_config} \
351         --extraversion %{kextraver} \
352         --kerneldir $RPM_SOURCE_DIR \
353         -j $RPM_BUILD_NCPUS \
354         --destdir $RPM_BUILD_ROOT \
355         -- @CONFIGURE_FLAGS@
356 }
357
358 SaveHeaders()
359 {
360   sh -x ./scripts/lmake \
361         --save-headers \
362         --target @LUSTRE_TARGET@ \
363         --extraversion %{release} \
364         --destdir $RPM_BUILD_ROOT
365 }
366
367 pushd lustre >/dev/null
368
369 %if %{buildbigmem}
370 BuildKernel bigmem
371 %endif
372
373 %if %{buildBOOT}
374 BuildKernel BOOT
375 %endif
376
377 %if %{buildjensen}
378 BuildKernel jensen
379 %endif
380
381 %if %{buildsmp}
382 BuildKernel smp
383 %endif
384
385 # we want this one last, so that it is the one populating /usr/bin
386 %if %{buildup} && %{buildbase}
387 BuildKernel
388 %elseif %{buildbase}
389 BuildLustre
390 %endif
391
392 %if %{buildbase}
393 SaveHeaders
394 %endif
395
396 popd >/dev/null
397
398 %install
399 pushd lustre >/dev/null
400 # it's already installed, so just clean up some things that are rpm
401 # specific
402 for i in $RPM_BUILD_ROOT/lib/modules/* ; do
403   rm -f $i/modules.*
404   rm -f $i/build
405   ln -sf ../../../usr/src/linux-%{KVERREL} $i/build
406 %ifarch %{ntplarchs}
407   # remove legacy pcmcia symlink that's no longer useful
408   rm -rf $i/pcmcia
409 %endif
410 done
411
412 # mark the vmlinux* non-executable to fool strip-to-file
413 chmod a-x $RPM_BUILD_ROOT/boot/vmlinux*
414
415 ##
416 ## do -source package cleanup/install
417 ##
418 %if %{buildbase}
419 pushd linux >/dev/null
420 mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
421 rm -f drivers/net/hamradio/soundmodem/gentbl scripts/mkdep
422 tar cf - . | tar xf - -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
423 perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{release}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile
424 ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
425 # install -m 644 %{SOURCE10}  $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
426
427 #clean up the destination
428 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
429 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs/*
430 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
431 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
432 make -s oldconfig_nonint -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
433 make -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
434 make -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
435
436 #this generates modversions info which we want to include and we may as
437 #well include the depends stuff as well, after we fix the paths
438 make -s depend -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
439 find $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL} -name ".*depend" | \
440 while read file ; do
441     mv $file $file.old
442     sed -e "s|[^ ]*\(/usr/src/linux\)|\1|g" < $file.old > $file
443     rm -f $file.old
444 done
445
446 # Try to put some smarter autoconf.h and version.h files in place
447 pushd $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/include/linux ; {
448 rm -rf modules modversions.h autoconf.h version.h
449 cat > modversions.h <<EOF
450 #ifndef _LINUX_MODVERSIONS_H
451 #define _LINUX_MODVERSIONS_H
452 #include <linux/rhconfig.h>
453 #include <linux/modsetver.h>
454 EOF
455 echo '#include <linux/rhconfig.h>' > autoconf.h
456 list=`find ../../savedheaders/* -name '*.ver' -exec basename '{}' \; | sort`
457 mkdir modules
458 for l in $list; do
459     sed 's,$,modules/'$l, ../../savedheaders/list | awk -f %{SOURCE17} > modules/$l
460     touch -r modules/$l modules/`basename $l .ver`.stamp
461     echo '#include <linux/modules/'$l'>' >> modversions.h
462 done
463 echo '#endif' >> modversions.h
464 sed 's,$,autoconf.h,' ../../savedheaders/list | awk -f %{SOURCE16} >> autoconf.h
465 # install -m 644 %{SOURCE15} rhconfig.h
466 echo "#include <linux/rhconfig.h>" >> version.h
467 keyword=if
468 for i in smp BOOT BOOTsmp bigmem  up ; do
469 # When we build in an i386, we don't have an bigmem header directory
470 # in savedheaders/i386/bigmem.  We also don't have a BOOT directory
471 # anywhere except in savedheaders/i386.  So, we need to use this method
472 # of determining if a kernel version string needs to be included in the
473 # version.h file
474     verh=`echo ../../savedheaders/*/$i/version.h | awk ' { print $1 } '`
475     if [ -n "$verh" -a -f "$verh" ]; then
476         if [ "$i" = up ]; then
477             if [ "$keyword" = if ]; then
478                 echo "#if 0" >> version.h
479             fi
480             echo "#else" >> version.h
481         else
482             echo "#$keyword defined(__module__$i)" >> version.h
483             keyword=elif
484         fi
485         grep UTS_RELEASE $verh >> version.h
486     fi
487 done
488 echo "#endif" >> version.h
489 if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
490     # keep to a standard normally
491     HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
492 else
493     # test build not including uniprocessor, must get info from somewhere
494     HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -1)
495 fi
496 grep -v UTS_RELEASE $HEADER_FILE >> version.h
497 rm -rf ../../savedheaders
498 } ; popd
499 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
500
501 rm -f $RPM_BUILD_ROOT/usr/include/linux
502
503 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
504
505 # fix up the tmp_include_depends file wrt the buildroot
506 perl -p -i -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/tmp_include_depends
507 popd >/dev/null
508 %endif
509
510 popd >/dev/null
511
512 %clean
513 rm -rf $RPM_BUILD_ROOT
514
515 ###
516 ### scripts
517 ###
518
519 # do this for upgrades...in case the old modules get removed we have
520 # loopback in the kernel so that mkinitrd will work.
521 %pre 
522 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
523 exit 0
524
525 %pre smp
526 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
527 exit 0
528
529 %pre bigmem
530 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
531 exit 0
532
533 %post 
534 cd /boot
535 %ifnarch ia64 
536 ln -sf vmlinuz-%{KVERREL} vmlinuz
537 %endif
538 ln -sf System.map-%{KVERREL} System.map
539 ln -sf module-info-%{KVERREL} module-info
540 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
541 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
542 if [ -x /sbin/new-kernel-pkg ] ; then
543         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}
544 fi
545
546
547 %post smp
548 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
549 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
550 if [ -x /sbin/new-kernel-pkg ] ; then
551         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}smp
552 fi
553
554 %post bigmem
555 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
556 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
557 if [ -x /sbin/new-kernel-pkg ] ; then
558         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}bigmem
559 fi
560
561 %post jensen
562 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
563 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
564 if [ -x /sbin/new-kernel-pkg ] ; then
565         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}jensen
566 fi
567
568 %ifnarch ia64
569 %post BOOT
570 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade
571 [ -x /sbin/mkkerneldoth ] && /sbin/mkkerneldoth
572 if [ -x /sbin/new-kernel-pkg ] ; then
573         /sbin/new-kernel-pkg --mkinitrd --depmod --install %{KVERREL}BOOT
574 fi
575
576 %endif
577
578 # Allow clean removal of modules directory
579 %preun 
580 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
581 #rm -f /lib/modules/%{KVERREL}/modules.*
582 if [ -x /sbin/new-kernel-pkg ] ; then
583  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}
584 fi
585
586
587 %preun smp
588 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
589 rm -f /lib/modules/%{KVERREL}smp/modules.*
590 if [ -x /sbin/new-kernel-pkg ] ; then
591  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}smp
592 fi
593
594
595 %preun bigmem
596 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
597 rm -f /lib/modules/%{KVERREL}bigmem/modules.*
598 if [ -x /sbin/new-kernel-pkg ] ; then
599  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}bigmem
600 fi
601
602
603 %preun BOOT
604 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
605 #rm -f /lib/modules/%{KVERREL}BOOT/modules.*
606 if [ -x /sbin/new-kernel-pkg ] ; then
607  /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}BOOT
608 fi
609
610
611 %preun jensen
612 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
613 #rm -f /lib/modules/%{KVERREL}jensen/modules.*
614
615
616 # We need this here because we don't prereq kudzu; it could be
617 # installed after the kernel
618 %triggerin -- kudzu
619 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
620
621 %triggerin smp -- kudzu
622 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
623
624 %triggerin bigmem -- kudzu
625 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
626
627 %triggerin BOOT -- kudzu
628 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
629
630 %triggerin jensen -- kudzu
631 [ -x /usr/sbin/module_upgrade ] && /usr/sbin/module_upgrade || :
632
633
634 # Old kernel-headers packages owned include symlinks; new
635 # ones just make them so that we can have multiple kernel-headers
636 # packages installed.
637
638 %triggerpostun source -- kernel-headers < 2.2.16
639 cd /usr/src
640 rm -f %{kslnk}
641 ln -snf linux-%{KVERREL} %{kslnk}
642 exit 0
643
644 %post source
645 cd /usr/src
646 rm -f %{kslnk}
647 ln -snf linux-%{KVERREL} %{kslnk}
648
649 %postun source
650 if [ -L /usr/src/%{kslnk} ]; then 
651     if [ -L /usr/src/%{kslnk} -a `ls -ld /usr/src/%{kslnk} 2>/dev/null| awk '{ print $11 }'` = "linux-%{KVERREL}" ]; then
652         [ $1 = 0 ] && rm -f /usr/src/%{kslnk}
653     fi
654 fi
655 exit 0
656
657 ###
658 ### file lists
659 ###
660
661 %if %{buildup}
662 %files
663 %defattr(-, root, root)
664 /boot/%{kernel_glob}
665 %ifarch ia64
666 /boot/efi/redhat/%{kernel_glob}
667 %endif
668 /boot/System.map-%{KVERREL}
669 /boot/config-%{KVERREL}
670 %dir /lib/modules
671 %dir /dev/shm
672 /lib/modules/%{KVERREL}
673 %endif
674
675 %if %{buildsmp}
676 %files smp
677 %defattr(-, root, root)
678 /boot/%{kernel_glob}smp
679 %ifarch ia64
680 /boot/efi/redhat/%{kernel_glob}smp
681 %endif
682 /boot/System.map-%{KVERREL}smp
683 /boot/config-%{KVERREL}smp
684 %dir /lib/modules
685 %dir /dev/shm
686 /lib/modules/%{KVERREL}smp
687 %endif
688
689 %if %{buildbigmem}
690 %files bigmem
691 %defattr(-, root, root)
692 /boot/%{kernel_glob}bigmem
693 %ifarch ia64
694 /boot/efi/redhat/%{kernel_glob}bigmem
695 %endif
696 /boot/System.map-%{KVERREL}bigmem
697 /boot/config-%{KVERREL}bigmem
698 %dir /lib/modules
699 %dir /dev/shm
700 /lib/modules/%{KVERREL}bigmem
701 %endif
702
703 %if %{buildBOOT}
704 %files BOOT
705 %defattr(-, root, root)
706 /boot/%{kernel_glob}BOOT
707 %ifarch ia64
708 /boot/efi/redhat/%{kernel_glob}BOOT
709 %endif
710 /boot/System.map-%{KVERREL}BOOT
711 /boot/config-%{KVERREL}BOOT
712 %dir /lib/modules
713 %dir /dev/shm
714 /lib/modules/%{KVERREL}BOOT
715 %endif
716
717 %if %{buildbase}
718
719 %if 1
720 %files source
721 %defattr(-,root,root)
722 %dir /usr/src/linux-%{KVERREL}
723 /usr/src/linux-%{KVERREL}/COPYING*
724 /usr/src/linux-%{KVERREL}/CREDITS
725 /usr/src/linux-%{KVERREL}/Documentation
726 /usr/src/linux-%{KVERREL}/MAINTAINERS
727 /usr/src/linux-%{KVERREL}/Makefile
728 /usr/src/linux-%{KVERREL}/README
729 /usr/src/linux-%{KVERREL}/REPORTING-BUGS
730 /usr/src/linux-%{KVERREL}/Rules.make
731 /usr/src/linux-%{KVERREL}/arch
732 %ifarch sparc
733 /usr/src/linux-%{KVERREL}/arch/sparc64
734 %endif
735 /usr/src/linux-%{KVERREL}/drivers
736 /usr/src/linux-%{KVERREL}/crypto
737 /usr/src/linux-%{KVERREL}/fs
738 /usr/src/linux-%{KVERREL}/init
739 /usr/src/linux-%{KVERREL}/ipc
740 /usr/src/linux-%{KVERREL}/kernel
741 /usr/src/linux-%{KVERREL}/lib
742 /usr/src/linux-%{KVERREL}/mm
743 /usr/src/linux-%{KVERREL}/net
744 /usr/src/linux-%{KVERREL}/scripts
745 %ifarch %{all_x86}
746 %{?ibcs_1:/usr/src/linux-%{KVERREL}/abi}
747 %endif
748 /usr/src/linux-%{KVERREL}/configs
749 /usr/src/linux-%{KVERREL}/include
750 /usr/src/linux-%{KVERREL}/include/asm
751 %ifarch %{all_x86}
752 %{?ibcs_1:/usr/src/linux-%{KVERREL}/include/abi}
753 %endif
754 /usr/src/linux-%{KVERREL}/include/linux
755 /usr/src/linux-%{KVERREL}/include/rxrpc
756 /usr/src/linux-%{KVERREL}/include/net
757 /usr/src/linux-%{KVERREL}/include/pcmcia
758 /usr/src/linux-%{KVERREL}/include/scsi
759 /usr/src/linux-%{KVERREL}/include/video
760 /usr/src/linux-%{KVERREL}/tmp_include_depends
761 %dir /usr/src/linux-%{KVERREL}/include
762 %dir /usr/src/linux-%{KVERREL}/arch
763 %ifarch alpha sparc
764 /usr/src/linux-%{KVERREL}/include/math-emu
765 %endif
766 %endif
767
768 %files doc
769 %defattr(-,root,root)
770 %doc lustre/linux/Documentation/*
771
772 %files -n lustre-lite-utils
773 %defattr(-, root, root)
774 %doc lustre/COPYING lustre/BUGS lustre/ChangeLog lustre/README lustre/doc/lustre.pdf
775 %{_sbindir}/*
776 %{_bindir}/*
777 %{_libdir}/lustre/python
778 %{_sysconfdir}/init.d/lustre
779 /usr/include/lustre
780 /lib/lib*.a
781
782 #%files -n lustre-doc
783 #%defattr(-, root, root)
784 #/usr/share/doc/lustre/COPYING
785 #/usr/share/doc/lustre/lustre.pdf
786 #/usr/share/doc/lustre/COPYING
787
788 /usr/lib/lustre/examples
789
790 %files -n lustre-ldap
791 %defattr(-, root, root)
792 /etc/openldap/slapd-lustre.conf
793 /etc/openldap/schema/lustre.schema
794 /usr/lib/lustre/lustre2ldif.xsl
795 /usr/lib/lustre/top.ldif
796
797 %endif # %{buildbase}