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