From 5abc0b68520c1a1ae9998f71bdfb7221aaf7b6ee Mon Sep 17 00:00:00 2001 From: Yaohan Chen Date: Sun, 6 Jul 2008 22:58:50 -0400 Subject: mo files are no longer included in gem but built as extension --- Rakefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index df8cb57f..62661bdd 100644 --- a/Rakefile +++ b/Rakefile @@ -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"] + -- cgit v1.2.3