/[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.12
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.12 2010/01/21 10:18:59 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

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

  ViewVC Help
Powered by ViewVC 1.1.20