Whamcloud - gitweb
file vibnal.c was initially added on branch b1_4_smallfix_iib.
[fs/lustre-release.git] / lustre / scripts / lustre-kernel-2.4.spec.in
index 0ff57ea..3aad090 100644 (file)
@@ -21,6 +21,7 @@ Summary: The Linux kernel (the core of the Linux operating system)
 %define nptlarchs %{all_x86}
 #define nptlarchs noarch
 %define rhbuild @RHBUILD@
+%define linux26 @LINUX26@
 
 # disable build root strip policy
 %define __spec_install_post /usr/lib/rpm/brp-compress || :
@@ -105,8 +106,11 @@ Second, per-architecture exclusions (ifarch)
 
 %{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}
 
+%if %{rhbuild}
 %define BOOT_kernel_prereq fileutils, modutils >=  2.4.18
 %define kernel_prereq %{BOOT_kernel_prereq}, initscripts >= 5.83, mkinitrd >= 3.2.6
+%endif
+
 %ifarch ia64
 %define initrd_dir /boot/efi/redhat
 %else
@@ -139,11 +143,13 @@ BuildConflicts: rhbuildsys(DiscFree) < 500Mb
 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
 %endif
 Autoreqprov: no
+%if %{rhbuild}
 Prereq: %{kernel_prereq}
 Conflicts: %{kernel_conflicts}
 
 BuildPreReq: patch >= 2.5.4, bash >= 2.03, sh-utils, gnupg, tar
 BuildPreReq: bzip2, findutils, dev, gzip, m4
+%endif
 
 Vendor: Cluster File Systems, Inc.
 URL: http://www.kernel.org/
@@ -195,8 +201,10 @@ Provides: module-info, kernel = %{version}
 %ifarch %{all_x86} ia64 x86_64
 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
 %endif
+%if %{rhbuild}
 Prereq: %{kernel_prereq}
 Conflicts: %{kernel_conflicts}
+%endif
 
 %description smp
 This package includes a SMP version of the Linux kernel. It is
@@ -212,9 +220,11 @@ Provides: module-info, kernel = %{version}
 %ifarch %{all_x86} ia64 x86_64
 Provides: kernel-drm = 4.1.0, kernel-drm = 4.2.0, kernel-drm = 4.3.0, kernel-drm = 4.2.99.3
 %endif
+%if %{rhbuild}
 Prereq: %{kernel_prereq}
 Conflicts: %{kernel_conflicts}
 Obsoletes: kernel-enterprise <= 2.4.10
+%endif
 
 %description bigmem
 This package includes a kernel that has appropriate configuration options
@@ -224,8 +234,10 @@ enabled for Pentium III machines with 4 Gigabyte of memory or more.
 Summary: The version of the Linux kernel used on installation boot disks.
 Group: System Environment/Kernel
 Provides: kernel = %{version}
+%if %{rhbuild}
 Prereq: %{BOOT_kernel_prereq}
 Conflicts: %{kernel_conflicts}
+%endif
 
 %description BOOT
 This package includes a trimmed down version of the Linux kernel.
@@ -237,8 +249,10 @@ turned off because of the size constraints.
 Summary: The Linux kernel used on installation boot disks for SMP machines.
 Group: System Environment/Kernel
 Provides: kernel = %{version}
+%if %{rhbuild}
 Prereq: %{BOOT_kernel_prereq}
 Conflicts: %{kernel_conflicts}
+%endif
 
 %description BOOTsmp
 This package includes a trimmed down version of the Linux kernel. This
@@ -251,8 +265,10 @@ machines that have trouble coming up to life with the uniprocessor kernel.
 Summary: The Linux Kernel compiled for the Alpha Jensen platform.
 Group: System Environment/Kernel
 Provides: kernel = %{version}
+%if %{rhbuild}
 Prereq: %{kernel_prereq}
 Conflicts: %{kernel_conflicts}
+%endif
 
 %description jensen
 This package includes a kernel that has appropriate configuration
@@ -339,7 +355,12 @@ BuildKernel()
        --kerneldir $RPM_SOURCE_DIR \
        -j $RPM_BUILD_NCPUS \
        --destdir $RPM_BUILD_ROOT \
-       -- @CONFIGURE_FLAGS@
+        -- --enable-modules \
+        --disable-doc --disable-tests \
+        --disable-utils --disable-liblustre \
+        --sysconfdir=%{_sysconfdir} \
+        --mandir=%{_mandir} \
+        @CONFIGURE_FLAGS@
 }
 
 BuildLustre()
@@ -355,7 +376,12 @@ BuildLustre()
        --kerneldir $RPM_SOURCE_DIR \
        -j $RPM_BUILD_NCPUS \
        --destdir $RPM_BUILD_ROOT \
-       -- @CONFIGURE_FLAGS@
+        -- --enable-utils \
+        --disable-doc --disable-tests \
+        --disable-modules --disable-liblustre \
+        --sysconfdir=%{_sysconfdir} \
+        --mandir=%{_mandir} \
+        @CONFIGURE_FLAGS@
 }
 
 SaveHeaders()
@@ -385,14 +411,12 @@ BuildKernel jensen
 BuildKernel smp
 %endif
 
-# we want this one last, so that it is the one populating /usr/bin
-%if %{buildup} && %{buildbase}
+%if %{buildup}
 BuildKernel
-%elseif %{buildbase}
-BuildLustre
 %endif
 
 %if %{buildbase}
+BuildLustre
 SaveHeaders
 %endif
 
@@ -429,11 +453,21 @@ ln -sf linux-%{KVERREL} $RPM_BUILD_ROOT/usr/src/linux
 
 #clean up the destination
 make -s mrproper -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
-rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs/*
+rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
+mkdir -p $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@*.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/configs
 cp ../kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config
-make -s oldconfig_nonint -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
+if grep -q oldconfig_nonint $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile ; then
+       OLDCONFIG='oldconfig_nonint'
+else
+       OLDCONFIG='oldconfig'
+fi
+make -s $OLDCONFIG -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
+%if %{linux26}
+make -s include/asm -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
+%else
 make -s symlinks -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
+%endif
 make -s include/linux/version.h -C $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}
 
 #this generates modversions info which we want to include and we may as
@@ -494,14 +528,14 @@ if [ -f ../../savedheaders/%{_target_cpu}/up/version.h ] ; then
     HEADER_FILE=../../savedheaders/%{_target_cpu}/up/version.h
 else
     # test build not including uniprocessor, must get info from somewhere
-    HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -1)
+    HEADER_FILE=$(ls ../../savedheaders/*/*/version.h | head -1)
 fi
 grep -v UTS_RELEASE $HEADER_FILE >> version.h
 rm -rf ../../savedheaders
 } ; popd
 touch $RPM_BUILD_ROOT/boot/kernel.h-%{kversion}
 
-rm -f $RPM_BUILD_ROOT/usr/include/linux
+#rm -f $RPM_BUILD_ROOT/usr/include/linux
 
 rm -rf $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/savedheaders
 
@@ -581,6 +615,17 @@ fi
 
 %endif
 
+%post -n lustre-lite-utils
+if [ ! -e /dev/obd ]; then
+   mknod /dev/obd c 10 241
+fi
+if [ ! -e /dev/portals ]; then
+   mknod /dev/portals c 10 240
+fi
+/sbin/chkconfig --add lustre
+/sbin/chkconfig --add lustrefs
+
+
 # Allow clean removal of modules directory
 %preun 
 /sbin/modprobe loop 2> /dev/null > /dev/null  || :
@@ -660,6 +705,13 @@ if [ -L /usr/src/%{kslnk} ]; then
 fi
 exit 0
 
+%preun -n lustre-lite-utils
+if [ $1 = 0 ]; then
+  /sbin/chkconfig --del lustre
+  /sbin/chkconfig --del lustrefs
+fi
+
+
 ###
 ### file lists
 ###
@@ -726,55 +778,7 @@ exit 0
 %files source
 %defattr(-,root,root)
 %dir /usr/src/linux-%{KVERREL}
-/usr/src/linux-%{KVERREL}/COPYING*
-/usr/src/linux-%{KVERREL}/CREDITS
-/usr/src/linux-%{KVERREL}/Documentation
-/usr/src/linux-%{KVERREL}/MAINTAINERS
-/usr/src/linux-%{KVERREL}/Makefile
-/usr/src/linux-%{KVERREL}/README
-/usr/src/linux-%{KVERREL}/REPORTING-BUGS
-/usr/src/linux-%{KVERREL}/Rules.make
-/usr/src/linux-%{KVERREL}/arch
-%ifarch sparc
-/usr/src/linux-%{KVERREL}/arch/sparc64
-%endif
-/usr/src/linux-%{KVERREL}/drivers
-%if %{rhbuild}
-/usr/src/linux-%{KVERREL}/crypto
-%endif
-/usr/src/linux-%{KVERREL}/fs
-/usr/src/linux-%{KVERREL}/init
-/usr/src/linux-%{KVERREL}/ipc
-/usr/src/linux-%{KVERREL}/kernel
-/usr/src/linux-%{KVERREL}/lib
-/usr/src/linux-%{KVERREL}/mm
-/usr/src/linux-%{KVERREL}/net
-/usr/src/linux-%{KVERREL}/scripts
-%ifarch %{all_x86}
-%{?ibcs_1:/usr/src/linux-%{KVERREL}/abi}
-%endif
-/usr/src/linux-%{KVERREL}/configs
-/usr/src/linux-%{KVERREL}/include
-/usr/src/linux-%{KVERREL}/include/asm
-%ifarch %{all_x86}
-%{?ibcs_1:/usr/src/linux-%{KVERREL}/include/abi}
-%endif
-/usr/src/linux-%{KVERREL}/include/linux
-%if %{rhbuild}
-/usr/src/linux-%{KVERREL}/include/rxrpc
-%endif
-/usr/src/linux-%{KVERREL}/include/net
-/usr/src/linux-%{KVERREL}/include/pcmcia
-/usr/src/linux-%{KVERREL}/include/scsi
-/usr/src/linux-%{KVERREL}/include/video
-%if %{rhbuild}
-/usr/src/linux-%{KVERREL}/tmp_include_depends
-%endif
-%dir /usr/src/linux-%{KVERREL}/include
-%dir /usr/src/linux-%{KVERREL}/arch
-%ifarch alpha sparc
-/usr/src/linux-%{KVERREL}/include/math-emu
-%endif
+/usr/src/linux-%{KVERREL}/*
 %endif
 
 %files doc
@@ -785,12 +789,17 @@ exit 0
 %defattr(-, root, root)
 %doc lustre/COPYING lustre/BUGS lustre/ChangeLog lustre/README lustre/doc/lustre.pdf
 /sbin/*
-%{_sbindir}/*
-%{_bindir}/*
-%{_libdir}/lustre/python
-%{_sysconfdir}/init.d/lustre
-/usr/include/lustre
-/lib/lib*.a
+/usr/sbin/*
+/usr/bin/*
+/usr/lib/lustre
+/usr/share/lustre
+/etc/init.d/lustre
+/etc/init.d/lustrefs
+/usr/include/lustre/*
+/usr/include/portals/*
+/usr/include/linux/*
+/usr/lib/lib*.a
+/usr/share/man/man?/*
 
 #%files -n lustre-doc
 #%defattr(-, root, root)
@@ -798,13 +807,13 @@ exit 0
 #/usr/share/doc/lustre/lustre.pdf
 #/usr/share/doc/lustre/COPYING
 
-/usr/lib/lustre/examples
-
+/usr/share/lustre/examples
 %files -n lustre-ldap
 %defattr(-, root, root)
 /etc/openldap/slapd-lustre.conf
 /etc/openldap/schema/lustre.schema
-/usr/lib/lustre/lustre2ldif.xsl
-/usr/lib/lustre/top.ldif
+/usr/share/lustre/lustre2ldif.xsl
+/usr/share/lustre/top.ldif
+
 
 %endif # %{buildbase}