From f10ee6b52252c8e2663da0ec8786b88e570d3f32 Mon Sep 17 00:00:00 2001 From: Todd Lewis Date: Sun, 11 Sep 2011 12:42:47 +0100 Subject: [PATCH] RPM: Fix dkms support on Fedora 15 Newer dkms no longer uses or supplies a $kernelver_array variable; instead it uses $kernelver. The attached patch uses both, one of which will be empty, so the test will do the Right Thing regardless of your dkms version. Further, the "mv" command at the end of the MAKE[0]= line needs lots of back-slashes on each of its parms. We need three to make it all the way to the final dkms.conf file -- so that's six -- plus one more to escape the '$'; that's seven in all. In case there's any question (and with all the back-slashes involved, there should be) about the intent here, the whole point of this patch is to make the final dkms.conf MAKE[0]= line look like this (module line breaks: MAKE[0]="KMODNAME=openafs.ko; DSTKMOD=\".\"; [ \"\`echo \"${kernelver_array[0]}${kernelver[0]}\" | sed -e 's/^\([0-9]*\.[0-9]*\)\..*/\1/'\`\" = \"2.4\" ] && KMODNAME=\"libafs-*\" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=${kernel_source_dir} --with-linux-kernel-packaging; make; mv src/libafs/MODLOAD-*/\\\$KMODNAME \\\$DSTKMOD" This is what was required to get "dkms build ..." to work on Fedora 15, and as near as I can tell it shouldn't break 2.4 or other builds. FIXES 130211 Reviewed-on: http://gerrit.openafs.org/5393 Tested-by: Derrick Brashear Reviewed-by: Derrick Brashear (cherry picked from commit 8e0aaae076f4cccfd2d6ed81ede4e355235b578e) Change-Id: I47b0e24a0cbbd8402d5dd902e7e2af59ca1c30b7 Reviewed-on: http://gerrit.openafs.org/6312 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/packaging/RedHat/openafs.spec.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/packaging/RedHat/openafs.spec.in b/src/packaging/RedHat/openafs.spec.in index e6ba96da88..0fea06a009 100644 --- a/src/packaging/RedHat/openafs.spec.in +++ b/src/packaging/RedHat/openafs.spec.in @@ -1063,7 +1063,7 @@ PACKAGE_VERSION="%{dkms_version}" # Items below here should not have to change with each driver version PACKAGE_NAME="%{name}" -MAKE[0]="KMODNAME=openafs.ko; DSTKMOD=\\".\\"; [ \\"\\\`echo \\"\${kernelver_array[0]}\\" | sed -e 's/^\\([0-9]*\\.[0-9]*\\)\\..*/\\1/'\\\`\\" = \\"2.4\\" ] && KMODNAME=\\"libafs-*\\" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=\${kernel_source_dir} --with-linux-kernel-packaging; make; mv src/libafs/MODLOAD-*/\\\$KMODNAME \\\$DSTKMOD" +MAKE[0]="KMODNAME=openafs.ko; DSTKMOD=\\".\\"; [ \\"\\\`echo \\"\${kernelver_array[0]}\${kernelver[0]}\\" | sed -e 's/^\\([0-9]*\\.[0-9]*\\)\\..*/\\1/'\\\`\\" = \\"2.4\\" ] && KMODNAME=\\"libafs-*\\" && DSTKMOD=openafs.o; ./configure --with-linux-kernel-headers=\${kernel_source_dir} --with-linux-kernel-packaging; make; mv src/libafs/MODLOAD-*/\\\\\\\$KMODNAME \\\\\\\$DSTKMOD" CLEAN="make -C src/libafs clean" BUILT_MODULE_NAME[0]="\$PACKAGE_NAME"