diff --git a/lib/phusion_passenger.rb b/lib/phusion_passenger.rb
index e747477..27e82f1 100644
--- a/lib/phusion_passenger.rb
+++ b/lib/phusion_passenger.rb
@@ -94,12 +94,12 @@ module PhusionPassenger
 		# Not available when natively packaged.
 		NATIVE_SUPPORT_DIR = File.join(SOURCE_ROOT, "ext", "ruby")
 	else
-		SOURCE_ROOT        = NATIVELY_PACKAGED_SOURCE_ROOT
-		DOCDIR             = NATIVELY_PACKAGED_DOCDIR
-		RESOURCES_DIR      = NATIVELY_PACKAGED_RESOURCES_DIR
-		AGENTS_DIR         = NATIVELY_PACKAGED_AGENTS_DIR
-		HELPER_SCRIPTS_DIR = NATIVELY_PACKAGED_HELPER_SCRIPTS_DIR
-		APACHE2_MODULE     = NATIVELY_PACKAGED_APACHE2_MODULE
+		SOURCE_ROOT        = '%%GEM_INSTALL_DIR%%'
+		DOCDIR             = "#{SOURCE_ROOT}/doc"
+		RESOURCES_DIR      = "#{SOURCE_ROOT}/resources"
+		HELPER_SCRIPTS_DIR = "#{SOURCE_ROOT}/helper-scripts"
+		APACHE2_MODULE     = '%%APACHE_INSTALLED_MOD%%'
+		NATIVE_SUPPORT_DIR = "#{SOURCE_ROOT}/ext/ruby"
 	end
 	
 	
diff --git a/lib/phusion_passenger/native_support.rb b/lib/phusion_passenger/native_support.rb
index f1edf1c..4312d01 100644
--- a/lib/phusion_passenger/native_support.rb
+++ b/lib/phusion_passenger/native_support.rb
@@ -38,10 +38,7 @@ class NativeSupportLoader
 
 private
 	def archdir
-		@archdir ||= begin
-			require 'phusion_passenger/platform_info/binary_compatibility'
-			PlatformInfo.ruby_extension_binary_compatibility_ids.join("-")
-		end
+		@archdir ||= 'native'
 	end
 	
 	def libext
diff --git a/ext/common/ResourceLocator.h b/ext/common/ResourceLocator.h
index 5f65804..e585d1a 100644
--- a/ext/common/ResourceLocator.h
+++ b/ext/common/ResourceLocator.h
@@ -64,13 +64,13 @@ public:
 				!fileExists(root + "/DEVELOPERS.TXT");
 			
 			if (nativelyPackaged) {
-				agentsDir           = "/usr/lib/phusion-passenger/agents";
-				helperScriptsDir    = "/usr/share/phusion-passenger/helper-scripts";
-				resourcesDir        = "/usr/share/phusion-passenger";
-				docDir              = "/usr/share/doc/phusion-passenger";
+				agentsDir           = "%%GEM_INSTALL_DIR%%/agents";
+				helperScriptsDir    = "%%GEM_INSTALL_DIR%%/helper-scripts";
+				resourcesDir        = "%%GEM_INSTALL_DIR%%";
+				docDir              = "%%GEM_INSTALL_DIR%%/doc";
 				rubyLibDir          = "";
-				compilableSourceDir = "/usr/share/phusion-passenger/compilable-source";
-				apache2Module       = "/usr/lib/apache2/modules/mod_passenger.so";
+				compilableSourceDir = "%%GEM_INSTALL_DIR%%";
+				apache2Module       = "%%APACHE_INSTALLED_MOD%%";
 			} else {
 				agentsDir           = root + "/agents";
 				helperScriptsDir    = root + "/helper-scripts";
