From 22ecb8c6eecc8a32b4e60e40a2af57b500076c3d Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Sun, 20 Nov 2011 23:57:47 +0100 Subject: [PATCH] out-of-tree build: ruby (cherry picked from commit 8bc6e9d6a89672bbe1e7469774abe889354deb67) --- ruby/Makefile.am | 4 ++-- ruby/Rakefile.in | 18 +++++++++--------- ruby/run-bindtests | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ruby/Makefile.am b/ruby/Makefile.am index 88d3323..757855a 100644 --- a/ruby/Makefile.am +++ b/ruby/Makefile.am @@ -61,7 +61,7 @@ RUBY_SITEARCH := $(shell ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']" install: $(MKDIR_P) $(DESTDIR)$(RUBY_SITELIB) $(MKDIR_P) $(DESTDIR)$(RUBY_SITEARCH) - $(INSTALL) -p -m 0644 lib/guestfs.rb $(DESTDIR)$(RUBY_SITELIB) - $(INSTALL) -p -m 0755 ext/guestfs/_guestfs.so $(DESTDIR)$(RUBY_SITEARCH) + $(INSTALL) -p -m 0644 $(srcdir)/lib/guestfs.rb $(DESTDIR)$(RUBY_SITELIB) + $(INSTALL) -p -m 0755 $(builddir)/ext/guestfs/_guestfs.so $(DESTDIR)$(RUBY_SITEARCH) endif diff --git a/ruby/Rakefile.in b/ruby/Rakefile.in index 7c5a63a..f4bf901 100644 --- a/ruby/Rakefile.in +++ b/ruby/Rakefile.in @@ -24,7 +24,7 @@ require 'rake/gempackagetask' PKG_NAME='@PACKAGE_NAME@' PKG_VERSION='@PACKAGE_VERSION@' -EXT_CONF='@srcdir@/ext/guestfs/extconf.rb' +EXT_CONF='@abs_srcdir@/ext/guestfs/extconf.rb' MAKEFILE='@builddir@/ext/guestfs/Makefile' GUESTFS_MODULE='@builddir@/ext/guestfs/_guestfs.so' GUESTFS_SRC='@srcdir@/ext/guestfs/_guestfs.c' @@ -38,13 +38,13 @@ CLOBBER.include [ "@builddir@/config.save", "@builddir@/ext/**/mkmf.log", # Build locally file MAKEFILE => EXT_CONF do |t| - unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; export ARCHFLAGS=\"-arch $(uname -m)\"; cd #{File::dirname(EXT_CONF)}; ruby #{File::basename(EXT_CONF)} --with-_guestfs-include=$top_srcdir/src --with-_guestfs-lib=$top_builddir/src/.libs" + unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; export ARCHFLAGS=\"-arch $(uname -m)\"; mkdir -p @builddir@/ext/guestfs; cd @builddir@/ext/guestfs; ruby #{EXT_CONF} --with-_guestfs-include=$top_srcdir/src --with-_guestfs-lib=$top_builddir/src/.libs" $stderr.puts "Failed to run extconf" break end end file GUESTFS_MODULE => [ MAKEFILE, GUESTFS_SRC ] do |t| - Dir::chdir(File::dirname(EXT_CONF)) do + Dir::chdir("@builddir@/ext/guestfs") do unless sh "make" $stderr.puts "make failed" break @@ -61,19 +61,19 @@ end task :test => :build RDOC_FILES = FileList[ - "README.rdoc", - "lib/**/*.rb", - "ext/**/*.[ch]" + "@srcdir@/README.rdoc", + "@srcdir@/lib/**/*.rb", + "@srcdir@/ext/**/*.[ch]" ] Rake::RDocTask.new do |rd| - rd.main = "README.rdoc" + rd.main = "@srcdir@/README.rdoc" rd.rdoc_dir = "doc/site/api" rd.rdoc_files.include(RDOC_FILES) end Rake::RDocTask.new(:ri) do |rd| - rd.main = "README.rdoc" + rd.main = "@srcdir@/README.rdoc" rd.rdoc_dir = "doc/ri" rd.options << "--ri-system" rd.rdoc_files.include(RDOC_FILES) @@ -82,7 +82,7 @@ end # Package tasks PKG_FILES = FileList[ - "Rakefile", "COPYING", "README", "NEWS", "README.rdoc", + "Rakefile", "COPYING", "README", "NEWS", "@srcdir@/README.rdoc", "lib/**/*.rb", "ext/**/*.[ch]", "ext/**/MANIFEST", "ext/**/extconf.rb", "tests/**/*", diff --git a/ruby/run-bindtests b/ruby/run-bindtests index a78b5f6..4cac863 100755 --- a/ruby/run-bindtests +++ b/ruby/run-bindtests @@ -18,5 +18,5 @@ set -e -ruby -Ilib -Iext/guestfs bindtests.rb > bindtests.tmp +ruby -I${srcdir}/lib -Iext/guestfs ${srcdir}/bindtests.rb > bindtests.tmp diff -u ${srcdir}/../bindtests bindtests.tmp -- 1.8.3.1