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