THRIFT-1207. rb: Support DESTDIR on 'make install' of ruby libs

Patch: Brandon Philips

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1136180 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/Makefile.am b/lib/rb/Makefile.am
index da45ed5..39c04d9 100644
--- a/lib/rb/Makefile.am
+++ b/lib/rb/Makefile.am
@@ -28,12 +28,14 @@
 	script \
 	spec
 
+DESTDIR ?= /
+
 all-local:
 	if [ -n "$(RUBY_PREFIX)" ] ; then $(RUBY) setup.rb config --prefix=$(DESTDIR)$(RUBY_PREFIX) --rbdir='$$libdir/ruby' --sodir='$$libdir/ruby' ; elif [ -n "$(DESTDIR)" ] ; then $(RUBY) setup.rb config --prefix=$(DESTDIR) ; else $(RUBY) setup.rb config ; fi
 	$(RUBY) setup.rb setup
 
 install-exec-hook:
-	$(RUBY) setup.rb install
+	$(RUBY) setup.rb install --prefix=$(DESTDIR)
 
 # Make sure this doesn't fail if Ruby is not configured.
 clean-local: