/[gentoo-x86]/eclass/ruby-fakegem.eclass
Gentoo

Diff of /eclass/ruby-fakegem.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.28 Revision 1.31
1# Copyright 1999-2009 Gentoo Foundation 1# Copyright 1999-2011 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.28 2011/03/05 06:58:00 graaff Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.31 2011/10/21 06:32:29 graaff Exp $
4# 4
5# @ECLASS: ruby-fakegem.eclass 5# @ECLASS: ruby-fakegem.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Ruby herd <ruby@gentoo.org> 7# Ruby herd <ruby@gentoo.org>
8# 8# @AUTHOR:
9# Author: Diego E. Pettenò <flameeyes@gentoo.org> 9# Author: Diego E. Pettenò <flameeyes@gentoo.org>
10#
11# Author: Alex Legler <a3li@gentoo.org> 10# Author: Alex Legler <a3li@gentoo.org>
12#
13# @BLURB: An eclass for installing Ruby packages to behave like RubyGems. 11# @BLURB: An eclass for installing Ruby packages to behave like RubyGems.
14# @DESCRIPTION: 12# @DESCRIPTION:
15# This eclass allows to install arbitrary Ruby libraries (including Gems), 13# This eclass allows to install arbitrary Ruby libraries (including Gems),
16# providing integration into the RubyGems system even for "regular" packages. 14# providing integration into the RubyGems system even for "regular" packages.
17#
18 15
19inherit ruby-ng 16inherit ruby-ng
20 17
21# @ECLASS-VARIABLE: RUBY_FAKEGEM_NAME 18# @ECLASS-VARIABLE: RUBY_FAKEGEM_NAME
22# @DESCRIPTION: 19# @DESCRIPTION:
87 ruby_add_bdepend "test? ( dev-ruby/rake )" 84 ruby_add_bdepend "test? ( dev-ruby/rake )"
88fi 85fi
89 86
90SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem" 87SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
91 88
92ruby_add_bdepend dev-ruby/rubygems 89ruby_add_bdepend virtual/rubygems
93ruby_add_rdepend dev-ruby/rubygems 90ruby_add_rdepend virtual/rubygems
94 91
95# @FUNCTION: ruby_fakegem_gemsdir 92# @FUNCTION: ruby_fakegem_gemsdir
96# @RETURN: Returns the gem data directory 93# @RETURN: Returns the gem data directory
97# @DESCRIPTION: 94# @DESCRIPTION:
98# This function returns the gems data directory for the ruby 95# This function returns the gems data directory for the ruby
210 # copies with different implementations; while for now we're using 207 # copies with different implementations; while for now we're using
211 # the same exact content, we might have differences in the future, 208 # the same exact content, we might have differences in the future,
212 # so better taking this into consideration. 209 # so better taking this into consideration.
213 local quoted_description=${DESCRIPTION//\"/\\\"} 210 local quoted_description=${DESCRIPTION//\"/\\\"}
214 cat - > $1 <<EOF 211 cat - > $1 <<EOF
215# generated by ruby-fakegem.eclass $Revision: 1.28 $ 212# generated by ruby-fakegem.eclass $Revision: 1.31 $
216Gem::Specification.new do |s| 213Gem::Specification.new do |s|
217 s.name = "${RUBY_FAKEGEM_NAME}" 214 s.name = "${RUBY_FAKEGEM_NAME}"
218 s.version = "${RUBY_FAKEGEM_VERSION}" 215 s.version = "${RUBY_FAKEGEM_VERSION}"
219 s.summary = "${quoted_description}" 216 s.summary = "${quoted_description}"
220 s.homepage = "${HOMEPAGE}" 217 s.homepage = "${HOMEPAGE}"
260 257
261 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF 258 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
262#!${rubycmd} 259#!${rubycmd}
263# This is a simplified version of the RubyGems wrapper 260# This is a simplified version of the RubyGems wrapper
264# 261#
265# Generated by ruby-fakegem.eclass $Revision: 1.28 $ 262# Generated by ruby-fakegem.eclass $Revision: 1.31 $
266 263
267require 'rubygems' 264require 'rubygems'
268 265
269load Gem::default_path[-1] + "/gems/${relativegembinary}" 266load Gem::default_path[-1] + "/gems/${relativegembinary}"
270 267
293 # extracted twice and the mtime from the archive _has_ to be 290 # extracted twice and the mtime from the archive _has_ to be
294 # ignored (it's always set to epoch 0). 291 # ignored (it's always set to epoch 0).
295 for archive in ${A}; do 292 for archive in ${A}; do
296 case "${archive}" in 293 case "${archive}" in
297 *.gem) 294 *.gem)
298 # Make sure that we're not running unoack for more than 295 # Make sure that we're not running unpack for more than
299 # one .gem file, since we won't support that at all. 296 # one .gem file, since we won't support that at all.
300 [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists" 297 [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
301 298
302 ebegin "Unpacking .gem file..." 299 ebegin "Unpacking .gem file..."
303 tar -mxf ${DISTDIR}/${archive} || die 300 tar -mxf ${DISTDIR}/${archive} || die

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20