Fixed casing of 'Ruby-EET'.
[ruby-eet.git] / Rakefile
index ab2676fa358ce2aa72e25b879cb079115d68b804..d4851c346116692d2bea4e00f0ce823dbfddc05f 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -1,16 +1,21 @@
-# $Id: Rakefile 1 2005-03-26 01:45:38Z tilman $
+# $Id: Rakefile 14 2005-03-28 20:38:06Z tilman $
 
 require "rbconfig"
 require "rake/clean"
 require "rake/testtask"
 require "rake/rdoctask"
 require "rake/packagetask"
+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
-       fail("Rake 0.5.0 or greater required")
+       raise("Rake 0.5.0 or greater required")
 end
 
+PKG_NAME = "ruby-eet"
+PKG_VERSION = `grep VERSION lib/eet.rb`.match(/VERSION = \"(.*)\"/).
+              captures.first
+
 ext_obj = "ext/ext.o"
 ext_lib = "ext/eet_ext.so"
 
@@ -41,10 +46,10 @@ file ext_lib => ext_obj do |t|
 end
 
 task :install => [ext_lib] do |t|
-       d = destdir + sitearchdir
-
-       FileUtils::Verbose.install(ext_lib, d, :mode => 0755)
-       FileUtils::Verbose.install("lib/eet.rb", d, :mode => 0644)
+       FileUtils::Verbose.install(ext_lib, destdir + sitearchdir,
+                                  :mode => 0755)
+       FileUtils::Verbose.install("lib/eet.rb", destdir + sitelibdir,
+                                  :mode => 0644)
 end
 
 task :test => [ext_lib]
@@ -57,15 +62,24 @@ end
 
 Rake::RDocTask.new do |t|
        t.rdoc_dir = "doc"
-       t.title = "ruby-eet - EET bindings for Ruby"
+       t.title = "Ruby-EET - EET bindings for Ruby"
        t.options = ["--line-numbers", "--inline-source", "--main", "README"]
        t.rdoc_files.include("README", "COPYING", "AUTHORS", "ChangeLog",
                             "ext/ext.c", "lib/eet.rb")
 end
 
-Rake::PackageTask.new("ruby-eet") do |t|
-       md = `grep VERSION lib/eet.rb`.match(/VERSION = \"(.*)\"/)
-       t.version = md.captures.first
+Rake::PackageTask.new(PKG_NAME, PKG_VERSION) do |t|
        t.need_tar_gz = true
        t.package_files.include("[A-Z]*", "ext/*.c", "lib/*.rb", "test/*.rb")
 end
+
+task :publish => [:rdoc, :package] do
+       p = Rake::CompositePublisher.new
+       p.add(Rake::SshFreshDirPublisher.new("code-monkey.de",
+                                            "public_html/docs/" +
+                                            PKG_NAME, "doc"))
+       p.add(Rake::SshFilePublisher.new("code-monkey.de",
+                                        ".", "pkg",
+                                        "#{PKG_NAME}-#{PKG_VERSION}.tar.gz"))
+       p.upload
+end