X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Flustre-kernel-2.4.spec.in;h=93450aeefc295dbaa01b6d5b9a8a4fb7189b1107;hb=c27a04734b4dff552dfe2034cc29bd24556778fb;hp=88fb4c7e86faaba31c03ae3914c8dffe1d0f59de;hpb=cfaf31a01d1e3023611130ec1f8ece073f0092b9;p=fs%2Flustre-release.git diff --git a/build/lustre-kernel-2.4.spec.in b/build/lustre-kernel-2.4.spec.in index 88fb4c7..93450ae 100644 --- a/build/lustre-kernel-2.4.spec.in +++ b/build/lustre-kernel-2.4.spec.in @@ -10,6 +10,7 @@ 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 release @KERNEL_RELEASE@ # /usr/src/%{kslnk} -> /usr/src/linux-%{KVERREL} %define kslnk linux-2.4 @@ -149,7 +150,7 @@ Second, per-architecture exclusions (ifarch) 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 +354,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 +365,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 @@ -538,7 +536,7 @@ BuildKernel() --kerneldir $RPM_SOURCE_DIR \ -j $RPM_BUILD_NCPUS \ --destdir $RPM_BUILD_ROOT \ - -- --disable-tests \ + -- --enable-tests \ @CONFIGURE_FLAGS@ } @@ -634,7 +632,7 @@ BuildObj () flavext="-$flavor" flavtgt="$flavor" fi - perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{kextraver}${flavtgt}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile + perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = %{kextraverdelim}%{kextraver}${flavtgt}/" $RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}/Makefile c="$RPM_BUILD_ROOT/usr/src/linux-%{KVERREL}" o="${c}-obj/%{_target_cpu}/$flavor" mkdir -p $o @@ -656,16 +654,25 @@ BuildObj () $MAKE clean rm -rf $o/.config.old $o/include/config # Replace the Makefile in the object directory with a version - # that has relative path names. + # that has relative path names. This is done by fixing the Makefile + # after the fact to work with 2.6.17 and newer mkmakefile. read VERSION PATCHLEVEL SUBLEVEL <<-EOF $(set -- 2.6.5 ; echo ${*//./ }) EOF + rm -f $o/Makefile source scripts/mkmakefile \ ../../../linux-%{KVERREL} \ - ../linux-%{KVERREL}-obj/%{_target_cpu}/$flavor \ + $o \ $VERSION \ $PATCHLEVEL \ - > $o/Makefile + > $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}${flavtgt}.gz" \ > $o/Module.symvers } @@ -711,7 +718,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}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 +726,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}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