Hilko Bengen
2014-Jan-16 19:29 UTC
[Libguestfs] [PATCH] hivex: ruby: Support 'make INSTALLDIRS=vendor install' for Ruby
(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
Richard W.M. Jones
2014-Jan-16 20:07 UTC
Re: [Libguestfs] [PATCH] hivex: ruby: Support 'make INSTALLDIRS=vendor install' for Ruby
On Thu, Jan 16, 2014 at 08:29:04PM +0100, Hilko Bengen wrote:> (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.2ACK. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Possibly Parallel Threads
- [PATCH 1/2] hivex: ruby: find files to install in correct directories when building out-of-tree
- [PATCH] hivex: Fix Ruby bindings for 1.9; let the user explicitly choose ruby, rake
- Re: Patchable build problems on OS X 10.10
- [PATCH] let the user explicitly choose ruby and rake programs
- [PATCH] out-of-tree build: ruby