[csw-devel] SF.net SVN: gar:[10714] csw/mgar/gar/v2/bin/gem2pkg

bdwalton at users.sourceforge.net bdwalton at users.sourceforge.net
Wed Aug 11 02:54:45 CEST 2010


Revision: 10714
          http://gar.svn.sourceforge.net/gar/?rev=10714&view=rev
Author:   bdwalton
Date:     2010-08-11 00:54:45 +0000 (Wed, 11 Aug 2010)

Log Message:
-----------
gar/v2: add gem2pkg.  next step is to integrate it

Added Paths:
-----------
    csw/mgar/gar/v2/bin/gem2pkg

Added: csw/mgar/gar/v2/bin/gem2pkg
===================================================================
--- csw/mgar/gar/v2/bin/gem2pkg	                        (rev 0)
+++ csw/mgar/gar/v2/bin/gem2pkg	2010-08-11 00:54:45 UTC (rev 10714)
@@ -0,0 +1,40 @@
+#!/opt/csw/bin/ruby -w
+
+require 'rubygems'
+require 'rubygems/format'
+
+unless File.exists?(ARGV[0])
+  $stderr.puts "Pass path to a valid .gem file as first argument.  You gave: #{ARGV[0]}"
+  exit 1
+end
+
+begin
+  spec = Gem::Format.from_file_by_path(File.expand_path(ARGV[0])).spec
+
+  blurb = spec.description.gsub("\n", ' ').squeeze.lstrip
+
+  puts <<"EOF"
+GARNAME = #{spec.name}
+GARVERSION = #{spec.version}
+CATEGORIES = rbgems
+
+DESCRIPTION = #{spec.summary}
+
+define BLURB
+#{blurb.gsub(/(.{1,70})( +|$\n?)|(.{1,70})/, "\\1\\3\n")}
+endef
+
+EOF
+
+  spec.dependencies.each do |d|
+    puts "RUNTIME_DEP_PKGS += CSWgem-#{d.name}"
+  end
+
+  puts "\nARCHALL = 1" if spec.extensions.size.eql?(0)
+
+  puts "include gar/category.mk"
+rescue Exception => e
+  # we could be more selective, but this catches _everything_
+  $stderr.puts "Rescued exception of type #{e.class}"
+  $stderr.puts "Exception text: #{e.message}"
+end


Property changes on: csw/mgar/gar/v2/bin/gem2pkg
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list