Whamcloud - gitweb
LU-3497 build: Use alt. path for ZFS development headers
[fs/lustre-release.git] / contrib / lbuild / lbuild
index fc1c705..30ae2af 100755 (executable)
@@ -905,10 +905,10 @@ build_lustre() {
     fi
 
     $RPMBUILD $targets $rpmbuildopt "$LUSTRE" \
-        ${is_patchless:+--define "lustre_name lustre-client"} \
-        ${lustre_tests:+--define "build_lustre_tests 0"} \
-        ${osd_zfs:+--define "build_lustre_osd_zfs 1"} \
-        ${osd_ldiskfs:+--define "build_lustre_osd_ldiskfs 1"} \
+        ${is_patchless:+--without servers} \
+        ${lustre_tests:+--without lustre_tests} \
+        ${osd_zfs:+--with zfs} \
+        ${osd_ldiskfs:+--with ldiskfs} \
         ${FIND_REQUIRES:+--define "__find_requires $FIND_REQUIRES"} \
         --define "configure_args $confoptions ${CONFIGURE_FLAGS}" \
         --define "kdir $linux" \
@@ -919,8 +919,8 @@ build_lustre() {
 
     if $DO_SRC; then
         if ! $RPMBUILD -ts "$LUSTRE" \
-                 ${is_patchless:+--define "lustre_name lustre-client"} \
-                 ${lustre_tests:+--define "build_lustre_tests 0"} \
+                 ${is_patchless:+--without servers} \
+                 ${lustre_tests:+--without lustre_tests} \
                  ${FIND_REQUIRES:+--define "__find_requires $FIND_REQUIRES"} \
                  --define "configure_args $confoptions ${CONFIGURE_FLAGS}" \
                  --define "kdir $linux" \
@@ -1048,6 +1048,16 @@ build_spl_zfs() {
        for rpm in $rpms; do
             rpm2cpio $rpm | cpio -id
        done
+
+        if [ "$pkg" == "zfs" ]; then
+            mkdir -p $TOPDIR/zfsdevel
+            pushd $TOPDIR/zfsdevel
+            # We also need to extract zfs-devel rpm
+            local devel_rpm=$(ls -1 $TOPDIR/RPMS/*/$pkg-devel-*.rpm)
+            rpm2cpio $devel_rpm | cpio -id
+            popd
+            CONFIGURE_FLAGS="--with-$pkg-devel=$TOPDIR/zfsdevel ${CONFIGURE_FLAGS}"
+        fi
         popd
 
         CONFIGURE_FLAGS="--with-$pkg=$(ls -d $TOPDIR/usr/src/$pkg-*/|tail -1) ${CONFIGURE_FLAGS}"