Sha256: d0ce3d05c55552c9abad91112ec9682c5c802b4bcf80fb478ef9b335b8592ff6

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require 'rbconfig'
c = RbConfig::CONFIG

def system!(cmd)
	puts cmd
	system(cmd) or raise
end

ver = '1.4.2'
core = "xapian-core-#{ver}"
bindings = "xapian-bindings-#{ver}"
xapian_config = "#{__dir__}/#{core}/xapian-config"
prefix = ENV['PREFIX'] || File.dirname(__dir__)
puts "prefix = #{prefix}"
#ENV['LDFLAGS'] = "-R#{prefix}/lib"
docdir = File.join(prefix, "share/doc/xapian")

namespace :build do
	task :core do
		Dir.chdir core do
			system! "./configure --prefix=#{prefix} --exec-prefix=#{prefix}"
			system! "make all install"
			
			# Alternatively to only install libraries
			# system! "cp -r .libs/* ../lib/"
		end
	end

	task :bindings do
		Dir.chdir bindings do
			ENV['RUBY'] ||= "#{c['bindir']}/#{c['RUBY_INSTALL_NAME']}"
			ENV['XAPIAN_CONFIG'] = xapian_config
			
			system! "cp ../Makefile.am-ruby ./ruby/Makefile.am"
			
			system! "./configure --prefix=#{prefix} --exec-prefix=#{prefix} --with-ruby"
			
			system! "make all"
			
			system! "cp -LR ./ruby/.libs/_xapian.* #{prefix}/lib"
			system! "cp ./ruby/xapian.rb #{prefix}/lib"
		end
	end
	
	task :all => [:core, :bindings]
end

task :extract do
	[core,bindings].each do |x|
		system! "tar -xvf #{x}.tar.xz"
	end
end

task :default => [:extract, 'build:all']

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
xapian-core-1.4.2 ext/Rakefile