out of tree build: ruby (second take)
authorHilko Bengen <bengen@hilluzination.de>
Tue, 29 Nov 2011 19:59:14 +0000 (20:59 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Wed, 30 Nov 2011 11:52:02 +0000 (11:52 +0000)
ruby/Rakefile.in

index da9f3f1..2587476 100644 (file)
@@ -24,10 +24,10 @@ require 'rake/gempackagetask'
 PKG_NAME='@PACKAGE_NAME@'
 PKG_VERSION='@PACKAGE_VERSION@'
 
-EXT_CONF='@srcdir@/ext/hivex/extconf.rb'
+EXT_CONF='@abs_srcdir@/ext/hivex/extconf.rb'
 MAKEFILE='@builddir@/ext/hivex/Makefile'
 HIVEX_MODULE='@builddir@/ext/hivex/_hivex.so'
-HIVEX_SRC='@srcdir@/ext/hivex/_hivex.c'
+HIVEX_SRC='@abs_srcdir@/ext/hivex/_hivex.c'
 
 CLEAN.include [ "@builddir@/ext/**/*.o", HIVEX_MODULE,
                 "@builddir@/ext/**/depend" ]
@@ -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-_hivex-include=$top_srcdir/lib --with-_hivex-lib=$top_builddir/lib/.libs"
+     unless sh "top_srcdir=$(pwd)/@top_srcdir@; top_builddir=$(pwd)/@top_builddir@; export ARCHFLAGS=\"-arch $(uname -m)\"; mkdir -p @builddir@/ext/hivex; cd @builddir@/ext/hivex; ruby #{EXT_CONF} --with-_hivex-include=$top_srcdir/lib --with-_hivex-lib=$top_builddir/lib/.libs"
          $stderr.puts "Failed to run extconf"
          break
      end
 end
 file HIVEX_MODULE => [ MAKEFILE, HIVEX_SRC ] do |t|
-    Dir::chdir(File::dirname(EXT_CONF)) do
+    Dir::chdir("@builddir@/ext/hivex") 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/**/*",