Ugly hack to make --user-install option work.  Without this, when
a user uses gem install --user-install, it calls
/usr/bin/install -o root -g bin, which fails due to permission issues.
This removes the -o root -g bin, so it can succeed as a regular user.

Index: lib/rubygems/ext/builder.rb
--- lib/rubygems/ext/builder.rb.orig
+++ lib/rubygems/ext/builder.rb
@@ -42,6 +42,12 @@ class Gem::Ext::Builder
       env << "sitelibdir=%s" % sitedir
     end
 
+    unless Process.euid == 0
+      %w[INSTALL INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM].each do |ins|
+        env.unshift "#{ins}=#{RbConfig::MAKEFILE_CONFIG[ins].gsub(/-o root -g bin/, '')}"
+      end
+    end
+
     targets.each do |target|
       # Pass DESTDIR via command line to override what's in MAKEFLAGS
       cmd = [
