X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Flbuild-sles;h=1e3902d2097a48616758d53a8cb60d806f32b13d;hb=685e948f36fb800543a7bd11427e9bf9a6a9563b;hp=31fd5d6e90a8cc0f4b78fb1d0af91809bb4d16e8;hpb=0c8c2bc67ffba7dbe60dff41c4d1b0c96a749db5;p=fs%2Flustre-release.git diff --git a/build/lbuild-sles b/build/lbuild-sles index 31fd5d6..1e3902d2 100644 --- a/build/lbuild-sles +++ b/build/lbuild-sles @@ -1,13 +1,15 @@ # vim:expandtab:shiftwidth=4:softtabstop=4:tabstop=4: DEVEL_KERNEL_TYPE="source" +RPM_HELPERS_DIR="/usr/lib/rpm" prepare_and_build_srpm() { pushd $TOPDIR >/dev/null - # seems there is a bug (on Ubuntu at least) where all of the .specs - # are not put into SPECS - mv SOURCES/*.spec SPECS/ + # all of the specs but one are put into SOURCES, so let's just move + # the one lone one in SPECS into SOURCES and just reference them from + # there + mv SPECS/*.spec SOURCES/ # generate our buildid local buildid="lustre${EXTRA_VERSION##*_lustre}" @@ -44,7 +46,7 @@ prepare_and_build_srpm() { # now build it if ! $RPMBUILD $rpmbuildopt $targets \ --define "_topdir $TOPDIR" \ - $TOPDIR/SPECS/kernel-$RPMSMPTYPE.spec >&2; then + $TOPDIR/SOURCES/kernel-$RPMSMPTYPE.spec 2>&1; then fatal 1 "Failed to build kernel RPM" fi #fi @@ -52,7 +54,7 @@ prepare_and_build_srpm() { # for SLES, we also need to build the kernel-source rpm if ! $RPMBUILD $rpmbuildopt $targets \ --define "_topdir $TOPDIR" \ - $TOPDIR/SPECS/kernel-source.spec >&2; then + $TOPDIR/SOURCES/kernel-source.spec 2>&1; then fatal 1 "Failed to build kernel source RPM" fi @@ -81,3 +83,39 @@ rpm_BUILD_kernel_dirname() { fi echo kernel${lustre}-${rpmsmptype}-${lnxmaj}${lnxmin}/linux-${lnxmaj} } + +resolve_arch() { + local arch="$1" + + case $arch in + ppc64) arch=powerpc + ;; + i686) arch=i386 + ;; + esac + + echo "$arch" + +} + +find_linux_devel_paths() { + local path="$1" + + LINUX=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel} + LINUXOBJ=$path/usr/src/linux-${lnxmaj}${lnxmin}-${lnxrel}-obj/$(resolve_arch $TARGET_ARCH)/$RPMSMPTYPE + # XXX this has been commented out in th rhel5 build file for a while + # as it says there, it's probably not needed anymore and can be deleted + #LINUXRELEASE=$(find_linux_release "$LINUXOBJ") + #if [ -z "$LINUXRELEASE" ]; then + # echo "Failed to find linux release in $LINUXOBJ" + # return 255 + #fi + + return 0 +} + +mcpu_rpmbuild_opt() { + + echo "--define \'jobs $(/usr/bin/getconf _NPROCESSORS_ONLN)\'" + return 0 +}