2015-01-21 21:20:42 +01:00
|
|
|
# encoding: utf-8
|
|
|
|
# Install the xapian binaries into the lib folder of the gem
|
|
|
|
require 'rbconfig'
|
|
|
|
|
|
|
|
c = RbConfig::CONFIG
|
|
|
|
|
|
|
|
source_dir = 'xapian_source'
|
|
|
|
bindings = Dir["#{source_dir}/xapian-bindings-*"].first
|
|
|
|
bindings = File.basename(bindings, ".tar.xz")
|
|
|
|
|
|
|
|
task :default do
|
2019-04-30 20:13:18 +02:00
|
|
|
sh "tar -xJf #{source_dir}/#{bindings}.tar.xz"
|
2015-01-21 21:20:42 +01:00
|
|
|
|
|
|
|
prefix = Dir.pwd
|
|
|
|
ENV['LDFLAGS'] = "-L#{prefix}/lib"
|
|
|
|
|
2019-04-30 20:13:18 +02:00
|
|
|
sh "mkdir -p lib"
|
2015-01-21 21:20:42 +01:00
|
|
|
|
|
|
|
Dir.chdir bindings do
|
|
|
|
ENV['RUBY'] ||= "#{c['bindir']}/#{c['RUBY_INSTALL_NAME']}"
|
2019-04-30 20:13:18 +02:00
|
|
|
sh "./configure --prefix=#{prefix} --exec-prefix=#{prefix} --with-ruby"
|
|
|
|
sh "make clean all"
|
2015-01-21 21:20:42 +01:00
|
|
|
end
|
|
|
|
|
2019-04-30 20:13:18 +02:00
|
|
|
sh "cp -r #{bindings}/ruby/.libs/_xapian.* lib"
|
|
|
|
sh "cp #{bindings}/ruby/xapian.rb lib"
|
2015-01-21 21:20:42 +01:00
|
|
|
|
2019-04-30 20:13:18 +02:00
|
|
|
sh "rm lib/*.la"
|
|
|
|
sh "rm lib/*.lai"
|
2015-01-21 21:20:42 +01:00
|
|
|
|
2019-04-30 20:13:18 +02:00
|
|
|
sh "rm -R #{bindings}"
|
|
|
|
sh "rm -R #{source_dir}"
|
2015-01-21 21:20:42 +01:00
|
|
|
end
|