| 1 | # Copyright 1999-2009 Gentoo Foundation |
1 | # Copyright 1999-2009 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.29 2011/04/25 08:36:51 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 | # |
| … | |
… | |
| 210 | # copies with different implementations; while for now we're using |
210 | # copies with different implementations; while for now we're using |
| 211 | # the same exact content, we might have differences in the future, |
211 | # the same exact content, we might have differences in the future, |
| 212 | # so better taking this into consideration. |
212 | # so better taking this into consideration. |
| 213 | local quoted_description=${DESCRIPTION//\"/\\\"} |
213 | local quoted_description=${DESCRIPTION//\"/\\\"} |
| 214 | cat - > $1 <<EOF |
214 | cat - > $1 <<EOF |
| 215 | # generated by ruby-fakegem.eclass $Revision: 1.28 $ |
215 | # generated by ruby-fakegem.eclass $Revision: 1.29 $ |
| 216 | Gem::Specification.new do |s| |
216 | Gem::Specification.new do |s| |
| 217 | s.name = "${RUBY_FAKEGEM_NAME}" |
217 | s.name = "${RUBY_FAKEGEM_NAME}" |
| 218 | s.version = "${RUBY_FAKEGEM_VERSION}" |
218 | s.version = "${RUBY_FAKEGEM_VERSION}" |
| 219 | s.summary = "${quoted_description}" |
219 | s.summary = "${quoted_description}" |
| 220 | s.homepage = "${HOMEPAGE}" |
220 | s.homepage = "${HOMEPAGE}" |
| … | |
… | |
| 260 | |
260 | |
| 261 | cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF |
261 | cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF |
| 262 | #!${rubycmd} |
262 | #!${rubycmd} |
| 263 | # This is a simplified version of the RubyGems wrapper |
263 | # This is a simplified version of the RubyGems wrapper |
| 264 | # |
264 | # |
| 265 | # Generated by ruby-fakegem.eclass $Revision: 1.28 $ |
265 | # Generated by ruby-fakegem.eclass $Revision: 1.29 $ |
| 266 | |
266 | |
| 267 | require 'rubygems' |
267 | require 'rubygems' |
| 268 | |
268 | |
| 269 | load Gem::default_path[-1] + "/gems/${relativegembinary}" |
269 | load Gem::default_path[-1] + "/gems/${relativegembinary}" |
| 270 | |
270 | |
| … | |
… | |
| 293 | # extracted twice and the mtime from the archive _has_ to be |
293 | # extracted twice and the mtime from the archive _has_ to be |
| 294 | # ignored (it's always set to epoch 0). |
294 | # ignored (it's always set to epoch 0). |
| 295 | for archive in ${A}; do |
295 | for archive in ${A}; do |
| 296 | case "${archive}" in |
296 | case "${archive}" in |
| 297 | *.gem) |
297 | *.gem) |
| 298 | # Make sure that we're not running unoack for more than |
298 | # Make sure that we're not running unpack for more than |
| 299 | # one .gem file, since we won't support that at all. |
299 | # one .gem file, since we won't support that at all. |
| 300 | [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists" |
300 | [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists" |
| 301 | |
301 | |
| 302 | ebegin "Unpacking .gem file..." |
302 | ebegin "Unpacking .gem file..." |
| 303 | tar -mxf ${DISTDIR}/${archive} || die |
303 | tar -mxf ${DISTDIR}/${archive} || die |