[linux-dvb] [PATCH] v4l-dvb: add $DESTDIR support

Ludwig Nussel ludwig.nussel at suse.de
Wed Mar 7 14:49:18 CET 2007


Hi,

Following patch adds $DESTDIR support so one can install the kernel
modules into a directory other than / as non-root user. That's
useful when building an rpm or compiling for a different machine.

Signed-off-by: Ludwig Nussel <ludwig.nussel at suse.de>

diff -r 44676649301d v4l/scripts/make_makefile.pl
--- a/v4l/scripts/make_makefile.pl	Tue Mar 06 19:15:19 2007 +0100
+++ b/v4l/scripts/make_makefile.pl	Wed Mar 07 14:35:40 2007 +0100
@@ -134,12 +134,12 @@ print OUT "\t\@strip --strip-debug \$(in
 
 while (my ($dir, $files) = each %instdir) {
 	print OUT "\t\@echo -e \"\\nInstalling \$(KDIR26)/$dir files:\"\n";
-	print OUT "\t\@install -d \$(KDIR26)/$dir\n";
+	print OUT "\t\@install -d \$(DESTDIR)\$(KDIR26)/$dir\n";
 	print OUT "\t\@for i in ", join(' ', keys %$files), ";do ";
 	print OUT "if [ -e \"\$\$i\" ]; then echo -n \"\$\$i \";";
-	print OUT " install -m 644 -c \$\$i \$(KDIR26)/$dir; fi; done; echo;\n\n";
+	print OUT " install -m 644 -c \$\$i \$(DESTDIR)\$(KDIR26)/$dir; fi; done; echo;\n\n";
 }
-print OUT "\t/sbin/depmod -a \${KERNELRELEASE}\n\n";
+print OUT "\tif [ -w / ]; then /sbin/depmod -a \${KERNELRELEASE}; fi\n\n";
 
 # Creating Remove rule
 print OUT "media-rminstall::\n";

cu
Ludwig

-- 
 (o_   Ludwig Nussel
 //\   SUSE Labs
 V_/_  http://www.suse.de/
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)





More information about the linux-dvb mailing list