/[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.11 Revision 1.13
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.11 2010/01/18 22:01:46 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.13 2010/01/24 00:00:40 flameeyes 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#
168ruby_fakegem_binwrapper() { 168ruby_fakegem_binwrapper() {
169 ( 169 (
170 local gembinary=$1 170 local gembinary=$1
171 local newbinary=${2:-/usr/bin/$gembinary} 171 local newbinary=${2:-/usr/bin/$gembinary}
172 local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary} 172 local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
173 local binpath=$(dirname $newbinary)
174 [[ ${binpath} = . ]] && binpath=/usr/bin
173 175
174 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF 176 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
175#!/usr/bin/env ruby 177#!/usr/bin/env ruby
176# This is a simplified version of the RubyGems wrapper 178# This is a simplified version of the RubyGems wrapper
177# 179#
181 183
182load Gem::default_path[-1] + "/gems/${relativegembinary}" 184load Gem::default_path[-1] + "/gems/${relativegembinary}"
183 185
184EOF 186EOF
185 187
186 exeinto $(dirname $newbinary) 188 exeinto ${binpath:-/usr/bin}
187 newexe "${T}"/gembin-wrapper-${gembinary} $(basename $newbinary) 189 newexe "${T}"/gembin-wrapper-${gembinary} $(basename $newbinary)
188 ) || die "Unable to create fakegem wrapper" 190 ) || die "Unable to create fakegem wrapper"
189} 191}
190 192
191# @FUNCTION: all_fakegem_compile 193# @FUNCTION: all_fakegem_compile
236# @FUNCTION: each_fakegem_test 238# @FUNCTION: each_fakegem_test
237# @DESCRIPTION: 239# @DESCRIPTION:
238# Run tests for the package for each ruby target if the test task is defined. 240# Run tests for the package for each ruby target if the test task is defined.
239each_fakegem_test() { 241each_fakegem_test() {
240 local rubyflags= 242 local rubyflags=
241
242 if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
243 ${RUBY} ${rubyflags} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed" 243 ${RUBY} ${rubyflags} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
244 else
245 echo "No test task defined, skipping tests."
246 fi
247} 244}
248 245
246if [[ ${RUBY_FAKEGEM_TASK_TEST} != "" ]]; then
249# @FUNCTION: each_ruby_test 247 # @FUNCTION: each_ruby_test
250# @DESCRIPTION: 248 # @DESCRIPTION:
251# Run the tests for this package. 249 # Run the tests for this package.
252each_ruby_test() { 250 each_ruby_test() {
253 each_fakegem_test 251 each_fakegem_test
254} 252 }
253fi
255 254
256# @FUNCTION: each_fakegem_install 255# @FUNCTION: each_fakegem_install
257# @DESCRIPTION: 256# @DESCRIPTION:
258# Install the package for each ruby target. 257# Install the package for each ruby target.
259each_fakegem_install() { 258each_fakegem_install() {

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.20