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