2 require "rake/testtask"
3 require "rake/rdoctask"
4 require "rake/packagetask"
5 require "rake/contrib/compositepublisher"
6 require "rake/contrib/sshpublisher"
8 require "rake/configuretask"
9 require "rake/extensiontask"
11 PKG_NAME = "ruby-edje"
13 ext_objs = [:rb_edje_main, :rb_edje, :rb_part]
15 task :default => [:ext]
17 config = Rake::ConfigureTask.new do |t|
18 t.tests << Rake::ConfigureTask::
19 PkgConfigTest.new("edje", :is_critical => true)
22 task :ext => [:pre_ext]
24 ext = Rake::ExtensionTask.new :ext => ext_objs do |t|
26 t.lib_name = "#{t.dir}/edje.so"
29 task :pre_ext => [:configure] do
30 ext.link_libs << config.edje.libs
37 ext.env.update(:cflags => cflags)
40 task :install => [:ext] do |t|
41 destdir = "#{ENV["DESTDIR"]}"
42 sitearchdir = ENV["RUBYARCHDIR"] || Config::CONFIG['sitearchdir']
44 ddir = destdir + sitearchdir
45 FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
46 FileUtils::Verbose.install(ext.lib_name, ddir, :mode => 0755)
49 Rake::RDocTask.new do |t|
51 t.title = "ruby-edje -- Edje bindings for Ruby"
52 t.options = ["--line-numbers", "--inline-source", "--main", "README"]
53 t.rdoc_files = FileList[
54 "AUTHORS", "COPYING", "README",
55 "src/rb_edje_main.c", "src/rb_edje.c", "src/rb_part.c"
59 task :publish => [:rdoc] do
60 p = Rake::CompositePublisher.new
61 p.add(Rake::SshFreshDirPublisher.new("code-monkey.de",