diff options
author | Yaohan Chen <yaohan.chen@gmail.com> | 2008-07-06 22:58:50 -0400 |
---|---|---|
committer | Yaohan Chen <yaohan.chen@gmail.com> | 2008-07-06 22:58:50 -0400 |
commit | 5abc0b68520c1a1ae9998f71bdfb7221aaf7b6ee (patch) | |
tree | ed96663b90778bc3742c9584f6fcd68d906cec3b | |
parent | 4168db21c5eaca6d1bb4743414bb721cceda192e (diff) |
mo files are no longer included in gem but built as extension
-rw-r--r-- | Rakefile | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -2,7 +2,7 @@ require 'rubygems' require 'rake' require 'rake/gempackagetask' -task :default => [:repackage] +task :default => [:buildext] spec = Gem::Specification.new do |s| s.name = 'rbot' @@ -16,10 +16,11 @@ spec = Gem::Specification.new do |s| s.requirements << 'Ruby, version 1.8.0 (or newer)' # s.files = Dir.glob("**/*").delete_if { |item| item.include?(".svn") } - s.files = FileList['lib/**/*.rb', 'bin/*', 'data/**/*', 'AUTHORS', 'COPYING', 'README', 'REQUIREMENTS', 'TODO', 'ChangeLog', 'INSTALL', 'Usage_en.txt', 'setup.rb'].to_a.delete_if {|item| item == ".svn"} + s.files = FileList['lib/**/*.rb', 'bin/*', 'data/rbot/**/*', 'AUTHORS', 'COPYING', 'README', 'REQUIREMENTS', 'TODO', 'ChangeLog', 'INSTALL', 'Usage_en.txt', 'setup.rb', 'po/*.pot', 'po/**/*.po'].to_a.delete_if {|item| item == ".svn"} s.bindir = 'bin' s.executables = ['rbot', 'rbot-remote'] s.default_executable = 'rbot' + s.extensions = 'Rakefile' # s.autorequire = 'rbot/ircbot' s.has_rdoc = true @@ -184,6 +185,18 @@ task :normalizepo => :check_po_tools do FileList['po/*/*.po'].each {|fn| normalize_po(fn)} end +# this task invokes makemo if ruby-gettext is available, but otherwise succeeds +# with a warning instead of failing. it is to be used by Gem's extension builder +# to make installation not fail because of lack of ruby-gettext +task :buildext do + begin + require 'gettext/utils' + Rake::Task[:makemo].invoke + rescue LoadError + warn 'Ruby-gettext cannot be located, so mo files cannot be built and installed' + end +end + desc 'Generate mo files' task :makemo => LOCALES.map {|l| ["data/locale/#{l}/LC_MESSAGES/rbot.mo"] + |