head 1.19; access; symbols RELEASE_1_8_1:1.19 RELEASE_1_8_0:1.15 RELEASE_1_7_0:1.15 RELEASE_1_6_3:1.14 RELEASE_1_6_2:1.14 RELEASE_1_6_1:1.11 RELEASE_1_6_0:1.8 RELEASE_1_5_1:1.5 RELEASE_1_5_0:1.5; locks; strict; comment @# @; 1.19 date 2009.12.13.11.56.13; author kou; state Exp; branches; next 1.18; commitid 0F6BnYEBRevfXcfu; 1.18 date 2009.12.13.11.50.37; author kou; state Exp; branches; next 1.17; commitid 7uYJt7BUyvUmVcfu; 1.17 date 2009.12.13.11.34.13; author kou; state Exp; branches; next 1.16; commitid FjC01vdyn4MJPcfu; 1.16 date 2009.12.13.11.31.39; author kou; state Exp; branches; next 1.15; commitid hGfj2YtSnKsQOcfu; 1.15 date 2008.08.17.08.02.16; author kou; state Exp; branches; next 1.14; commitid hCg81vesc7yzb7ft; 1.14 date 2008.06.14.12.59.25; author kou; state Exp; branches; next 1.13; commitid Z7kcvxPYoJ55TU6t; 1.13 date 2008.04.26.00.30.39; author kou; state Exp; branches; next 1.12; commitid NunffQ1qMsjOjy0t; 1.12 date 2008.04.24.13.21.25; author kou; state Exp; branches; next 1.11; commitid 3ZQBaFUjlue9Em0t; 1.11 date 2008.04.24.06.03.47; author kou; state Exp; branches; next 1.10; commitid 9rM72DTb7Pe8ek0t; 1.10 date 2008.04.24.06.00.47; author kou; state Exp; branches; next 1.9; commitid iSQA7C5w31J3dk0t; 1.9 date 2008.04.24.05.18.48; author kou; state Exp; branches; next 1.8; commitid fFsZiWOFCa3HYj0t; 1.8 date 2008.04.11.12.43.25; author kou; state Exp; branches; next 1.7; commitid DoCAtMQa3lO6RGYs; 1.7 date 2008.04.11.12.20.23; author kou; state Exp; branches; next 1.6; commitid iiSLlrpoH1TcJGYs; 1.6 date 2008.01.11.13.28.13; author kou; state Exp; branches; next 1.5; commitid yhntuZqpzumQ10Ns; 1.5 date 2007.05.27.02.35.30; author kou; state Exp; branches; next 1.4; 1.4 date 2007.05.27.02.33.33; author kou; state Exp; branches; next 1.3; 1.3 date 2007.05.27.02.14.09; author kou; state Exp; branches; next 1.2; 1.2 date 2007.04.13.13.15.39; author kou; state Exp; branches; next 1.1; 1.1 date 2007.04.12.12.45.11; author kou; state Exp; branches; next ; desc @@ 1.19 log @* Rakefile: follow hoe 2.3.2 changes. @ text @# -*- coding: utf-8; mode: ruby -*- require 'English' require 'find' require 'fileutils' require 'rubygems' require 'hoe' base_dir = File.join(File.dirname(__FILE__)) truncate_base_dir = Proc.new do |x| x.gsub(/^#{Regexp.escape(base_dir + File::SEPARATOR)}/, '') end cairo_ext_dir = File.join(base_dir, 'src') cairo_lib_dir = File.join(cairo_ext_dir, 'lib') $LOAD_PATH.unshift(cairo_ext_dir) $LOAD_PATH.unshift(cairo_lib_dir) ENV["RUBYLIB"] = "#{cairo_lib_dir}:#{cairo_ext_dir}:#{ENV['RUBYLIB']}" def guess_rcairo_version require 'cairo' Cairo.bindings_version end cairo_win32_dir = "cairo" FileUtils.rm_rf(cairo_win32_dir) manifest = File.join(base_dir, "Manifest.txt") manifest_contents = [] base_dir_included_components = %w(AUTHORS COPYING ChangeLog GPL NEWS README Rakefile extconf.rb pkg-config.rb) excluded_components = %w(.cvsignore .gdb_history CVS depend Makefile pkg .test-result) excluded_suffixes = %w(.png .ps .pdf .o .so .a .txt .~) Find.find(base_dir) do |target| target = truncate_base_dir[target] components = target.split(File::SEPARATOR) if components.size == 1 and !File.directory?(target) next unless base_dir_included_components.include?(components[0]) end Find.prune if (excluded_components - components) != excluded_components next if excluded_suffixes.include?(File.extname(target)) manifest_contents << target if File.file?(target) end File.open(manifest, "w") do |f| f.puts manifest_contents.sort.join("\n") end # For Hoe's no user friendly default behavior. :< File.open("README.txt", "w") {|file| file << "= Dummy README\n== XXX\n"} FileUtils.cp("NEWS", "History.txt") at_exit do FileUtils.rm_f("README.txt") FileUtils.rm_f("History.txt") FileUtils.rm_f(manifest) end ENV["VERSION"] ||= guess_rcairo_version version = ENV["VERSION"] project = Hoe.spec('cairo') do |project| project.version = version project.rubyforge_name = 'cairo' authors = File.join(base_dir, "AUTHORS") project.author = File.readlines(authors).collect do |line| if /\s*<[^<>]*>$/ =~ line $PREMATCH else nil end end.compact project.email = ['cairo@@cairographics.org'] project.summary = 'Ruby bindings for cairo' project.url = 'http://cairographics.org/rcairo' project.test_globs = [] project.spec_extras = { :extensions => ['extconf.rb'], :require_paths => ['src/lib', 'src'], :has_rdoc => false, } platform = ENV["FORCE_PLATFORM"] project.spec_extras[:platform] = platform if platform news = File.join(base_dir, "NEWS") project.changes = File.read(news).gsub(/\n+^Release(?m:.*)/, '') project.description = "Ruby bindings for cairo" project.need_tar = false project.remote_rdoc_dir = "doc" end project.spec.dependencies.delete_if {|dependency| dependency.name == "hoe"} if /mswin32/ =~ project.spec.platform.to_s project.spec.extensions = [] project.spec.files += ["src/cairo.so", "src/libruby-cairo.a"] FileUtils.cp_r(File.expand_path("~/.wine/drive_c/cairo-dev"), cairo_win32_dir) cairo_files = [] Find.find(cairo_win32_dir) do |f| cairo_files << f end project.spec.files += cairo_files end # fix Hoe's incorrect guess. project.spec.executables.clear task(:release).prerequisites.reject! {|name| name == "clean"} task(:release_to_rubyforge).prerequisites.reject! {|name| name == "clean"} # for releasing task :dist => [:docs] do sh "./dist.sh", version end task :gem => [:docs] # for documentation langs = [ ["en", "English"], ["ja", "日本語"], ] rcairo_doc_dir = File.expand_path(File.join(base_dir, "..", "rcairo-doc")) rcairo_doc_css = File.join(rcairo_doc_dir, "doc.css") rcairo_doc_title_image = File.join(rcairo_doc_dir, "rcairo-title.png") doc_dir = "doc" doc_index = File.join(doc_dir, "index.html") doc_css = File.join(doc_dir, "doc.css") doc_title_image = File.join(doc_dir, "rcairo-title.png") task(doc_index).instance_variable_get("@@actions").clear file doc_dir do mkdir_p doc_dir end file doc_title_image => [doc_dir, rcairo_doc_title_image] do cp rcairo_doc_title_image, doc_title_image end file doc_css => [rcairo_doc_css, doc_title_image] do cp rcairo_doc_css, doc_css end file doc_index => doc_css do File.open(doc_index, "w") do |index| index << <<-EOH rcairo reference manual

rcairo reference manual