-# $Id: Rakefile 13 2005-03-29 16:03:33Z tilman $
+# $Id: Rakefile 42 2005-06-08 17:16:09Z tilman $
require "rake/clean"
require "rake/testtask"
require "rake/contrib/compositepublisher.rb"
require "rake/contrib/sshpublisher"
+# make sure we run at least Rake 0.5.0
+if (RAKEVERSION.split(".").map { |p| p.to_i } <=> [0, 5, 0]) < 0
+ raise("Rake 0.5.0 or greater required")
+end
+
PKG_NAME = "redact"
PKG_VERSION = File.read("lib/redact/redact.rb").
match(/^\s*VERSION = \"(.*)\"\s*$/).captures.first
-CLOBBER.include(FileList["test/*.edj"])
-
-sitelibdir = Config::CONFIG["sitelibdir"]
-destdir = "#{ENV["DESTDIR"]}"
-prefix = ENV["PREFIX"] || "/usr/local"
+CLOBBER.include("test/*.edj")
task :install do |t|
+ sitelibdir = Config::CONFIG["sitelibdir"]
+ destdir = "#{ENV["DESTDIR"]}"
+ prefix = ENV["PREFIX"] || "/usr/local"
+
ddir = destdir + prefix + "/bin"
FileUtils::Verbose.install("bin/redact", ddir, :mode => 0755)
ddir = destdir + sitelibdir + "/redact"
- FileUtils::Verbose.mkdir(ddir) unless File.directory?(ddir)
-
- ["app", "part", "program", "redact"].each do |file|
- FileUtils::Verbose.install("lib/redact/#{file}.rb", ddir,
- :mode => 0644)
- end
+ FileUtils::Verbose.mkdir_p(ddir) unless File.directory?(ddir)
+ FileUtils::Verbose.install(Dir["lib/redact/*.rb"], ddir,
+ :mode => 0644)
end
task :test
t.title = "Redact - An Edje Compiler written in Ruby"
t.options = ["--line-numbers", "--inline-source", "--main", "README"]
t.rdoc_files.include("README", "COPYING", "AUTHORS", "ChangeLog",
- "TODO", "lib/redact/redact.rb",
+ "TODO", "NEWS", "lib/redact/redact.rb",
"lib/redact/part.rb", "lib/redact/program.rb")
end