EXT_CONF='@srcdir@/ext/hivex/extconf.rb'
MAKEFILE='@builddir@/ext/hivex/Makefile'
HIVEX_MODULE='@builddir@/ext/hivex/_hivex.so'
-HIVEX_SRC='@abs_srcdir@/ext/hivex/_hivex.c'
+HIVEX_SRC='@srcdir@/ext/hivex/_hivex.c'
CLEAN.include [ "@builddir@/ext/**/*.o", HIVEX_MODULE,
"@builddir@/ext/**/depend" ]
# 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)\"; mkdir -p @builddir@/ext/guestfs; cd @builddir@/hivex; ruby #(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)\"; cd #{File::dirname(EXT_CONF)}; ruby #{File::basename(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("@builddir@/ext/hivex") do
+ Dir::chdir(File::dirname(EXT_CONF)) do
unless sh "make"
$stderr.puts "make failed"
break
task :test => :build
RDOC_FILES = FileList[
- "@srcdir@/README.rdoc",
- "@srcdir@/lib/**/*.rb",
- "@srcdir@/ext/**/*.[ch]"
+ "README.rdoc",
+ "lib/**/*.rb",
+ "ext/**/*.[ch]"
]
Rake::RDocTask.new do |rd|
- rd.main = "@srcdir@/README.rdoc"
+ rd.main = "README.rdoc"
rd.rdoc_dir = "doc/site/api"
rd.rdoc_files.include(RDOC_FILES)
end
Rake::RDocTask.new(:ri) do |rd|
- rd.main = "@srcdir@/README.rdoc"
+ rd.main = "README.rdoc"
rd.rdoc_dir = "doc/ri"
rd.options << "--ri-system"
rd.rdoc_files.include(RDOC_FILES)
# Package tasks
PKG_FILES = FileList[
- "Rakefile", "COPYING", "README", "NEWS", "@srcdir@/README.rdoc",
+ "Rakefile", "COPYING", "README", "NEWS", "README.rdoc",
"lib/**/*.rb",
"ext/**/*.[ch]", "ext/**/MANIFEST", "ext/**/extconf.rb",
"tests/**/*",