Added .configure_state.yaml to .gitignore.
[ruby-edje.git] / Rakefile
1 require "rake/clean"
2 require "rake/testtask"
3 require "rake/rdoctask"
4 require "rake/packagetask"
5 require "rake/contrib/compositepublisher"
6 require "rake/contrib/sshpublisher"
7
8 require "rake/configuretask"
9 require "rake/extensiontask"
10
11 PKG_NAME = "ruby-edje"
12
13 ext_objs = [:rb_edje_main, :rb_edje, :rb_part]
14
15 task :default => [:ext]
16
17 config = Rake::ConfigureTask.new do |t|
18         t.tests << Rake::ConfigureTask::
19                    PkgConfigTest.new("edje", :is_critical => true)
20 end
21
22 task :ext => [:pre_ext]
23
24 ext = Rake::ExtensionTask.new :ext => ext_objs do |t|
25         t.dir = "src"
26         t.lib_name = "#{t.dir}/edje.so"
27 end
28
29 task :pre_ext => [:configure] do
30         ext.link_libs << config.edje.libs
31
32         cflags = [
33                 ext.env[:cflags],
34                 config.edje.cflags
35         ]
36
37         ext.env.update(:cflags => cflags)
38 end
39
40 task :install => [:ext] do |t|
41         destdir = "#{ENV["DESTDIR"]}"
42         sitearchdir = ENV["RUBYARCHDIR"] || Config::CONFIG['sitearchdir']
43
44         ddir = destdir + sitearchdir
45         FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
46         FileUtils::Verbose.install(ext.lib_name, ddir, :mode => 0755)
47 end
48
49 Rake::RDocTask.new do |t|
50         t.rdoc_dir = "doc"
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"
56         ]
57 end
58
59 task :publish => [:rdoc] do
60         p = Rake::CompositePublisher.new
61         p.add(Rake::SshFreshDirPublisher.new("code-monkey.de",
62                                              "public_docs/" +
63                                              PKG_NAME, "doc"))
64         p.upload
65 end