/[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.37 Revision 1.40
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2013 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.37 2012/08/19 07:45:02 graaff Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.40 2013/11/09 10:22:06 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# @AUTHOR: 8# @AUTHOR:
49# @ECLASS-VARIABLE: RUBY_FAKEGEM_RECIPE_DOC 49# @ECLASS-VARIABLE: RUBY_FAKEGEM_RECIPE_DOC
50# @DESCRIPTION: 50# @DESCRIPTION:
51# Specify one of the default API doc building function for ruby-fakegem: 51# Specify one of the default API doc building function for ruby-fakegem:
52# - rake (default; see also RUBY_FAKEGEM_TASK_DOC) 52# - rake (default; see also RUBY_FAKEGEM_TASK_DOC)
53# - rdoc (calls `rdoc-2`, adds dev-ruby/rdoc to the dependencies); 53# - rdoc (calls `rdoc-2`, adds dev-ruby/rdoc to the dependencies);
54# - yard (calls `yard`, adds dev-ruby/yard to the dependencies);
54# - none 55# - none
55# RUBY_FAKEGEM_RECIPE_DOC="rake" 56# RUBY_FAKEGEM_RECIPE_DOC="rake"
56 57
57# @ECLASS-VARIABLE: RUBY_FAKEGEM_DOCDIR 58# @ECLASS-VARIABLE: RUBY_FAKEGEM_DOCDIR
58# @DESCRIPTION: 59# @DESCRIPTION:
112 113
113case ${RUBY_FAKEGEM_RECIPE_DOC} in 114case ${RUBY_FAKEGEM_RECIPE_DOC} in
114 rake) 115 rake)
115 IUSE+=" doc" 116 IUSE+=" doc"
116 ruby_add_bdepend "doc? ( dev-ruby/rake )" 117 ruby_add_bdepend "doc? ( dev-ruby/rake )"
118 RUBY_FAKEGEM_DOCDIR="doc"
117 ;; 119 ;;
118 rdoc) 120 rdoc)
119 IUSE+=" doc" 121 IUSE+=" doc"
120 ruby_add_bdepend "doc? ( dev-ruby/rdoc )" 122 ruby_add_bdepend "doc? ( dev-ruby/rdoc )"
123 RUBY_FAKEGEM_DOCDIR="doc"
124 ;;
125 yard)
126 IUSE+="doc"
127 ruby_add_bdepend "doc? ( dev-ruby/yard )"
121 RUBY_FAKEGEM_DOCDIR="doc" 128 RUBY_FAKEGEM_DOCDIR="doc"
122 ;; 129 ;;
123 none) 130 none)
124 [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && IUSE+=" doc" 131 [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && IUSE+=" doc"
125 ;; 132 ;;
278 # copies with different implementations; while for now we're using 285 # copies with different implementations; while for now we're using
279 # the same exact content, we might have differences in the future, 286 # the same exact content, we might have differences in the future,
280 # so better taking this into consideration. 287 # so better taking this into consideration.
281 local quoted_description=${DESCRIPTION//\"/\\\"} 288 local quoted_description=${DESCRIPTION//\"/\\\"}
282 cat - > $1 <<EOF 289 cat - > $1 <<EOF
283# generated by ruby-fakegem.eclass $Revision: 1.37 $ 290# generated by ruby-fakegem.eclass $Revision: 1.40 $
284Gem::Specification.new do |s| 291Gem::Specification.new do |s|
285 s.name = "${RUBY_FAKEGEM_NAME}" 292 s.name = "${RUBY_FAKEGEM_NAME}"
286 s.version = "${RUBY_FAKEGEM_VERSION}" 293 s.version = "${RUBY_FAKEGEM_VERSION}"
287 s.summary = "${quoted_description}" 294 s.summary = "${quoted_description}"
288 s.homepage = "${HOMEPAGE}" 295 s.homepage = "${HOMEPAGE}"
328 335
329 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF 336 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
330#!${rubycmd} 337#!${rubycmd}
331# This is a simplified version of the RubyGems wrapper 338# This is a simplified version of the RubyGems wrapper
332# 339#
333# Generated by ruby-fakegem.eclass $Revision: 1.37 $ 340# Generated by ruby-fakegem.eclass $Revision: 1.40 $
334 341
335require 'rubygems' 342require 'rubygems'
336 343
337load Gem::default_path[-1] + "/gems/${relativegembinary}" 344load Gem::default_path[-1] + "/gems/${relativegembinary}"
338 345
353 rake) 360 rake)
354 rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation" 361 rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
355 ;; 362 ;;
356 rdoc) 363 rdoc)
357 rdoc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation" 364 rdoc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
365 ;;
366 yard)
367 yard doc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
358 ;; 368 ;;
359 esac 369 esac
360 fi 370 fi
361} 371}
362 372
373 # Make sure that we're not running unpack for more than 383 # Make sure that we're not running unpack for more than
374 # one .gem file, since we won't support that at all. 384 # one .gem file, since we won't support that at all.
375 [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists" 385 [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
376 386
377 ebegin "Unpacking .gem file..." 387 ebegin "Unpacking .gem file..."
378 tar -mxf ${DISTDIR}/${archive} || die 388 tar -mxf "${DISTDIR}"/${archive} || die
379 eend $? 389 eend $?
380 390
381 ebegin "Uncompressing metadata" 391 ebegin "Uncompressing metadata"
382 gunzip metadata.gz || die 392 gunzip metadata.gz || die
383 eend $? 393 eend $?

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.20