[54809] trunk/dports/ruby/rb-gnome/files

kimuraw at macports.org kimuraw at macports.org
Sun Aug 2 05:03:14 PDT 2009


Revision: 54809
          http://trac.macports.org/changeset/54809
Author:   kimuraw at macports.org
Date:     2009-08-02 05:03:11 -0700 (Sun, 02 Aug 2009)
Log Message:
-----------
ruby/rb-gnome: add README for this port and maintenance script

Added Paths:
-----------
    trunk/dports/ruby/rb-gnome/files/README.rb-gnome
    trunk/dports/ruby/rb-gnome/files/port-upd-rb-gnome.rb

Added: trunk/dports/ruby/rb-gnome/files/README.rb-gnome
===================================================================
--- trunk/dports/ruby/rb-gnome/files/README.rb-gnome	                        (rev 0)
+++ trunk/dports/ruby/rb-gnome/files/README.rb-gnome	2009-08-02 12:03:11 UTC (rev 54809)
@@ -0,0 +1,45 @@
+$Id$
+
+= about MacPorts Ruby-GNOME2 ports
+
+== RUBY-GNOME2 Release contents and portfiles status
+
+  * rb-glib2         Ruby/GLib2: GLib 2.0.x or later
+  * rb-atk           Ruby/ATK: ATK 1.0.x or later
+  * rb-pango         Ruby/Pango: Pango 1.1.x or later
+  * rb-gtk2          Ruby/GdkPixbuf2: GTK+ 2.0.x or later
+  * rb-gtk2          Ruby/GTK2: GTK+ 2.0.x or later
+
+rb-gtk2 contains gdkpixbuf2 and gtk2.
+
+  * rb-gconf         Ruby/GConf2: GConf 2.0.x or later
+  * rb-libgnome      Ruby/GNOME2: libgnome-2.0.x, libgnomeui-2.0.x or later
+  * rb-gnomecanvas   Ruby/GnomeCanvas2: libgnomecanvas-2.0.x or later
+  * rb-gnomeprint    Ruby/GnomePrint: libgnomeprint-2.8.x or later
+  * rb-gnomeprintui  Ruby/GnomePrintUI: libgnomeprintui-2.6.x or later
+  * rb-gnomevfs      Ruby/GnomeVFS: GnomeVFS 2.0.x or later
+  * rb-gtkhtml       Ruby/GtkHtml2: GtkHtml2 2.0.x or later
+  * rb-gtkglext      Ruby/GtkGLExt: GtkGLExt 1.0.3 or later
+  * (NOT READY)      Ruby/GtkMozEmbed: GtkMozEmbed (Mozilla 1.7.x or FireFox-1.0.x or later)
+  * (NOT SUPPORT)    Ruby/GtkSourceView: GtkSourceView 1.0.1 or later
+  * rb-libart        Ruby/Libart2: libart_lgpl 2.3.12 or later
+  * rb-libglade2     Ruby/Libglade2: Libglade 2.0.x or later
+  * rb-rsvg          Ruby/RSVG: librsvg 2.8.0 or later
+  * rb-poppler       Ruby/Poppler is a Ruby binding of poppler-glib.
+
+GtkMozEmbed is not found in official ports.
+
+Ruby/GtkSourceView is binding for GtkSourceView 1.0.x. the latest version of
+port:gtksourceview is 1.8.5.
+
+=== Experimental / Incomplete:
+
+  * rb-gstreamer     Ruby/GStreamer: GStreamer 0.10.x or later
+  * rb-gtksourceview2 Ruby/GtkSourceView2: GtkSourceView 2.0.0 or later
+  * (NOT READY)      Ruby/GooCanvas: GooCanvas 0.8.0 or later
+
+=== Depricated
+
+  * (N/A)            Ruby/Libgda: libgda 1.0.3 or later
+  * (N/A)            Ruby/PanelApplet: gnome-panel 2.6.0 or later (deprecated since 0.16.0)
+


Property changes on: trunk/dports/ruby/rb-gnome/files/README.rb-gnome
___________________________________________________________________
Added: svn:keywords
   + Id

Added: trunk/dports/ruby/rb-gnome/files/port-upd-rb-gnome.rb
===================================================================
--- trunk/dports/ruby/rb-gnome/files/port-upd-rb-gnome.rb	                        (rev 0)
+++ trunk/dports/ruby/rb-gnome/files/port-upd-rb-gnome.rb	2009-08-02 12:03:11 UTC (rev 54809)
@@ -0,0 +1,114 @@
+#!/usr/bin/env ruby
+# $Id$
+# upgrade all Portfiles of Ruby-GNOME2 modules; rb-glib2, rb-gtk2, ..
+# [usage] port-upd-rb-gnome.rb tarball-path
+#
+
+require 'openssl'
+
+# target Portfiles of Ruby/Gnome2 modules
+PORTFILES =
+	%w[rb-glib2 rb-atk rb-pango rb-gtk2 rb-rsvg rb-poppler
+	   rb-gconf rb-gnomecanvas rb-libgnome rb-libart rb-gnomeprint
+	   rb-gnomeprintui rb-gnomevfs rb-gtkhtml rb-libglade2
+	   rb-gstreamer rb-vte rb-gtkglext rb-gtksourceview2
+	   rb-gnome]
+# TODO: GtkMozeEmbed[add]
+
+class App
+
+  attr_accessor :version, :sums
+
+  def initialize(version, tarball)
+    self.version = version
+    self.sums = checksums(tarball)
+    puts <<EOS
+######
+input file: #{tarball}
+ruby-gnome: #{self.version}
+checksums md5: #{self.sums.md5}
+	  sha1: #{self.sums.sha1}
+	  rmd160: #{self.sums.rmd160}
+######
+EOS
+  end
+
+  def run
+    PORTFILES.each do |port|
+      update(port)
+      puts "update #{port}"
+    end
+  end
+
+  Checksums = Struct.new(:md5, :sha1, :rmd160)
+
+  private
+
+  def checksums(path)
+    bytes = File.read(path)
+    sums = Checksums.new
+    sums.md5 = OpenSSL::Digest::MD5.new(bytes).hexdigest
+    sums.sha1 = OpenSSL::Digest::SHA1.new(bytes).hexdigest
+    sums.rmd160 = OpenSSL::Digest::RIPEMD160.new(bytes).hexdigest
+    return sums
+  end
+
+  def update(port)
+    path = File.join('ruby', port, 'Portfile')
+    text = File.read(path)
+    # update version at ruby.setup
+    text[/ruby.setup\s+\{.*\}\s+(\S+)\s+(extconf\.rb|fetch)/m, 1] = self.version
+    # update checksums {md5/sha1/rmd160}
+    self.sums.each_pair do |type, sum|
+      text[/\s+#{type}\s+([0-9a-f]+)/, 1] = sum
+    end
+
+    ## add fetch from svn trunk
+    svn_tag = self.version[/\.r(\d+)/, 1]
+    if svn_tag
+      update_svn(text, svn_tag)
+    else
+      remove_svn_cmds(text)
+    end
+    File.open(path, 'w') {|f| f.write(text)}
+  end
+
+  FETCH_RE = /^(fetch\s+\{.*\}\s*\n)/m
+  WORKSRCDIR_RE = /^worksrcdir\s+(\S+)\n/m
+
+  def update_svn(text, svn_tag)
+    fetch_cmd = <<FETCH_CMD
+fetch { 
+  if {[file isfile \${distpath}/\${distname}\${extract.suffix}]} {return 0}
+  curl fetch "http://ruby-gnome2.svn.sourceforge.net/viewvc/ruby-gnome2/ruby-gnome2/trunk.tar.gz?view=tar&pathrev=#{svn_tag}" \${distpath}/\${distname}\${extract.suffix}
+}
+FETCH_CMD
+    begin
+      text[FETCH_RE, 1] = fetch_cmd
+    rescue IndexError
+      text << fetch_cmd
+    end
+    worksrcdir = 'trunk'
+    begin
+      text[WORKSRCDIR_RE, 1] = worksrcdir
+    rescue IndexError
+      text << "worksrcdir #{worksrcdir}\n"
+    end
+  end
+
+  def remove_svn_cmds(text)
+    text.sub!(FETCH_RE, '')
+    text.sub!(WORKSRCDIR_RE, '')
+  end
+end
+
+if ARGV.size != 1
+  $stderr.puts "[usage] port-upd-rb-gnome.rb tarball-file"
+  exit 1
+end
+
+tarball = ARGV.shift
+vers = tarball.slice(/ruby-gnome2-(?:all-)?(\S+).tar.gz/, 1)
+
+App.new(vers, tarball).run
+


Property changes on: trunk/dports/ruby/rb-gnome/files/port-upd-rb-gnome.rb
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Id
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090802/14d2f6ad/attachment.html>


More information about the macports-changes mailing list