--- ./core/CMakeLists.txt.orig	2013-03-29 14:22:50.000000000 +0000
+++ ./core/CMakeLists.txt	2014-07-29 09:31:46.000000000 +0100
@@ -27,9 +27,9 @@
 add_custom_target(userfw_core_kmod ALL
 	DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/userfw.ko")
 
-install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=${CMAKE_INSTALL_PREFIX}\"
+install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\"
 		WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\")")
 if (DOMAIN_STUB)
-	install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=${CMAKE_INSTALL_PREFIX}\"
+	install(CODE "execute_process(COMMAND make install \"KMODDIR=${KMODDIR}\" \"PREFIX=\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}\"
 			WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/domain_stub\")")
 endif (DOMAIN_STUB)
