X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=build%2Flustre-kernel-2.4.spec.in;h=41efbb3520370886a7d98518e0981108df306394;hp=d7fe38d7eebcb60608c6c0e644a1a41fecc6983b;hb=8e32ec6b2cf34dd91e49d361d416c849b88b2337;hpb=05bb3e59ca9bc34fb58b8bfc65af7d1219f6a821 diff --git a/build/lustre-kernel-2.4.spec.in b/build/lustre-kernel-2.4.spec.in index d7fe38d..41efbb3 100644 --- a/build/lustre-kernel-2.4.spec.in +++ b/build/lustre-kernel-2.4.spec.in @@ -10,6 +10,8 @@ Summary: The Linux kernel (the core of the Linux operating system) # %define kversion @KERNEL_VERSION@ %define kextraver @KERNEL_EXTRA_VERSION@ +%define kextraverdelim @KERNEL_EXTRA_VERSION_DELIMITER@ +%define flavordelim "@KERNEL_TARGET_DELIMITER@" %define release @KERNEL_RELEASE@ # /usr/src/%{kslnk} -> /usr/src/linux-%{KVERREL} %define kslnk linux-2.4 @@ -146,10 +148,10 @@ Second, per-architecture exclusions (ifarch) %define kernel_glob vmlinu?-%{KVERREL} %endif -Name: kernel +Name: kernel-lustre Version: %{kversion} Release: %{release}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg} -%define KVERREL %{PACKAGE_VERSION}-%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg} +%define KVERREL %{PACKAGE_VERSION}%{kextraverdelim}%{kextraver}%{?targetboard:%{targetboard}}%{?debuglevel_1:.dbg} License: GPL Group: System Environment/Kernel ExclusiveArch: %{all_x86} x86_64 ia64 ppc @@ -353,7 +355,7 @@ The Lustre Lite file system utilities. This includes the tools needed to configure, mount, and administer a Lustre filesystem. This package is necessary if you want to access a Lustre filesystem. -# the lustre-doc files are just included as %doc wiht +# the lustre-doc files are just included as %doc with # lustre-lite-utils #%package -n lustre-doc @@ -364,13 +366,10 @@ is necessary if you want to access a Lustre filesystem. #The Lustre book, sample configurations, and other documentation for #Lustre. -%package -n lustre-ldap -Summary: LDAP schema files for Lustre -Group: System Environment/Daemons - -%description -n lustre-ldap -LDAP schema files for Lustre. These are needed if you plan to store -your Lustre configuration in LDAP, rather than on disk. +# This is required in rpm >= 4.4.? and _should_ be set by the %setup macro +# but isn't, at least for 4.4.2. Yay RPM. +%define buildsubdir lustre-kernel-%{version} +%define _buildsubdir lustre-kernel-%{version} %prep %setup -n lustre-kernel-%{version} -q -c @@ -390,11 +389,12 @@ popd >/dev/null # handle both SuSE and Red Hat's new-kernel-pkg bits for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do + [ -n "$flavor" ] && delim_flavor="%{flavordelim}$flavor" for when in pre preun post postun ; do script="${when}${flavor}.sh" cat %{SOURCE25} %{SOURCE32} %{SOURCE33} > ${script} echo "if [ -d /etc/susehelp.d ] ; then" >> ${script} - sed -e "s/@when@/$when/g" -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE28} >> ${script} + sed -e "s/@when@/$when/g" -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE28} >> ${script} case $when in pre) echo "if [ ! -f /etc/modprobe.conf ] ; then" >> ${script} @@ -404,20 +404,20 @@ for flavor in "" smp bigmem bigsmp pseries64 BOOT jensen ; do post) # /sbin/update-modules.dep compares when the modules were built, rather # than installed, so force modules.dep to be recreated - echo "rm -f /lib/modules/%{KVERREL}${flavor}/modules.dep" >> ${script} + echo "rm -f /lib/modules/%{KVERREL}${delim_flavor}/modules.dep" >> ${script} echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script} - sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE26} >> ${script} + sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE26} >> ${script} echo "else" >> ${script} - sed -e "s^%ver_str^%{KVERREL}${flavor}^g" -e "s^%%{cfg_name}^${flavor}^g" %{SOURCE29} >> ${script} + sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" -e "s^%%{cfg_name}^${delim_flavor}^g" %{SOURCE29} >> ${script} echo "fi" >> ${script} ;; postun) echo "if [ -f /etc/modprobe.conf ] ; then" >> ${script} - sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE27} >> ${script} + sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE27} >> ${script} echo "else" >> ${script} - sed -e "s^%ver_str^%{KVERREL}${flavor}^g" %{SOURCE30} >> ${script} + sed -e "s^%ver_str^%{KVERREL}${delim_flavor}^g" %{SOURCE30} >> ${script} echo "fi" >> ${script} ;; esac @@ -442,7 +442,7 @@ if [ -x /sbin/new-kernel-pkg ] ; then PACKAGE_ARG="--package kernel-${flavor}" fi /sbin/new-kernel-pkg $PACKAGE_ARG --mkinitrd --depmod \ - --install %{KVERREL}${flavor} + --install %{KVERREL}${delim_flavor} fi EOF ;; @@ -457,9 +457,9 @@ EOF preun) cat >> ${script} < /dev/null > /dev/null || : -rm -f /lib/modules/%{KVERREL}${flavor}/modules.* +rm -f /lib/modules/%{KVERREL}${delim_flavor}/modules.* if [ -x /sbin/new-kernel-pkg ] ; then - /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}${flavor} + /sbin/new-kernel-pkg --rminitrd --rmmoddep --remove %{KVERREL}${delim_flavor} fi EOF ;; @@ -468,20 +468,20 @@ EOF cat > "kernel$flavor.files" < $o/Makefile - zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavor}.gz" \ + rm -f $o/Makefile + ARCH=%{_target_cpu} /bin/sh scripts/mkmakefile ../../../linux-%{KVERREL} $o \ + $VERSION $PATCHLEVEL > $o/Makefile.in + if [ -f $o/Makefile ] ; then + # will exist only for 2.6.17 and newer because mkmakefile + # now writes the makefile to $o instead of stdout + mv -f $o/Makefile $o/Makefile.in + fi + sed -e "s^$o^../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor^" \ + $o/Makefile.in > $o/Makefile + zcat "$RPM_BUILD_ROOT/boot/symvers-%{KVERREL}-%{_target_cpu}${flavext}.gz" \ > $o/Module.symvers } @@ -711,7 +715,7 @@ if [ "%{buildbase}" -ne 0 ] ; then if [ "%{buildup}" -ne 0 ] ; then BuildObj up fi - perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile + perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}%{flavordelim}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile # Remove $RPM_BUILD_ROOT prefix from symlinks. for link in $(find $objdir -type l); do target=$(readlink $link) @@ -719,7 +723,7 @@ if [ "%{buildbase}" -ne 0 ] ; then ln -s ${target/$RPM_BUILD_ROOT/} $link done else # 2.4 rh-style - perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile + perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}%{flavordelim}custom/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile # get the one from the build we just completed as it might have picked # up new options #cp ../lustre/kernel_patches/kernel_configs/kernel-%{kversion}-@LUSTRE_TARGET@-%{_target_cpu}%{dashtargetboard}.config $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/.config