public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-02-19 11:59 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-02-19 11:59 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/02/19 11:59:38

  Modified:             ruby-fakegem.eclass
  Log:
  Only use revision, not full Id for the eclass.

Revision  Changes    Path
1.17                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.17&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.17&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.16&r2=1.17

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ruby-fakegem.eclass	19 Feb 2010 11:58:36 -0000	1.16
+++ ruby-fakegem.eclass	19 Feb 2010 11:59:38 -0000	1.17
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.16 2010/02/19 11:58:36 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.17 2010/02/19 11:59:38 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -148,7 +148,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Id: ruby-fakegem.eclass,v 1.16 2010/02/19 11:58:36 flameeyes Exp $
+# generated by ruby-fakegem.eclass $Revision: 1.17 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -202,7 +202,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Id: ruby-fakegem.eclass,v 1.16 2010/02/19 11:58:36 flameeyes Exp $
+# Generated by ruby-fakegem.eclass $Revision: 1.17 $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2014-04-21  7:35 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2014-04-21  7:35 UTC (permalink / raw
  To: gentoo-commits

graaff      14/04/21 07:35:43

  Modified:             ruby-fakegem.eclass
  Log:
  Read the YAML metadata with UTF-8 by default and make an exception for older ruby targets, since all new targets will support (and need) the UTF-8 flag. Fixes bug 504642.

Revision  Changes    Path
1.41                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.41&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.41&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.40&r2=1.41

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- ruby-fakegem.eclass	9 Nov 2013 10:22:06 -0000	1.40
+++ ruby-fakegem.eclass	21 Apr 2014 07:35:43 -0000	1.41
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.40 2013/11/09 10:22:06 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.41 2014/04/21 07:35:43 graaff Exp $
 
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -253,11 +253,11 @@
 # rubygems creates an installation from a .gem file.
 ruby_fakegem_metadata_gemspec() {
 	case ${RUBY} in
-		*ruby19)
-			${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2
+		*jruby)
+			${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2
 				;;
 		*)
-			${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2
+			${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2
 				;;
 	esac
 }
@@ -287,7 +287,7 @@
 	# so better taking this into consideration.
 	local quoted_description=${DESCRIPTION//\"/\\\"}
 	cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.40 $
+# generated by ruby-fakegem.eclass $Revision: 1.41 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -337,7 +337,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.40 $
+# Generated by ruby-fakegem.eclass $Revision: 1.41 $
 
 require 'rubygems'
 





^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2013-02-24  7:45 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2013-02-24  7:45 UTC (permalink / raw
  To: gentoo-commits

graaff      13/02/24 07:45:46

  Modified:             ruby-fakegem.eclass
  Log:
  Also set the RUBY_FAKEGEM_DOCDIR default for the rake recipe. This fixes a regression manifested by bug 458506.

Revision  Changes    Path
1.38                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.38&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.38&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.37&r2=1.38

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- ruby-fakegem.eclass	19 Aug 2012 07:45:02 -0000	1.37
+++ ruby-fakegem.eclass	24 Feb 2013 07:45:46 -0000	1.38
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2013 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.37 2012/08/19 07:45:02 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.38 2013/02/24 07:45:46 graaff Exp $
 
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -114,6 +114,7 @@
 	rake)
 		IUSE+=" doc"
 		ruby_add_bdepend "doc? ( dev-ruby/rake )"
+		RUBY_FAKEGEM_DOCDIR="doc"
 		;;
 	rdoc)
 		IUSE+=" doc"
@@ -280,7 +281,7 @@
 	# so better taking this into consideration.
 	local quoted_description=${DESCRIPTION//\"/\\\"}
 	cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.37 $
+# generated by ruby-fakegem.eclass $Revision: 1.38 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -330,7 +331,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.37 $
+# Generated by ruby-fakegem.eclass $Revision: 1.38 $
 
 require 'rubygems'
 





^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2012-08-19  7:45 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2012-08-19  7:45 UTC (permalink / raw
  To: gentoo-commits

graaff      12/08/19 07:45:02

  Modified:             ruby-fakegem.eclass
  Log:
  Make sure to use UTF-8 encoding when reading YAML files with ruby19. Patch and bug report by Shunsuke Shimizu in bug 431276.

Revision  Changes    Path
1.37                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.37&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.37&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.36&r2=1.37

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- ruby-fakegem.eclass	15 Aug 2012 15:06:09 -0000	1.36
+++ ruby-fakegem.eclass	19 Aug 2012 07:45:02 -0000	1.37
@@ -1,6 +1,6 @@
 # Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.36 2012/08/15 15:06:09 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.37 2012/08/19 07:45:02 graaff Exp $
 
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -245,7 +245,14 @@
 # the metadata distributed by the gem itself. This is similar to how
 # rubygems creates an installation from a .gem file.
 ruby_fakegem_metadata_gemspec() {
-	${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2
+	case ${RUBY} in
+		*ruby19)
+			${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2
+				;;
+		*)
+			${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2
+				;;
+	esac
 }
 
 # @FUNCTION: ruby_fakegem_genspec
@@ -273,7 +280,7 @@
 	# so better taking this into consideration.
 	local quoted_description=${DESCRIPTION//\"/\\\"}
 	cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.36 $
+# generated by ruby-fakegem.eclass $Revision: 1.37 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -323,7 +330,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.36 $
+# Generated by ruby-fakegem.eclass $Revision: 1.37 $
 
 require 'rubygems'
 





^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2011-12-05 12:24 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2011-12-05 12:24 UTC (permalink / raw
  To: gentoo-commits

graaff      11/12/05 12:24:33

  Modified:             ruby-fakegem.eclass
  Log:
  Add documentation for RUBY_FAKEGEM_EXTRAINSTALL.

Revision  Changes    Path
1.32                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.32&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.32&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.31&r2=1.32

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- ruby-fakegem.eclass	21 Oct 2011 06:32:29 -0000	1.31
+++ ruby-fakegem.eclass	5 Dec 2011 12:24:33 -0000	1.32
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.31 2011/10/21 06:32:29 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.32 2011/12/05 12:24:33 graaff Exp $
 
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -61,6 +61,13 @@
 # Filename of .gemspec file to install instead of generating a generic one.
 # RUBY_FAKEGEM_GEMSPEC=""
 
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_EXTRAINSTALL
+# @DESCRIPTION:
+# List of files and directories relative to the top directory that also
+# get installed. Some gems provide extra files such as version information,
+# Rails generators, or data that needs to be installed as well.
+# RUBY_FAKEGEM_EXTRAINSTALL=""
+
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV/_pre/.pre}}"
 RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
@@ -209,7 +216,7 @@
 	# so better taking this into consideration.
 	local quoted_description=${DESCRIPTION//\"/\\\"}
 	cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.31 $
+# generated by ruby-fakegem.eclass $Revision: 1.32 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -259,7 +266,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.31 $
+# Generated by ruby-fakegem.eclass $Revision: 1.32 $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2011-10-21  6:32 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2011-10-21  6:32 UTC (permalink / raw
  To: gentoo-commits

graaff      11/10/21 06:32:29

  Modified:             ruby-fakegem.eclass
  Log:
  Switch to virtual/rubygems in preparation of adding ruby targets with bundled rubygems.

Revision  Changes    Path
1.31                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.31&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.31&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.30&r2=1.31

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ruby-fakegem.eclass	22 Aug 2011 04:46:32 -0000	1.30
+++ ruby-fakegem.eclass	21 Oct 2011 06:32:29 -0000	1.31
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.30 2011/08/22 04:46:32 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.31 2011/10/21 06:32:29 graaff Exp $
 
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -86,8 +86,8 @@
 
 SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
 
-ruby_add_bdepend dev-ruby/rubygems
-ruby_add_rdepend dev-ruby/rubygems
+ruby_add_bdepend virtual/rubygems
+ruby_add_rdepend virtual/rubygems
 
 # @FUNCTION: ruby_fakegem_gemsdir
 # @RETURN: Returns the gem data directory
@@ -209,7 +209,7 @@
 	# so better taking this into consideration.
 	local quoted_description=${DESCRIPTION//\"/\\\"}
 	cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.30 $
+# generated by ruby-fakegem.eclass $Revision: 1.31 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -259,7 +259,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.30 $
+# Generated by ruby-fakegem.eclass $Revision: 1.31 $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2011-04-25  8:36 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2011-04-25  8:36 UTC (permalink / raw
  To: gentoo-commits

graaff      11/04/25 08:36:51

  Modified:             ruby-fakegem.eclass
  Log:
  Fix typo.

Revision  Changes    Path
1.29                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.29&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.29&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.28&r2=1.29

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- ruby-fakegem.eclass	5 Mar 2011 06:58:00 -0000	1.28
+++ ruby-fakegem.eclass	25 Apr 2011 08:36:51 -0000	1.29
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.28 2011/03/05 06:58:00 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.29 2011/04/25 08:36:51 graaff Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -212,7 +212,7 @@
 	# so better taking this into consideration.
 	local quoted_description=${DESCRIPTION//\"/\\\"}
 	cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.28 $
+# generated by ruby-fakegem.eclass $Revision: 1.29 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -262,7 +262,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.28 $
+# Generated by ruby-fakegem.eclass $Revision: 1.29 $
 
 require 'rubygems'
 
@@ -295,7 +295,7 @@
 	for archive in ${A}; do
 		case "${archive}" in
 			*.gem)
-				# Make sure that we're not running unoack for more than
+				# Make sure that we're not running unpack for more than
 				# one .gem file, since we won't support that at all.
 				[[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2011-03-05  6:58 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2011-03-05  6:58 UTC (permalink / raw
  To: gentoo-commits

graaff      11/03/05 06:58:00

  Modified:             ruby-fakegem.eclass
  Log:
  Add missing 'die' statement.

Revision  Changes    Path
1.28                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.28&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.28&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.27&r2=1.28

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- ruby-fakegem.eclass	28 Dec 2010 12:07:15 -0000	1.27
+++ ruby-fakegem.eclass	5 Mar 2011 06:58:00 -0000	1.28
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.27 2010/12/28 12:07:15 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.28 2011/03/05 06:58:00 graaff Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -161,7 +161,7 @@
 				ruby_fakegem_genspec ${gemspec}
 			fi
 		fi
-	) || "Unable to generate gemspec file."
+	) || die "Unable to generate gemspec file."
 
 	insinto $(ruby_fakegem_gemsdir)/specifications
 	newins ${gemspec} ${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gemspec || die "Unable to install gemspec file."
@@ -212,7 +212,7 @@
 	# so better taking this into consideration.
 	local quoted_description=${DESCRIPTION//\"/\\\"}
 	cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.27 $
+# generated by ruby-fakegem.eclass $Revision: 1.28 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -262,7 +262,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.27 $
+# Generated by ruby-fakegem.eclass $Revision: 1.28 $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-12-28 12:07 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2010-12-28 12:07 UTC (permalink / raw
  To: gentoo-commits

graaff      10/12/28 12:07:15

  Modified:             ruby-fakegem.eclass
  Log:
  Try to install the normal upstream gemspec file from either the gem metadata or the source gemspec file and use our own version only as a fallback.

Revision  Changes    Path
1.27                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.27&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.27&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.26&r2=1.27

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- ruby-fakegem.eclass	18 Dec 2010 09:57:24 -0000	1.26
+++ ruby-fakegem.eclass	28 Dec 2010 12:07:15 -0000	1.27
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.26 2010/12/18 09:57:24 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.27 2010/12/28 12:07:15 graaff Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -59,6 +59,11 @@
 # Extra require paths (beside lib) to add to the specification
 # RUBY_FAKEGEM_REQUIRE_PATHS=""
 
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_GEMSPEC
+# @DESCRIPTION:
+# Filename of .gemspec file to install instead of generating a generic one.
+# RUBY_FAKEGEM_GEMSPEC=""
+
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV/_pre/.pre}}"
 RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
@@ -84,6 +89,7 @@
 
 SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
 
+ruby_add_bdepend dev-ruby/rubygems
 ruby_add_rdepend dev-ruby/rubygems
 
 # @FUNCTION: ruby_fakegem_gemsdir
@@ -135,28 +141,78 @@
 	) || die "failed $0 $@"
 }
 
+# @FUNCTION: ruby_fakegem_install_gemspec
+# @DESCRIPTION:
+# Install a .gemspec file for this package. Either use the file indicated
+# by the RUBY_FAKEGEM_GEMSPEC variable, or generate one using
+# ruby_fakegem_genspec.
+ruby_fakegem_install_gemspec() {
+	local gemspec="${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation}
+
+	(
+		if [[ ${RUBY_FAKEGEM_GEMSPEC} != "" ]]; then
+			ruby_fakegem_gemspec_gemspec ${RUBY_FAKEGEM_GEMSPEC} ${gemspec}
+		else
+			local metadata="${WORKDIR}"/${_ruby_implementation}/metadata
+
+			if [[ -e ${metadata} ]]; then
+				ruby_fakegem_metadata_gemspec ${metadata} ${gemspec}
+			else
+				ruby_fakegem_genspec ${gemspec}
+			fi
+		fi
+	) || "Unable to generate gemspec file."
+
+	insinto $(ruby_fakegem_gemsdir)/specifications
+	newins ${gemspec} ${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gemspec || die "Unable to install gemspec file."
+}
+
+# @FUNCTION: ruby_fakegem_gemspec_gemspec
+# @USAGE: gemspec-input gemspec-output
+# @DESCRIPTION:
+# Generates an installable version of the specification indicated by
+# RUBY_FAKEGEM_GEMSPEC. This file is eval'ed to produce a final specification
+# in a way similar to packaging the gemspec file.
+ruby_fakegem_gemspec_gemspec() {
+	${RUBY} -e "puts eval(File::open('$1').read).to_ruby" > $2
+}
+
+# @FUNCTION: ruby_fakegem_metadata_gemspec
+# @USAGE: gemspec-metadata gemspec-output
+# @DESCRIPTION:
+# Generates an installable version of the specification indicated by
+# the metadata distributed by the gem itself. This is similar to how
+# rubygems creates an installation from a .gem file.
+ruby_fakegem_metadata_gemspec() {
+	${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2
+}
+
 # @FUNCTION: ruby_fakegem_genspec
+# @USAGE: output-gemspec
 # @DESCRIPTION:
 # Generates a gemspec for the package and places it into the "specifications"
 # directory of RubyGems.
+# If the metadata normally distributed with a gem is present then that is
+# used to generate the gemspec file.
+#
+# As a fallback we can generate our own version.
 # In the gemspec, the following values are set: name, version, summary,
 # homepage, and require_paths=["lib"].
 # See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version.
 # See RUBY_FAKEGEM_REQUIRE_PATHS for setting extra require paths.
 ruby_fakegem_genspec() {
-	(
-		local required_paths="'lib'"
-		for path in ${RUBY_FAKEGEM_REQUIRE_PATHS}; do
-			required_paths="${required_paths}, '${path}'"
-		done
+	local required_paths="'lib'"
+	for path in ${RUBY_FAKEGEM_REQUIRE_PATHS}; do
+		required_paths="${required_paths}, '${path}'"
+	done
 
-		# We use the _ruby_implementation variable to avoid having stray
-		# copies with different implementations; while for now we're using
-		# the same exact content, we might have differences in the future,
-		# so better taking this into consideration.
-		local quoted_description=${DESCRIPTION//\"/\\\"}
-		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.26 $
+	# We use the _ruby_implementation variable to avoid having stray
+	# copies with different implementations; while for now we're using
+	# the same exact content, we might have differences in the future,
+	# so better taking this into consideration.
+	local quoted_description=${DESCRIPTION//\"/\\\"}
+	cat - > $1 <<EOF
+# generated by ruby-fakegem.eclass $Revision: 1.27 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -165,10 +221,6 @@
   s.require_paths = [${required_paths}]
 end
 EOF
-
-		insinto $(ruby_fakegem_gemsdir)/specifications
-		newins "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} ${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gemspec
-	) || die "Unable to install fake gemspec"
 }
 
 # @FUNCTION: ruby_fakegem_binwrapper
@@ -210,7 +262,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.26 $
+# Generated by ruby-fakegem.eclass $Revision: 1.27 $
 
 require 'rubygems'
 
@@ -251,12 +303,17 @@
 				tar -mxf ${DISTDIR}/${archive} || die
 				eend $?
 
+				ebegin "Uncompressing metadata"
+				gunzip metadata.gz || die
+				eend $?
+
 				mkdir "${S}"
 				pushd "${S}" &>/dev/null
 
 				ebegin "Unpacking data.tar.gz"
 				tar -mxf "${my_WORKDIR}"/data.tar.gz || die
 				eend $?
+
 				popd &>/dev/null
 				;;
 			*.patch.bz2)
@@ -302,7 +359,7 @@
 # @DESCRIPTION:
 # Install the package for each ruby target.
 each_fakegem_install() {
-	ruby_fakegem_genspec
+	ruby_fakegem_install_gemspec
 
 	local _gemlibdirs="${RUBY_FAKEGEM_EXTRAINSTALL}"
 	for directory in bin lib; do






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-12-18  9:57 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2010-12-18  9:57 UTC (permalink / raw
  To: gentoo-commits

graaff      10/12/18 09:57:24

  Modified:             ruby-fakegem.eclass
  Log:
  Revert mistaken commit of new gemspec-related code, but keep new dependency on dev-ruby/rubygems instead of virtual.

Revision  Changes    Path
1.26                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.26&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.26&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.25&r2=1.26

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- ruby-fakegem.eclass	18 Dec 2010 09:50:08 -0000	1.25
+++ ruby-fakegem.eclass	18 Dec 2010 09:57:24 -0000	1.26
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.25 2010/12/18 09:50:08 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.26 2010/12/18 09:57:24 graaff Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -59,11 +59,6 @@
 # Extra require paths (beside lib) to add to the specification
 # RUBY_FAKEGEM_REQUIRE_PATHS=""
 
-# @ECLASS-VARIABLE: RUBY_FAKEGEM_GEMSPEC
-# @DESCRIPTION:
-# Filename of .gemspec file to install instead of generating a generic one.
-# RUBY_FAKEGEM_GEMSPEC=""
-
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV/_pre/.pre}}"
 RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
@@ -140,22 +135,6 @@
 	) || die "failed $0 $@"
 }
 
-# @FUNCTION: ruby_fakegem_gemspec
-# @DESCRIPTION:
-# Install a .gemspec file for this package. Either use the file indicated
-# by the RUBY_FAKEGEM_GEMSPEC variable, or generate one using
-# ruby_fakegem_genspec
-ruby_fakegem_gemspec() {
-	if [[ ${RUBY_FAKEGEM_GEMSPEC} != "" ]]; then
-		(
-			insinto $(ruby_fakegem_gemsdir)/specifications
-			newins "${RUBY_FAKEGEM_GEMSPEC}" ${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gemspec
-		) || die "Unable to install ${RUBY_FAKEGEM_GEMSPEC} gemspec"
-	else
-		ruby_fakegem_genspec
-	fi
-}
-
 # @FUNCTION: ruby_fakegem_genspec
 # @DESCRIPTION:
 # Generates a gemspec for the package and places it into the "specifications"
@@ -177,7 +156,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.25 $
+# generated by ruby-fakegem.eclass $Revision: 1.26 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -231,7 +210,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.25 $
+# Generated by ruby-fakegem.eclass $Revision: 1.26 $
 
 require 'rubygems'
 
@@ -323,7 +302,7 @@
 # @DESCRIPTION:
 # Install the package for each ruby target.
 each_fakegem_install() {
-	ruby_fakegem_gemspec
+	ruby_fakegem_genspec
 
 	local _gemlibdirs="${RUBY_FAKEGEM_EXTRAINSTALL}"
 	for directory in bin lib; do






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-12-18  9:50 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2010-12-18  9:50 UTC (permalink / raw
  To: gentoo-commits

graaff      10/12/18 09:50:08

  Modified:             ruby-fakegem.eclass
  Log:
  Depend directly on dev-ruby/rubygems again since we no longer have ruby targets providing rubygems themselves.

Revision  Changes    Path
1.25                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.25&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.25&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.24&r2=1.25

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- ruby-fakegem.eclass	23 Sep 2010 06:47:01 -0000	1.24
+++ ruby-fakegem.eclass	18 Dec 2010 09:50:08 -0000	1.25
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.24 2010/09/23 06:47:01 grobian Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.25 2010/12/18 09:50:08 graaff Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -59,6 +59,11 @@
 # Extra require paths (beside lib) to add to the specification
 # RUBY_FAKEGEM_REQUIRE_PATHS=""
 
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_GEMSPEC
+# @DESCRIPTION:
+# Filename of .gemspec file to install instead of generating a generic one.
+# RUBY_FAKEGEM_GEMSPEC=""
+
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV/_pre/.pre}}"
 RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
@@ -84,7 +89,7 @@
 
 SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
 
-ruby_add_rdepend virtual/rubygems
+ruby_add_rdepend dev-ruby/rubygems
 
 # @FUNCTION: ruby_fakegem_gemsdir
 # @RETURN: Returns the gem data directory
@@ -135,6 +140,22 @@
 	) || die "failed $0 $@"
 }
 
+# @FUNCTION: ruby_fakegem_gemspec
+# @DESCRIPTION:
+# Install a .gemspec file for this package. Either use the file indicated
+# by the RUBY_FAKEGEM_GEMSPEC variable, or generate one using
+# ruby_fakegem_genspec
+ruby_fakegem_gemspec() {
+	if [[ ${RUBY_FAKEGEM_GEMSPEC} != "" ]]; then
+		(
+			insinto $(ruby_fakegem_gemsdir)/specifications
+			newins "${RUBY_FAKEGEM_GEMSPEC}" ${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gemspec
+		) || die "Unable to install ${RUBY_FAKEGEM_GEMSPEC} gemspec"
+	else
+		ruby_fakegem_genspec
+	fi
+}
+
 # @FUNCTION: ruby_fakegem_genspec
 # @DESCRIPTION:
 # Generates a gemspec for the package and places it into the "specifications"
@@ -156,7 +177,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.24 $
+# generated by ruby-fakegem.eclass $Revision: 1.25 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -210,7 +231,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.24 $
+# Generated by ruby-fakegem.eclass $Revision: 1.25 $
 
 require 'rubygems'
 
@@ -302,7 +323,7 @@
 # @DESCRIPTION:
 # Install the package for each ruby target.
 each_fakegem_install() {
-	ruby_fakegem_genspec
+	ruby_fakegem_gemspec
 
 	local _gemlibdirs="${RUBY_FAKEGEM_EXTRAINSTALL}"
 	for directory in bin lib; do






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-09-23  6:47 Fabian Groffen (grobian)
  0 siblings, 0 replies; 33+ messages in thread
From: Fabian Groffen (grobian) @ 2010-09-23  6:47 UTC (permalink / raw
  To: gentoo-commits

grobian     10/09/23 06:47:01

  Modified:             ruby-fakegem.eclass
  Log:
  fix fake-rubygem.eclass for Prefix, bug #336906

Revision  Changes    Path
1.24                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.24&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.24&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.23&r2=1.24

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- ruby-fakegem.eclass	30 Aug 2010 22:08:24 -0000	1.23
+++ ruby-fakegem.eclass	23 Sep 2010 06:47:01 -0000	1.24
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.23 2010/08/30 22:08:24 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.24 2010/09/23 06:47:01 grobian Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -92,7 +92,11 @@
 # This function returns the gems data directory for the ruby
 # implementation in question.
 ruby_fakegem_gemsdir() {
-	local _gemsitedir=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' | sed -e 's:site_ruby:gems:')
+	has "${EAPI}" 2 && ! use prefix && EPREFIX=
+
+	local _gemsitedir=$(ruby_rbconfig_value 'sitelibdir')
+	_gemsitedir=${_gemsitedir//site_ruby/gems}
+	_gemsitedir=${_gemsitedir#${EPREFIX}}
 
 	[[ -z ${_gemsitedir} ]] && {
 		eerror "Unable to find the gems dir"
@@ -152,7 +156,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.23 $
+# generated by ruby-fakegem.eclass $Revision: 1.24 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -206,7 +210,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.23 $
+# Generated by ruby-fakegem.eclass $Revision: 1.24 $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-07-29  9:38 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-07-29  9:38 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/07/29 09:38:10

  Modified:             ruby-fakegem.eclass
  Log:
  When unpacking, don't unpack patch files.
  
  Since we can declare the patches as an array in global scope, _but_ we
  cannot use $WORKDIR in there (they are not extracted in proper
  $WORKDIR but rather $WORKDIR/all, then copied/hardlinked for the
  various implementations), there is no point into unpacking them when
  using .bz2.
  
  Rather, leave it to epatch to deal with them and for the rest of the time.

Revision  Changes    Path
1.22                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.22&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.22&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.21&r2=1.22

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- ruby-fakegem.eclass	27 Jul 2010 11:02:47 -0000	1.21
+++ ruby-fakegem.eclass	29 Jul 2010 09:38:09 -0000	1.22
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.21 2010/07/27 11:02:47 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.22 2010/07/29 09:38:09 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -152,7 +152,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.21 $
+# generated by ruby-fakegem.eclass $Revision: 1.22 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -206,7 +206,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.21 $
+# Generated by ruby-fakegem.eclass $Revision: 1.22 $
 
 require 'rubygems'
 
@@ -237,25 +237,36 @@
 	# extracted twice and the mtime from the archive _has_ to be
 	# ignored (it's always set to epoch 0).
 	for archive in ${A}; do
-		if [[ ${archive} == *.gem ]]; then
-			# Make sure that we're not running unoack for more than
-			# one .gem file, since we won't support that at all.
-			[[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
-
-			ebegin "Unpacking .gem file..."
-			tar -mxf ${DISTDIR}/${archive} || die
-			eend $?
-
-			mkdir "${S}"
-			pushd "${S}" &>/dev/null
-
-			ebegin "Unpacking data.tar.gz"
-			tar -mxf "${my_WORKDIR}"/data.tar.gz || die
-			eend $?
-			popd &>/dev/null
-		else
-			unpack ${archive}
-		fi
+		case "${archive}" in
+			*.gem)
+				# Make sure that we're not running unoack for more than
+				# one .gem file, since we won't support that at all.
+				[[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
+
+				ebegin "Unpacking .gem file..."
+				tar -mxf ${DISTDIR}/${archive} || die
+				eend $?
+
+				mkdir "${S}"
+				pushd "${S}" &>/dev/null
+
+				ebegin "Unpacking data.tar.gz"
+				tar -mxf "${my_WORKDIR}"/data.tar.gz || die
+				eend $?
+				popd &>/dev/null
+				;;
+			*.patch.bz2)
+				# We apply the patches with RUBY_PATCHES directly from DISTDIR,
+				# as the WORKDIR variable changes value between the global-scope
+				# and the time all_ruby_unpack/_prepare are called. Since we can
+				# simply decompress them when applying, this is much easier to
+				# deal with for us.
+				einfo "Keeping ${archive} as-is"
+				;;
+			*)
+				unpack ${archive}
+				;;
+		esac
 	done
 }
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-07-27 11:02 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-07-27 11:02 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/07/27 11:02:47

  Modified:             ruby-fakegem.eclass
  Log:
  If RUBY_FAKEGEM_DOCDIR is set, the ebuild should have the doc USE flag.

Revision  Changes    Path
1.21                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.21&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.21&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.20&r2=1.21

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- ruby-fakegem.eclass	21 Jul 2010 10:43:57 -0000	1.20
+++ ruby-fakegem.eclass	27 Jul 2010 11:02:47 -0000	1.21
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.20 2010/07/21 10:43:57 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.21 2010/07/27 11:02:47 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -73,6 +73,10 @@
 	ruby_add_bdepend "doc? ( dev-ruby/rake )"
 fi
 
+if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]]; then
+	IUSE="$IUSE doc"
+fi
+
 if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
 	IUSE="$IUSE test"
 	ruby_add_bdepend "test? ( dev-ruby/rake )"
@@ -148,7 +152,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.20 $
+# generated by ruby-fakegem.eclass $Revision: 1.21 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -202,7 +206,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.20 $
+# Generated by ruby-fakegem.eclass $Revision: 1.21 $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-07-21 10:43 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-07-21 10:43 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/07/21 10:43:58

  Modified:             ruby-fakegem.eclass
  Log:
  Allow installing documentation even if there is no documentation task defined.

Revision  Changes    Path
1.20                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.20&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.20&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.19&r2=1.20

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- ruby-fakegem.eclass	21 Jul 2010 10:42:38 -0000	1.19
+++ ruby-fakegem.eclass	21 Jul 2010 10:43:57 -0000	1.20
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.19 2010/07/21 10:42:38 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.20 2010/07/21 10:43:57 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -148,7 +148,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.19 $
+# generated by ruby-fakegem.eclass $Revision: 1.20 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -202,7 +202,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.19 $
+# Generated by ruby-fakegem.eclass $Revision: 1.20 $
 
 require 'rubygems'
 
@@ -305,8 +305,10 @@
 # @DESCRIPTION:
 # Install files common to all ruby targets.
 all_fakegem_install() {
-	if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]] && use doc; then
+	if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
 		for dir in ${RUBY_FAKEGEM_DOCDIR}; do
+			[[ -d ${dir} ]] || continue
+
 			pushd ${dir} &>/dev/null
 			dohtml -r * || die "failed to install documentation"
 			popd &>/dev/null






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-07-21 10:42 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-07-21 10:42 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/07/21 10:42:38

  Modified:             ruby-fakegem.eclass
  Log:
  Allow multiple archives in SRC_URI, and unpack them properly.
  
  Note: this requires that there is at most one .gem file, as it'll be
  failing if ${S} exists when going to unpack the gem.

Revision  Changes    Path
1.19                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.19&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.19&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.18&r2=1.19

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- ruby-fakegem.eclass	24 May 2010 07:34:14 -0000	1.18
+++ ruby-fakegem.eclass	21 Jul 2010 10:42:38 -0000	1.19
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.18 2010/05/24 07:34:14 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.19 2010/07/21 10:42:38 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -148,7 +148,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.18 $
+# generated by ruby-fakegem.eclass $Revision: 1.19 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -202,7 +202,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.18 $
+# Generated by ruby-fakegem.eclass $Revision: 1.19 $
 
 require 'rubygems'
 
@@ -232,25 +232,27 @@
 	# Special support for extracting .gem files; the file need to be
 	# extracted twice and the mtime from the archive _has_ to be
 	# ignored (it's always set to epoch 0).
-	#
-	# This only works if there is exactly one archive and that archive
-	# is a .gem file!
-	if [[ $(wc -w <<< ${A}) == 1 ]] &&
-		[[ ${A} == *.gem ]]; then
-		ebegin "Unpacking .gem file..."
-		tar -mxf ${DISTDIR}/${A} || die
-		eend $?
-
-		mkdir "${S}"
-		pushd "${S}" &>/dev/null
-
-		ebegin "Unpacking data.tar.gz"
-		tar -mxf "${my_WORKDIR}"/data.tar.gz || die
-		eend $?
-		popd &>/dev/null
-	else
-		[[ -n ${A} ]] && unpack ${A}
-	fi
+	for archive in ${A}; do
+		if [[ ${archive} == *.gem ]]; then
+			# Make sure that we're not running unoack for more than
+			# one .gem file, since we won't support that at all.
+			[[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
+
+			ebegin "Unpacking .gem file..."
+			tar -mxf ${DISTDIR}/${archive} || die
+			eend $?
+
+			mkdir "${S}"
+			pushd "${S}" &>/dev/null
+
+			ebegin "Unpacking data.tar.gz"
+			tar -mxf "${my_WORKDIR}"/data.tar.gz || die
+			eend $?
+			popd &>/dev/null
+		else
+			unpack ${archive}
+		fi
+	done
 }
 
 # @FUNCTION: all_ruby_compile






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-05-24  7:34 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-05-24  7:34 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/05/24 07:34:14

  Modified:             ruby-fakegem.eclass
  Log:
  Use the new syntax for rake dependencies.

Revision  Changes    Path
1.18                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.18&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.18&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.17&r2=1.18

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ruby-fakegem.eclass	19 Feb 2010 11:59:38 -0000	1.17
+++ ruby-fakegem.eclass	24 May 2010 07:34:14 -0000	1.18
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.17 2010/02/19 11:59:38 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.18 2010/05/24 07:34:14 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -70,12 +70,12 @@
 
 if [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]]; then
 	IUSE="$IUSE doc"
-	ruby_add_bdepend doc "dev-ruby/rake"
+	ruby_add_bdepend "doc? ( dev-ruby/rake )"
 fi
 
 if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
 	IUSE="$IUSE test"
-	ruby_add_bdepend test "dev-ruby/rake"
+	ruby_add_bdepend "test? ( dev-ruby/rake )"
 fi
 
 SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
@@ -148,7 +148,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.17 $
+# generated by ruby-fakegem.eclass $Revision: 1.18 $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -202,7 +202,7 @@
 #!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass $Revision: 1.17 $
+# Generated by ruby-fakegem.eclass $Revision: 1.18 $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-02-19 11:58 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-02-19 11:58 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/02/19 11:58:37

  Modified:             ruby-fakegem.eclass
  Log:
  Don't create generic wrappers when installing for a single implementation.
  
  Since we have a few packages that can only be installed for JRuby, and
  that thus wouldn't work with any of the selected implementations, and
  a few that installs only for Ruby 1.8 (and thus would break if 1.9 was
  selected), try to reduce their impact by only producing generic
  wrappers when installing for multiple implementations.
  
  This should produce a totally working system after updating from 1.9,
  among other things.
  
  To make sure that the wrappers generated by different revisions of
  ruby-fakegem.eclass are properly identified, also add the CVS ID of
  the eclass in the comments of the generated wrapper.
  
  At the same time add the same specification about generation to the
  gemspec files, so that we can identify “older” specifications quickly.

Revision  Changes    Path
1.16                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.16&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.16&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.15&r2=1.16

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- ruby-fakegem.eclass	19 Feb 2010 08:47:36 -0000	1.15
+++ ruby-fakegem.eclass	19 Feb 2010 11:58:36 -0000	1.16
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.15 2010/02/19 08:47:36 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.16 2010/02/19 11:58:36 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -148,6 +148,7 @@
 		# so better taking this into consideration.
 		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
+# generated by ruby-fakegem.eclass $Id: ruby-fakegem.eclass,v 1.16 2010/02/19 11:58:36 flameeyes Exp $
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -175,11 +176,33 @@
 		local binpath=$(dirname $newbinary)
 		[[ ${binpath} = . ]] && binpath=/usr/bin
 
+		# Try to find out whether the package is going to install for
+		# one or multiple implementations; if we're installing for a
+		# *single* implementation, no need to use “/usr/bin/env ruby”
+		# in the shebang, and we can actually avoid errors when
+		# calling the script by default (see for instance the
+		# JRuby-specific commands).
+		local rubycmd=
+		for implementation in ${USE_RUBY}; do
+			# ignore non-enabled implementations
+			use ruby_targets_${implementation} || continue
+			if [ -z $rubycmd ]; then
+				# if no other implementation was set before, set it.
+				rubycmd="/usr/bin/${implementation}"
+			else
+				# if another implementation already arrived, then make
+				# it generic and break out of the loop. This ensures
+				# that we do at most two iterations.
+				rubycmd="/usr/bin/env ruby"
+				break
+			fi
+		done
+
 		cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
-#!/usr/bin/env ruby
+#!${rubycmd}
 # This is a simplified version of the RubyGems wrapper
 #
-# Generated by ruby-fakegem.eclass
+# Generated by ruby-fakegem.eclass $Id: ruby-fakegem.eclass,v 1.16 2010/02/19 11:58:36 flameeyes Exp $
 
 require 'rubygems'
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-02-19  8:47 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-02-19  8:47 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/02/19 08:47:37

  Modified:             ruby-fakegem.eclass
  Log:
  Add support for suffixes to a gem (like .java) and support for
  pre-release mangling (_pre becomes .pre).

Revision  Changes    Path
1.15                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.15&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.15&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.14&r2=1.15

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ruby-fakegem.eclass	13 Feb 2010 08:45:03 -0000	1.14
+++ ruby-fakegem.eclass	19 Feb 2010 08:47:36 -0000	1.15
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.14 2010/02/13 08:45:03 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.15 2010/02/19 08:47:36 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -60,7 +60,8 @@
 # RUBY_FAKEGEM_REQUIRE_PATHS=""
 
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
-RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV}}"
+RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV/_pre/.pre}}"
+RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
 
 RUBY_FAKEGEM_TASK_DOC="${RUBY_FAKEGEM_TASK_DOC-rdoc}"
 RUBY_FAKEGEM_TASK_TEST="${RUBY_FAKEGEM_TASK_TEST-test}"
@@ -77,7 +78,7 @@
 	ruby_add_bdepend test "dev-ruby/rake"
 fi
 
-SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gem"
+SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
 
 ruby_add_rdepend virtual/rubygems
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-02-13  8:45 Hans de Graaff (graaff)
  0 siblings, 0 replies; 33+ messages in thread
From: Hans de Graaff (graaff) @ 2010-02-13  8:45 UTC (permalink / raw
  To: gentoo-commits

graaff      10/02/13 08:45:04

  Modified:             ruby-fakegem.eclass
  Log:
  Take into account that the description may contain double quotes and quote them to avoid generating invalid ruby code. Fixes #304723.

Revision  Changes    Path
1.14                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.14&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.14&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.13&r2=1.14

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ruby-fakegem.eclass	24 Jan 2010 00:00:40 -0000	1.13
+++ ruby-fakegem.eclass	13 Feb 2010 08:45:03 -0000	1.14
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.13 2010/01/24 00:00:40 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.14 2010/02/13 08:45:03 graaff Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -145,11 +145,12 @@
 		# copies with different implementations; while for now we're using
 		# the same exact content, we might have differences in the future,
 		# so better taking this into consideration.
+		local quoted_description=${DESCRIPTION//\"/\\\"}
 		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
 Gem::Specification.new do |s|
   s.name = "${RUBY_FAKEGEM_NAME}"
   s.version = "${RUBY_FAKEGEM_VERSION}"
-  s.summary = "${DESCRIPTION}"
+  s.summary = "${quoted_description}"
   s.homepage = "${HOMEPAGE}"
   s.require_paths = [${required_paths}]
 end






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-01-24  0:00 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-01-24  0:00 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/01/24 00:00:41

  Modified:             ruby-fakegem.eclass
  Log:
  Define each_ruby_test in ruby-fakegem only if a test task is defined.
  
  With this change you won't get further output during test phase if
  there is no fakegem test going to be executed. Packages will still be
  able to inject their each_ruby_test function to run custom test
  commands.

Revision  Changes    Path
1.13                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.13&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.13&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.12&r2=1.13

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ruby-fakegem.eclass	21 Jan 2010 10:18:59 -0000	1.12
+++ ruby-fakegem.eclass	24 Jan 2010 00:00:40 -0000	1.13
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.12 2010/01/21 10:18:59 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.13 2010/01/24 00:00:40 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -240,20 +240,17 @@
 # Run tests for the package for each ruby target if the test task is defined.
 each_fakegem_test() {
 	local rubyflags=
-
-	if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
-		${RUBY} ${rubyflags} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
-	else
-		echo "No test task defined, skipping tests."
-	fi
+	${RUBY} ${rubyflags} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
 }
 
-# @FUNCTION: each_ruby_test
-# @DESCRIPTION:
-# Run the tests for this package.
-each_ruby_test() {
-	each_fakegem_test
-}
+if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
+	# @FUNCTION: each_ruby_test
+	# @DESCRIPTION:
+	# Run the tests for this package.
+	each_ruby_test() {
+		each_fakegem_test
+	}
+fi
 
 # @FUNCTION: each_fakegem_install
 # @DESCRIPTION:






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-01-21 10:18 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-01-21 10:18 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/01/21 10:18:59

  Modified:             ruby-fakegem.eclass
  Log:
  Default to installing the binary wrapper to /usr/bin, when calling
  with just a basename for the wrapped tool.
  
  Thanks to Klaus Birkelund Jensen for reporting, in bug #301621.

Revision  Changes    Path
1.12                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.12&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.12&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.11&r2=1.12

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ruby-fakegem.eclass	18 Jan 2010 22:01:46 -0000	1.11
+++ ruby-fakegem.eclass	21 Jan 2010 10:18:59 -0000	1.12
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.11 2010/01/18 22:01:46 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.12 2010/01/21 10:18:59 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -170,6 +170,8 @@
 		local gembinary=$1
 		local newbinary=${2:-/usr/bin/$gembinary}
 		local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
+		local binpath=$(dirname $newbinary)
+		[[ ${binpath} = . ]] && binpath=/usr/bin
 
 		cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
 #!/usr/bin/env ruby
@@ -183,7 +185,7 @@
 
 EOF
 
-		exeinto $(dirname $newbinary)
+		exeinto ${binpath:-/usr/bin}
 		newexe "${T}"/gembin-wrapper-${gembinary} $(basename $newbinary)
 	) || die "Unable to create fakegem wrapper"
 }






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-01-18 22:01 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-01-18 22:01 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/01/18 22:01:46

  Modified:             ruby-fakegem.eclass
  Log:
  Always install the EXTRAINSTALL content, this also allows it to be files rather than just directories

Revision  Changes    Path
1.11                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.11&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.11&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.10&r2=1.11

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- ruby-fakegem.eclass	9 Jan 2010 21:16:37 -0000	1.10
+++ ruby-fakegem.eclass	18 Jan 2010 22:01:46 -0000	1.11
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.10 2010/01/09 21:16:37 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.11 2010/01/18 22:01:46 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -215,11 +215,12 @@
 		eend $?
 
 		mkdir "${S}"
-		pushd "${S}"
+		pushd "${S}" &>/dev/null
 
 		ebegin "Unpacking data.tar.gz"
 		tar -mxf "${my_WORKDIR}"/data.tar.gz || die
 		eend $?
+		popd &>/dev/null
 	else
 		[[ -n ${A} ]] && unpack ${A}
 	fi
@@ -258,8 +259,8 @@
 each_fakegem_install() {
 	ruby_fakegem_genspec
 
-	local _gemlibdirs=
-	for directory in bin lib ${RUBY_FAKEGEM_EXTRAINSTALL}; do
+	local _gemlibdirs="${RUBY_FAKEGEM_EXTRAINSTALL}"
+	for directory in bin lib; do
 		[[ -d ${directory} ]] && _gemlibdirs="${_gemlibdirs} ${directory}"
 	done
 
@@ -280,9 +281,9 @@
 all_fakegem_install() {
 	if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]] && use doc; then
 		for dir in ${RUBY_FAKEGEM_DOCDIR}; do
-			pushd ${dir}
+			pushd ${dir} &>/dev/null
 			dohtml -r * || die "failed to install documentation"
-			popd
+			popd &>/dev/null
 		done
 	fi
 
@@ -296,12 +297,12 @@
 		local bindir=$(find "${D}" -type d -path "*/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin" -print -quit)
 
 		if [[ -d "${bindir}" ]]; then
-			pushd "${bindir}"
+			pushd "${bindir}" &>/dev/null
 			local binaries=$(eval ls ${RUBY_FAKEGEM_BINWRAP})
 			for binary in $binaries; do
 				ruby_fakegem_binwrapper $binary
 			done
-			popd
+			popd &>/dev/null
 		fi
 	fi
 }






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-01-09 21:16 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-01-09 21:16 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/01/09 21:16:37

  Modified:             ruby-fakegem.eclass
  Log:
  Correct an undeclared IUSE doc and fix documentation for RUBY_FAKEGEM_REQUIRE_PATHS.

Revision  Changes    Path
1.10                 eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.10&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.10&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.9&r2=1.10

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ruby-fakegem.eclass	1 Jan 2010 23:13:26 -0000	1.9
+++ ruby-fakegem.eclass	9 Jan 2010 21:16:37 -0000	1.10
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.9 2010/01/01 23:13:26 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.10 2010/01/09 21:16:37 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -57,7 +57,7 @@
 # @ECLASS-VARIABLE: RUBY_FAKEGEM_REQUIRE_PATHS
 # @DESCRIPTION:
 # Extra require paths (beside lib) to add to the specification
-# RUBY_FAKEGEM_BINWRAP=""
+# RUBY_FAKEGEM_REQUIRE_PATHS=""
 
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV}}"
@@ -278,7 +278,7 @@
 # @DESCRIPTION:
 # Install files common to all ruby targets.
 all_fakegem_install() {
-	if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
+	if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]] && use doc; then
 		for dir in ${RUBY_FAKEGEM_DOCDIR}; do
 			pushd ${dir}
 			dohtml -r * || die "failed to install documentation"






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2010-01-01 23:13 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2010-01-01 23:13 UTC (permalink / raw
  To: gentoo-commits

flameeyes    10/01/01 23:13:26

  Modified:             ruby-fakegem.eclass
  Log:
  Don't error out if there is neither bin nor lib directories to install.
  
  This is the case of the pg gem for instance.

Revision  Changes    Path
1.9                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.9&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.9&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.8&r2=1.9

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- ruby-fakegem.eclass	26 Dec 2009 17:06:02 -0000	1.8
+++ ruby-fakegem.eclass	1 Jan 2010 23:13:26 -0000	1.9
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.8 2009/12/26 17:06:02 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.9 2010/01/01 23:13:26 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -263,7 +263,8 @@
 		[[ -d ${directory} ]] && _gemlibdirs="${_gemlibdirs} ${directory}"
 	done
 
-	ruby_fakegem_doins -r ${_gemlibdirs}
+	[[ -n ${_gemlibdirs} ]] && \
+		ruby_fakegem_doins -r ${_gemlibdirs}
 }
 
 # @FUNCTION: each_ruby_install






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-26 17:06 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-12-26 17:06 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/26 17:06:02

  Modified:             ruby-fakegem.eclass
  Log:
  Add a variable to explicit further required paths, useful for gems like RedCloth.

Revision  Changes    Path
1.8                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.8&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.8&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.7&r2=1.8

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ruby-fakegem.eclass	21 Dec 2009 19:07:38 -0000	1.7
+++ ruby-fakegem.eclass	26 Dec 2009 17:06:02 -0000	1.8
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.7 2009/12/21 19:07:38 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.8 2009/12/26 17:06:02 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -54,6 +54,11 @@
 # Binaries to wrap around (relative to the bin/ directory)
 # RUBY_FAKEGEM_BINWRAP="*"
 
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_REQUIRE_PATHS
+# @DESCRIPTION:
+# Extra require paths (beside lib) to add to the specification
+# RUBY_FAKEGEM_BINWRAP=""
+
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV}}"
 
@@ -128,8 +133,14 @@
 # In the gemspec, the following values are set: name, version, summary,
 # homepage, and require_paths=["lib"].
 # See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version.
+# See RUBY_FAKEGEM_REQUIRE_PATHS for setting extra require paths.
 ruby_fakegem_genspec() {
 	(
+		local required_paths="'lib'"
+		for path in ${RUBY_FAKEGEM_REQUIRE_PATHS}; do
+			required_paths="${required_paths}, '${path}'"
+		done
+
 		# We use the _ruby_implementation variable to avoid having stray
 		# copies with different implementations; while for now we're using
 		# the same exact content, we might have differences in the future,
@@ -140,7 +151,7 @@
   s.version = "${RUBY_FAKEGEM_VERSION}"
   s.summary = "${DESCRIPTION}"
   s.homepage = "${HOMEPAGE}"
-  s.require_paths = ["lib"]
+  s.require_paths = [${required_paths}]
 end
 EOF
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-21 19:07 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-12-21 19:07 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/21 19:07:38

  Modified:             ruby-fakegem.eclass
  Log:
  Allow for multiple documentation directories.

Revision  Changes    Path
1.7                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.7&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.7&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.6&r2=1.7

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ruby-fakegem.eclass	20 Dec 2009 23:39:43 -0000	1.6
+++ ruby-fakegem.eclass	21 Dec 2009 19:07:38 -0000	1.7
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.6 2009/12/20 23:39:43 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.7 2009/12/21 19:07:38 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -267,9 +267,11 @@
 # Install files common to all ruby targets.
 all_fakegem_install() {
 	if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
-		pushd ${RUBY_FAKEGEM_DOCDIR}
-		dohtml -r * || die "failed to install documentation"
-		popd
+		for dir in ${RUBY_FAKEGEM_DOCDIR}; do
+			pushd ${dir}
+			dohtml -r * || die "failed to install documentation"
+			popd
+		done
 	fi
 
 	if [[ -n ${RUBY_FAKEGEM_EXTRADOC} ]]; then






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-20 23:39 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-12-20 23:39 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/20 23:39:43

  Modified:             ruby-fakegem.eclass
  Log:
  Add a RAKE_FAKEGEM_BINWRAP variable.
  
  This way to just add command wrapping we won't be needing to define a function.
  This also defaults, the same as original rubygems, to all the binaries installed, but it can be tweaked.

Revision  Changes    Path
1.6                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.6&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.6&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.5&r2=1.6

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ruby-fakegem.eclass	16 Dec 2009 09:51:30 -0000	1.5
+++ ruby-fakegem.eclass	20 Dec 2009 23:39:43 -0000	1.6
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.5 2009/12/16 09:51:30 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.6 2009/12/20 23:39:43 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -49,12 +49,19 @@
 # Extra documentation to install (readme, changelogs, …).
 # RUBY_FAKEGEM_EXTRADOC=""
 
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_BINWRAP
+# @DESCRIPTION:
+# Binaries to wrap around (relative to the bin/ directory)
+# RUBY_FAKEGEM_BINWRAP="*"
+
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV}}"
 
 RUBY_FAKEGEM_TASK_DOC="${RUBY_FAKEGEM_TASK_DOC-rdoc}"
 RUBY_FAKEGEM_TASK_TEST="${RUBY_FAKEGEM_TASK_TEST-test}"
 
+RUBY_FAKEGEM_BINWRAP="${RUBY_FAKEGEM_BINWRAP-*}"
+
 if [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]]; then
 	IUSE="$IUSE doc"
 	ruby_add_bdepend doc "dev-ruby/rake"
@@ -268,6 +275,21 @@
 	if [[ -n ${RUBY_FAKEGEM_EXTRADOC} ]]; then
 		dodoc ${RUBY_FAKEGEM_EXTRADOC} || die "failed to install further documentation"
 	fi
+
+	# binary wrappers; we assume that all the implementations get the
+	# same binaries, or something is wrong anyway, so...
+	if [[ -n ${RUBY_FAKEGEM_BINWRAP} ]]; then
+		local bindir=$(find "${D}" -type d -path "*/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin" -print -quit)
+
+		if [[ -d "${bindir}" ]]; then
+			pushd "${bindir}"
+			local binaries=$(eval ls ${RUBY_FAKEGEM_BINWRAP})
+			for binary in $binaries; do
+				ruby_fakegem_binwrapper $binary
+			done
+			popd
+		fi
+	fi
 }
 
 # @FUNCTION: all_ruby_install






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-16  9:51 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-12-16  9:51 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/16 09:51:30

  Modified:             ruby-fakegem.eclass
  Log:
  Change the binary wrapper code.
  
  Instead of using the Gem code to find the gem itself (which only
  worked for gems whose library was named after the gem, and failed for
  spec and other packages), ask Gem for its system path (which will be
  dynamic depending on the Ruby implementation used) and affix the
  hardcoded relative path of the wrapper (which we know at merge time).
  
  Tested with rake, bluecloth, rspec, Ruby 1.8, 1.9 and JRuby.

Revision  Changes    Path
1.5                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.5&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.5&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.4&r2=1.5

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ruby-fakegem.eclass	15 Dec 2009 17:43:51 -0000	1.4
+++ ruby-fakegem.eclass	16 Dec 2009 09:51:30 -0000	1.5
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.4 2009/12/15 17:43:51 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.5 2009/12/16 09:51:30 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -151,6 +151,7 @@
 	(
 		local gembinary=$1
 		local newbinary=${2:-/usr/bin/$gembinary}
+		local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
 
 		cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
 #!/usr/bin/env ruby
@@ -160,7 +161,7 @@
 
 require 'rubygems'
 
-load Gem::GemPathSearcher.new.find('$(tr [A-Z] [a-z] <<< ${RUBY_FAKEGEM_NAME})').full_gem_path + "/bin/${gembinary}"
+load Gem::default_path[-1] + "/gems/${relativegembinary}"
 
 EOF
 






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-15 17:43 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-12-15 17:43 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/15 17:43:51

  Modified:             ruby-fakegem.eclass
  Log:
  Fix and extend documentation.

Revision  Changes    Path
1.4                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.4&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.4&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.3&r2=1.4

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ruby-fakegem.eclass	15 Dec 2009 16:27:46 -0000	1.3
+++ ruby-fakegem.eclass	15 Dec 2009 17:43:51 -0000	1.4
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.3 2009/12/15 16:27:46 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.4 2009/12/15 17:43:51 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -31,12 +31,23 @@
 # @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_DOC
 # @DESCRIPTION:
 # Specify the rake(1) task to run to generate documentation.
-# RUBY_FAKEGEM_VERSION="rdoc"
+# RUBY_FAKEGEM_TASK_DOC="rdoc"
 
 # @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_TEST
 # @DESCRIPTION:
 # Specify the rake(1) task used for executing tests.
-# RUBY_FAKEGEM_VERSION="test"
+# RUBY_FAKEGEM_TASK_TEST="test"
+
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_DOCDIR
+# @DESCRIPTION:
+# Specify the directory under which the documentation is built;
+# if empty no documentation will be installed automatically.
+# RUBY_FAKEGEM_DOCDIR=""
+
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_EXTRADOC
+# @DESCRIPTION:
+# Extra documentation to install (readme, changelogs, …).
+# RUBY_FAKEGEM_EXTRADOC=""
 
 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV}}"






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-15 16:27 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-12-15 16:27 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/15 16:27:46

  Modified:             ruby-fakegem.eclass
  Log:
  Use the fakegem name and version vars for the source uri.

Revision  Changes    Path
1.3                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.3&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.3&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.2&r2=1.3

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ruby-fakegem.eclass	15 Dec 2009 15:32:27 -0000	1.2
+++ ruby-fakegem.eclass	15 Dec 2009 16:27:46 -0000	1.3
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.2 2009/12/15 15:32:27 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.3 2009/12/15 16:27:46 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -18,8 +18,6 @@
 
 inherit ruby-ng
 
-SRC_URI="mirror://rubygems/${P}.gem"
-
 # @ECLASS-VARIABLE: RUBY_FAKEGEM_NAME
 # @DESCRIPTION:
 # Sets the Gem name for the generated fake gemspec.
@@ -56,6 +54,8 @@
 	ruby_add_bdepend test "dev-ruby/rake"
 fi
 
+SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gem"
+
 ruby_add_rdepend virtual/rubygems
 
 # @FUNCTION: ruby_fakegem_gemsdir






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-15 15:32 Diego Petteno (flameeyes)
  0 siblings, 0 replies; 33+ messages in thread
From: Diego Petteno (flameeyes) @ 2009-12-15 15:32 UTC (permalink / raw
  To: gentoo-commits

flameeyes    09/12/15 15:32:27

  Modified:             ruby-fakegem.eclass
  Log:
  Provide a default SRC_URI.

Revision  Changes    Path
1.2                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?r1=1.1&r2=1.2

Index: ruby-fakegem.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ruby-fakegem.eclass	14 Dec 2009 12:32:18 -0000	1.1
+++ ruby-fakegem.eclass	15 Dec 2009 15:32:27 -0000	1.2
@@ -1,6 +1,6 @@
 # Copyright 1999-2009 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.1 2009/12/14 12:32:18 a3li Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.2 2009/12/15 15:32:27 flameeyes Exp $
 #
 # @ECLASS: ruby-fakegem.eclass
 # @MAINTAINER:
@@ -18,6 +18,8 @@
 
 inherit ruby-ng
 
+SRC_URI="mirror://rubygems/${P}.gem"
+
 # @ECLASS-VARIABLE: RUBY_FAKEGEM_NAME
 # @DESCRIPTION:
 # Sets the Gem name for the generated fake gemspec.






^ permalink raw reply	[flat|nested] 33+ messages in thread
* [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass
@ 2009-12-14 12:32 Alex Legler (a3li)
  0 siblings, 0 replies; 33+ messages in thread
From: Alex Legler (a3li) @ 2009-12-14 12:32 UTC (permalink / raw
  To: gentoo-commits

a3li        09/12/14 12:32:18

  Added:                ruby-fakegem.eclass
  Log:
  Add ruby-fakegem.eclass

Revision  Changes    Path
1.1                  eclass/ruby-fakegem.eclass

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/ruby-fakegem.eclass?rev=1.1&content-type=text/plain

Index: ruby-fakegem.eclass
===================================================================
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.1 2009/12/14 12:32:18 a3li Exp $
#
# @ECLASS: ruby-fakegem.eclass
# @MAINTAINER:
# Ruby herd <ruby@gentoo.org>
#
# Author: Diego E. Pettenò <flameeyes@gentoo.org>
#
# Author: Alex Legler <a3li@gentoo.org>
#
# @BLURB: An eclass for installing Ruby packages to behave like RubyGems.
# @DESCRIPTION:
# This eclass allows to install arbitrary Ruby libraries (including Gems),
# providing integration into the RubyGems system even for "regular" packages.
#

inherit ruby-ng

# @ECLASS-VARIABLE: RUBY_FAKEGEM_NAME
# @DESCRIPTION:
# Sets the Gem name for the generated fake gemspec.
# RUBY_FAKEGEM_NAME="${PN}"

# @ECLASS-VARIABLE: RUBY_FAKEGEM_VERSION
# @DESCRIPTION:
# Sets the Gem version for the generated fake gemspec.
# RUBY_FAKEGEM_VERSION="${PV}"

# @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_DOC
# @DESCRIPTION:
# Specify the rake(1) task to run to generate documentation.
# RUBY_FAKEGEM_VERSION="rdoc"

# @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_TEST
# @DESCRIPTION:
# Specify the rake(1) task used for executing tests.
# RUBY_FAKEGEM_VERSION="test"

RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV}}"

RUBY_FAKEGEM_TASK_DOC="${RUBY_FAKEGEM_TASK_DOC-rdoc}"
RUBY_FAKEGEM_TASK_TEST="${RUBY_FAKEGEM_TASK_TEST-test}"

if [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]]; then
	IUSE="$IUSE doc"
	ruby_add_bdepend doc "dev-ruby/rake"
fi

if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
	IUSE="$IUSE test"
	ruby_add_bdepend test "dev-ruby/rake"
fi

ruby_add_rdepend virtual/rubygems

# @FUNCTION: ruby_fakegem_gemsdir
# @RETURN: Returns the gem data directory
# @DESCRIPTION:
# This function returns the gems data directory for the ruby
# implementation in question.
ruby_fakegem_gemsdir() {
	local _gemsitedir=$(${RUBY} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' | sed -e 's:site_ruby:gems:')

	[[ -z ${_gemsitedir} ]] && {
		eerror "Unable to find the gems dir"
		die "Unable to find the gems dir"
	}

	echo "${_gemsitedir}"
}

# @FUNCTION: ruby_fakegem_doins
# @USAGE: file [file...]
# @DESCRIPTION:
# Installs the specified file(s) into the gems directory.
ruby_fakegem_doins() {
	(
		insinto $(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}
		doins "$@"
	) || die "failed $0 $@"
}

# @FUNCTION: ruby_fakegem_newsins()
# @USAGE: file filename
# @DESCRIPTION:
# Installs the specified file into the gems directory using the provided filename.
ruby_fakegem_newins() {
	(
		# Since newins does not accept full paths but just basenames
		# for the target file, we want to extend it here.
		local newdirname=/$(dirname "$2")
		[[ ${newdirname} == "/." ]] && newdirname=

		local newbasename=$(basename "$2")

		insinto $(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${newdirname}
		newins "$1" ${newbasename}
	) || die "failed $0 $@"
}

# @FUNCTION: ruby_fakegem_genspec
# @DESCRIPTION:
# Generates a gemspec for the package and places it into the "specifications"
# directory of RubyGems.
# In the gemspec, the following values are set: name, version, summary,
# homepage, and require_paths=["lib"].
# See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version.
ruby_fakegem_genspec() {
	(
		# We use the _ruby_implementation variable to avoid having stray
		# copies with different implementations; while for now we're using
		# the same exact content, we might have differences in the future,
		# so better taking this into consideration.
		cat - > "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} <<EOF
Gem::Specification.new do |s|
  s.name = "${RUBY_FAKEGEM_NAME}"
  s.version = "${RUBY_FAKEGEM_VERSION}"
  s.summary = "${DESCRIPTION}"
  s.homepage = "${HOMEPAGE}"
  s.require_paths = ["lib"]
end
EOF

		insinto $(ruby_fakegem_gemsdir)/specifications
		newins "${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation} ${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gemspec
	) || die "Unable to install fake gemspec"
}

# @FUNCTION: ruby_fakegem_binwrapper
# @USAGE: command [path]
# @DESCRIPTION:
# Creates a new binary wrapper for a command installed by the RubyGem.
# path defaults to /usr/bin/$command
ruby_fakegem_binwrapper() {
	(
		local gembinary=$1
		local newbinary=${2:-/usr/bin/$gembinary}

		cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
#!/usr/bin/env ruby
# This is a simplified version of the RubyGems wrapper
#
# Generated by ruby-fakegem.eclass

require 'rubygems'

load Gem::GemPathSearcher.new.find('$(tr [A-Z] [a-z] <<< ${RUBY_FAKEGEM_NAME})').full_gem_path + "/bin/${gembinary}"

EOF

		exeinto $(dirname $newbinary)
		newexe "${T}"/gembin-wrapper-${gembinary} $(basename $newbinary)
	) || die "Unable to create fakegem wrapper"
}

# @FUNCTION: all_fakegem_compile
# @DESCRIPTION:
# Build documentation for the package if indicated by the doc USE flag
# and if there is a documetation task defined.
all_fakegem_compile() {
	if [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]] && use doc; then
		rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
	fi
}

# @FUNCTION: all_ruby_unpack
# @DESCRIPTION:
# Unpack the source archive, including support for unpacking gems.
all_ruby_unpack() {
	# Special support for extracting .gem files; the file need to be
	# extracted twice and the mtime from the archive _has_ to be
	# ignored (it's always set to epoch 0).
	#
	# This only works if there is exactly one archive and that archive
	# is a .gem file!
	if [[ $(wc -w <<< ${A}) == 1 ]] &&
		[[ ${A} == *.gem ]]; then
		ebegin "Unpacking .gem file..."
		tar -mxf ${DISTDIR}/${A} || die
		eend $?

		mkdir "${S}"
		pushd "${S}"

		ebegin "Unpacking data.tar.gz"
		tar -mxf "${my_WORKDIR}"/data.tar.gz || die
		eend $?
	else
		[[ -n ${A} ]] && unpack ${A}
	fi
}

# @FUNCTION: all_ruby_compile
# @DESCRIPTION:
# Compile the package.
all_ruby_compile() {
	all_fakegem_compile
}

# @FUNCTION: each_fakegem_test
# @DESCRIPTION:
# Run tests for the package for each ruby target if the test task is defined.
each_fakegem_test() {
	local rubyflags=

	if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
		${RUBY} ${rubyflags} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
	else
		echo "No test task defined, skipping tests."
	fi
}

# @FUNCTION: each_ruby_test
# @DESCRIPTION:
# Run the tests for this package.
each_ruby_test() {
	each_fakegem_test
}

# @FUNCTION: each_fakegem_install
# @DESCRIPTION:
# Install the package for each ruby target.
each_fakegem_install() {
	ruby_fakegem_genspec

	local _gemlibdirs=
	for directory in bin lib ${RUBY_FAKEGEM_EXTRAINSTALL}; do
		[[ -d ${directory} ]] && _gemlibdirs="${_gemlibdirs} ${directory}"
	done

	ruby_fakegem_doins -r ${_gemlibdirs}
}

# @FUNCTION: each_ruby_install
# @DESCRIPTION:
# Install the package for each target.
each_ruby_install() {
	each_fakegem_install
}

# @FUNCTION: all_fakegem_install
# @DESCRIPTION:
# Install files common to all ruby targets.
all_fakegem_install() {
	if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
		pushd ${RUBY_FAKEGEM_DOCDIR}
		dohtml -r * || die "failed to install documentation"
		popd
	fi

	if [[ -n ${RUBY_FAKEGEM_EXTRADOC} ]]; then
		dodoc ${RUBY_FAKEGEM_EXTRADOC} || die "failed to install further documentation"
	fi
}

# @FUNCTION: all_ruby_install
# @DESCRIPTION:
# Install files common to all ruby targets.
all_ruby_install() {
	all_fakegem_install
}






^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2014-04-21  7:35 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-19 11:59 [gentoo-commits] gentoo-x86 commit in eclass: ruby-fakegem.eclass Diego Petteno (flameeyes)
  -- strict thread matches above, loose matches on Subject: below --
2014-04-21  7:35 Hans de Graaff (graaff)
2013-02-24  7:45 Hans de Graaff (graaff)
2012-08-19  7:45 Hans de Graaff (graaff)
2011-12-05 12:24 Hans de Graaff (graaff)
2011-10-21  6:32 Hans de Graaff (graaff)
2011-04-25  8:36 Hans de Graaff (graaff)
2011-03-05  6:58 Hans de Graaff (graaff)
2010-12-28 12:07 Hans de Graaff (graaff)
2010-12-18  9:57 Hans de Graaff (graaff)
2010-12-18  9:50 Hans de Graaff (graaff)
2010-09-23  6:47 Fabian Groffen (grobian)
2010-07-29  9:38 Diego Petteno (flameeyes)
2010-07-27 11:02 Diego Petteno (flameeyes)
2010-07-21 10:43 Diego Petteno (flameeyes)
2010-07-21 10:42 Diego Petteno (flameeyes)
2010-05-24  7:34 Diego Petteno (flameeyes)
2010-02-19 11:58 Diego Petteno (flameeyes)
2010-02-19  8:47 Diego Petteno (flameeyes)
2010-02-13  8:45 Hans de Graaff (graaff)
2010-01-24  0:00 Diego Petteno (flameeyes)
2010-01-21 10:18 Diego Petteno (flameeyes)
2010-01-18 22:01 Diego Petteno (flameeyes)
2010-01-09 21:16 Diego Petteno (flameeyes)
2010-01-01 23:13 Diego Petteno (flameeyes)
2009-12-26 17:06 Diego Petteno (flameeyes)
2009-12-21 19:07 Diego Petteno (flameeyes)
2009-12-20 23:39 Diego Petteno (flameeyes)
2009-12-16  9:51 Diego Petteno (flameeyes)
2009-12-15 17:43 Diego Petteno (flameeyes)
2009-12-15 16:27 Diego Petteno (flameeyes)
2009-12-15 15:32 Diego Petteno (flameeyes)
2009-12-14 12:32 Alex Legler (a3li)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox