forked from sebbacon/xapian-full
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
49 lines (40 loc) · 1.12 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require 'rbconfig'
c = RbConfig::CONFIG
begin
require 'bundler'
have_bundler = true
rescue LoadError
have_bundler = false
end
def system!(cmd)
puts cmd
system(cmd) or raise
end
ver = '1.2.9'
core = "xapian-core-#{ver}"
bindings = "xapian-bindings-#{ver}"
task :default do
[core,bindings].each do |x|
system! "tar -xzvf #{x}.tar.gz"
end
prefix = Dir.pwd
Dir.chdir core do
system! "./configure --prefix=#{prefix} --exec-prefix=#{prefix}"
system! "make clean all"
system! "make install"
end
Dir.chdir bindings do
ENV['RUBY'] ||= "#{c['bindir']}/#{c['RUBY_INSTALL_NAME']}"
ENV['XAPIAN_CONFIG'] = "#{prefix}/bin/xapian-config"
system! "./configure --prefix=#{prefix} --exec-prefix=#{prefix} --with-ruby"
if have_bundler
# Maybe Bundler is building us in a temporary directory, and will move us to
# the system ruby gems directory once built.
system! "make clean all LDFLAGS='-R#{Bundler.rubygems.gem_dir}/gems/xapian-full-alaveteli-1.2.9.5/lib'"
else
system! "make clean all"
end
end
system! "cp -RL #{bindings}/ruby/.libs/_xapian.* lib"
system! "cp #{bindings}/ruby/xapian.rb lib"
end