[csw-devel] SF.net SVN: gar:[10625] csw/mgar/gar/v2

dmichelsen at users.sourceforge.net dmichelsen at users.sourceforge.net
Wed Jul 28 13:41:10 CEST 2010


Revision: 10625
          http://gar.svn.sourceforge.net/gar/?rev=10625&view=rev
Author:   dmichelsen
Date:     2010-07-28 11:41:10 +0000 (Wed, 28 Jul 2010)

Log Message:
-----------
mGAR v2: Add GEM dependency detection

Modified Paths:
--------------
    csw/mgar/gar/v2/categories/rbgems/category.mk

Added Paths:
-----------
    csw/mgar/gar/v2/bin/gemdeps.rb

Added: csw/mgar/gar/v2/bin/gemdeps.rb
===================================================================
--- csw/mgar/gar/v2/bin/gemdeps.rb	                        (rev 0)
+++ csw/mgar/gar/v2/bin/gemdeps.rb	2010-07-28 11:41:10 UTC (rev 10625)
@@ -0,0 +1,7 @@
+#!/opt/csw/bin/ruby
+require 'yaml'
+require 'rubygems'
+spec = YAML::load(STDIN)
+spec.dependencies.each do |dep|
+  printf "%s\n", dep.name if dep.type == :runtime
+end


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

Modified: csw/mgar/gar/v2/categories/rbgems/category.mk
===================================================================
--- csw/mgar/gar/v2/categories/rbgems/category.mk	2010-07-28 11:27:29 UTC (rev 10624)
+++ csw/mgar/gar/v2/categories/rbgems/category.mk	2010-07-28 11:41:10 UTC (rev 10625)
@@ -1,7 +1,6 @@
 # We must have rubygems (and hence ruby) installed to package a gem.
 DEF_BASE_PKGS += CSWrubygems
 
-# Set the CPAN mirror in gar.conf.mk
 MASTER_SITES ?= http://rubygems.org/downloads/
 
 # This is common to most modules - override in module makefile if different
@@ -10,11 +9,20 @@
 GEMFILE   ?= $(GEMNAME)-$(GEMVERSION).gem
 DISTFILES += $(GEMFILE)
 
-ifndef PACKAGES
-PACKAGES = CSWgem-$(GEMNAME)
-CATALOGNAME_$(PACKAGES) = gem_$(GEMNAME)
-endif
+GEMPKGNAME ?= $(GEMNAME)
+GEMCATALOGNAME ?= $(GEMPKGNAME)
 
+# PACKAGES ?= CSWgem-$(GEMPKGNAME) CSWgem-$(GEMPKGNAME)-doc
+PACKAGES ?= CSWgem-$(GEMPKGNAME)
+CATALOGNAME_CSWgem-$(GEMPKGNAME) ?= gem_$(GEMCATALOGNAME)
+CATALOGNAME_CSWgem-$(GEMPKGNAME)-doc ?= gem_$(GEMCATALOGNAME)_doc
+
+SPKG_DESC_CSWgem-$(GEMPKGNAME)-doc ?= $(or $(SPKG_DESC_CSWgem-$(GEMPKGNAME)),$(SPKG_DESC)) documentation
+
+# RUNTIME_DEP_PKGS_CSWgem-$(GEMPKGNAME) ?= $(shell gem specification $(DOWNLOADDIR)/$(GEMFILE) | $(GARBIN)/gemdeps.rb)
+
+# GEM_DEPENDENCY_PKGS ?= $(RUNTIME_DEP_PKGS_CSWgem-$(GEMPKGNAME))
+
 # Tests are enabled by default, unless overridden at the test level
 ENABLE_TEST ?= 1
 
@@ -37,14 +45,19 @@
 
 LICENSE ?= MIT-LICENSE
 
-CONFIGURE_SCRIPTS ?=
+GEMDIR ?= $(shell ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+
+CONFIGURE_SCRIPTS ?= check-gem-deps
 BUILD_SCRIPTS ?= 
 TEST_SCRIPTS ?= 
-INSTALL_SCRIPTS = rbgem
+INSTALL_SCRIPTS ?= rbgem
 
+# Allow splitting of documentation automatically
+PKGFILES_CSWgem-$(GEMPKGNAME)-doc ?= $(GEMDIR)/doc/.*
+
 gem-extract-%:
 	@echo " ==> Decompressing $(DOWNLOADDIR)/$*"
-	@gem unpack $(DOWNLOADDIR)/$* --target $(WORKDIR)
+	gem unpack $(DOWNLOADDIR)/$* --target $(WORKDIR)
 	@$(MAKECOOKIE)
 
 extract-archive-%.gem: gem-extract-%.gem
@@ -52,7 +65,13 @@
 
 include gar/gar.mk
 
-GEMDIR ?= $(shell ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
+# During the configure phase we check that all dependend modules are available
+configure-check-gem-deps: GEM_DEPS?=$(addprefix CSWgem-,$(shell gem specification $(DOWNLOADDIR)/$(GEMFILE) | $(GARBIN)/gemdeps.rb))
+configure-check-gem-deps:
+	@echo "=== Checking dependencies of GEM $(GEMFILE) ==="
+	@$(GARBIN)/check_for_deps $(GEM_DEPS)
+	@$(MAKECOOKIE)
+
 install-rbgem:
 	gem install --ignore-dependencies --local --no-test --install-dir $(DESTDIR)$(GEMDIR) $(DOWNLOADDIR)/$(GEMFILE)
 	@$(MAKECOOKIE)
@@ -61,5 +80,4 @@
 update-check:
 	@# TBD!
 	@echo " ==> Update Check: $(GARNAME) $(GARVERSION)"
-	@echo " ==> AUTO UPDATE CHECK FOR $(GARNAME) IS DISABLED" ; \
-	fi
+	@echo " ==> AUTO UPDATE CHECK FOR $(GARNAME) IS DISABLED"


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