[Libguestfs] [PATCH] hivex: ruby: Support 'make INSTALLDIRS=vendor install' for Ruby

Hilko Bengen bengen at hilluzination.de
Thu Jan 16 19:29:04 UTC 2014


(This is the same change as 87c9ec881cb695724e01d9f6fc9df996d4c67cb6
in libguestfs.)
---
 ruby/Makefile.am | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index e78ab59..7a5fe42 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -45,13 +45,17 @@ all:
 	$(RAKE) build
 	$(RAKE) rdoc
 
-RUBY_SITELIB := $(shell $(RUBY) -rrbconfig -e "puts RbConfig::CONFIG['sitelibdir']")
-RUBY_SITEARCH := $(shell $(RUBY) -rrbconfig -e "puts RbConfig::CONFIG['sitearchdir']")
+# Packagers can override this by doing: make INSTALLDIRS=vendor install
+# INSTALLDIRS also affects where Perl bindings are installed.
+INSTALLDIRS = site
+
+RUBY_LIBDIR := $(shell $(RUBY) -rrbconfig -e "puts RbConfig::CONFIG['$(INSTALLDIRS)libdir']")
+RUBY_ARCHDIR := $(shell $(RUBY) -rrbconfig -e "puts RbConfig::CONFIG['$(INSTALLDIRS)archdir']")
 
 install:
-	$(MKDIR_P) $(DESTDIR)$(RUBY_SITELIB)
-	$(MKDIR_P) $(DESTDIR)$(RUBY_SITEARCH)
-	$(INSTALL) -p -m 0644 ${srcdir}/lib/hivex.rb $(DESTDIR)$(RUBY_SITELIB)
-	$(INSTALL) -p -m 0755 ${builddir}/ext/hivex/_hivex.so $(DESTDIR)$(RUBY_SITEARCH)
+	$(MKDIR_P) $(DESTDIR)$(RUBY_LIBDIR)
+	$(MKDIR_P) $(DESTDIR)$(RUBY_ARCHDIR)
+	$(INSTALL) -p -m 0644 $(srcdir)/lib/hivex.rb $(DESTDIR)$(RUBY_LIBDIR)
+	$(INSTALL) -p -m 0755 $(builddir)/ext/hivex/_hivex.so $(DESTDIR)$(RUBY_ARCHDIR)
 
 endif
-- 
1.8.5.2




More information about the Libguestfs mailing list