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

Contents of /eclass/ruby-fakegem.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.40 - (hide annotations) (download)
Sat Nov 9 10:22:06 2013 UTC (8 months, 2 weeks ago) by graaff
Branch: MAIN
Changes since 1.39: +12 -3 lines
Add a yard recipe for creating documentation.

1 graaff 1.38 # Copyright 1999-2013 Gentoo Foundation
2 a3li 1.1 # Distributed under the terms of the GNU General Public License v2
3 graaff 1.40 # $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.39 2013/06/01 13:18:45 graaff Exp $
4 vapier 1.30
5 a3li 1.1 # @ECLASS: ruby-fakegem.eclass
6     # @MAINTAINER:
7     # Ruby herd <ruby@gentoo.org>
8 vapier 1.30 # @AUTHOR:
9 a3li 1.1 # Author: Diego E. Pettenò <flameeyes@gentoo.org>
10     # Author: Alex Legler <a3li@gentoo.org>
11     # @BLURB: An eclass for installing Ruby packages to behave like RubyGems.
12     # @DESCRIPTION:
13     # This eclass allows to install arbitrary Ruby libraries (including Gems),
14     # providing integration into the RubyGems system even for "regular" packages.
15    
16     inherit ruby-ng
17    
18     # @ECLASS-VARIABLE: RUBY_FAKEGEM_NAME
19     # @DESCRIPTION:
20     # Sets the Gem name for the generated fake gemspec.
21     # RUBY_FAKEGEM_NAME="${PN}"
22    
23     # @ECLASS-VARIABLE: RUBY_FAKEGEM_VERSION
24     # @DESCRIPTION:
25     # Sets the Gem version for the generated fake gemspec.
26     # RUBY_FAKEGEM_VERSION="${PV}"
27    
28     # @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_DOC
29     # @DESCRIPTION:
30     # Specify the rake(1) task to run to generate documentation.
31 flameeyes 1.4 # RUBY_FAKEGEM_TASK_DOC="rdoc"
32 a3li 1.1
33 flameeyes 1.33 # @ECLASS-VARIABLE: RUBY_FAKEGEM_RECIPE_TEST
34     # @DESCRIPTION:
35     # Specify one of the default testing function for ruby-fakegem:
36     # - rake (default; see also RUBY_FAKEGEM_TASK_TEST)
37     # - rspec (calls ruby-ng_rspec, adds dev-ruby/rspec:2 to the dependencies)
38 flameeyes 1.34 # - cucumber (calls ruby-ng_cucumber, adds dev-util/cucumber to the
39     # dependencies; does not work on JRuby).
40 flameeyes 1.33 # - none
41     # RUBY_FAKEGEM_RECIPE_TEST="rake"
42    
43 a3li 1.1 # @ECLASS-VARIABLE: RUBY_FAKEGEM_TASK_TEST
44     # @DESCRIPTION:
45 flameeyes 1.33 # Specify the rake(1) task used for executing tests. Only valid
46     # if RUBY_FAKEGEM_RECIPE_TEST is set to "rake" (the default).
47 flameeyes 1.4 # RUBY_FAKEGEM_TASK_TEST="test"
48    
49 flameeyes 1.35 # @ECLASS-VARIABLE: RUBY_FAKEGEM_RECIPE_DOC
50     # @DESCRIPTION:
51     # Specify one of the default API doc building function for ruby-fakegem:
52     # - rake (default; see also RUBY_FAKEGEM_TASK_DOC)
53     # - rdoc (calls `rdoc-2`, adds dev-ruby/rdoc to the dependencies);
54 graaff 1.40 # - yard (calls `yard`, adds dev-ruby/yard to the dependencies);
55 flameeyes 1.35 # - none
56     # RUBY_FAKEGEM_RECIPE_DOC="rake"
57    
58 flameeyes 1.4 # @ECLASS-VARIABLE: RUBY_FAKEGEM_DOCDIR
59     # @DESCRIPTION:
60     # Specify the directory under which the documentation is built;
61     # if empty no documentation will be installed automatically.
62 flameeyes 1.35 # Note: if RUBY_FAKEGEM_RECIPE_DOC is set to `rdoc`, this variable is
63     # hardwired to `doc`.
64 flameeyes 1.4 # RUBY_FAKEGEM_DOCDIR=""
65    
66     # @ECLASS-VARIABLE: RUBY_FAKEGEM_EXTRADOC
67     # @DESCRIPTION:
68     # Extra documentation to install (readme, changelogs, …).
69     # RUBY_FAKEGEM_EXTRADOC=""
70 a3li 1.1
71 flameeyes 1.35 # @ECLASS-VARIABLE: RUBY_FAKEGEM_DOC_SOURCES
72     # @DESCRIPTION:
73     # Allow settings defined sources to scan for documentation.
74     # This only applies if RUBY_FAKEGEM_DOC_TASK is set to `rdoc`.
75     # RUBY_FAKEGEM_DOC_SOURCES="lib"
76    
77 flameeyes 1.6 # @ECLASS-VARIABLE: RUBY_FAKEGEM_BINWRAP
78     # @DESCRIPTION:
79     # Binaries to wrap around (relative to the bin/ directory)
80     # RUBY_FAKEGEM_BINWRAP="*"
81    
82 flameeyes 1.8 # @ECLASS-VARIABLE: RUBY_FAKEGEM_REQUIRE_PATHS
83     # @DESCRIPTION:
84     # Extra require paths (beside lib) to add to the specification
85 flameeyes 1.10 # RUBY_FAKEGEM_REQUIRE_PATHS=""
86 flameeyes 1.8
87 graaff 1.27 # @ECLASS-VARIABLE: RUBY_FAKEGEM_GEMSPEC
88     # @DESCRIPTION:
89     # Filename of .gemspec file to install instead of generating a generic one.
90     # RUBY_FAKEGEM_GEMSPEC=""
91    
92 graaff 1.32 # @ECLASS-VARIABLE: RUBY_FAKEGEM_EXTRAINSTALL
93     # @DESCRIPTION:
94     # List of files and directories relative to the top directory that also
95     # get installed. Some gems provide extra files such as version information,
96     # Rails generators, or data that needs to be installed as well.
97     # RUBY_FAKEGEM_EXTRAINSTALL=""
98    
99 a3li 1.1 RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
100 flameeyes 1.15 RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV/_pre/.pre}}"
101     RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
102 a3li 1.1
103 flameeyes 1.35 RUBY_FAKEGEM_RECIPE_DOC="${RUBY_FAKEGEM_RECIPE_DOC-rake}"
104 a3li 1.1 RUBY_FAKEGEM_TASK_DOC="${RUBY_FAKEGEM_TASK_DOC-rdoc}"
105 flameeyes 1.35 RUBY_FAKEGEM_DOC_SOURCES="${RUBY_FAKEGEM_DOC_SOURCES-lib}"
106    
107 flameeyes 1.33 RUBY_FAKEGEM_RECIPE_TEST="${RUBY_FAKEGEM_RECIPE_TEST-rake}"
108 a3li 1.1 RUBY_FAKEGEM_TASK_TEST="${RUBY_FAKEGEM_TASK_TEST-test}"
109    
110 flameeyes 1.6 RUBY_FAKEGEM_BINWRAP="${RUBY_FAKEGEM_BINWRAP-*}"
111    
112 flameeyes 1.35 [[ ${RUBY_FAKEGEM_TASK_DOC} == "" ]] && RUBY_FAKEGEM_RECIPE_DOC="none"
113 a3li 1.1
114 flameeyes 1.35 case ${RUBY_FAKEGEM_RECIPE_DOC} in
115     rake)
116     IUSE+=" doc"
117     ruby_add_bdepend "doc? ( dev-ruby/rake )"
118 graaff 1.38 RUBY_FAKEGEM_DOCDIR="doc"
119 flameeyes 1.35 ;;
120     rdoc)
121     IUSE+=" doc"
122     ruby_add_bdepend "doc? ( dev-ruby/rdoc )"
123     RUBY_FAKEGEM_DOCDIR="doc"
124     ;;
125 graaff 1.40 yard)
126     IUSE+="doc"
127     ruby_add_bdepend "doc? ( dev-ruby/yard )"
128     RUBY_FAKEGEM_DOCDIR="doc"
129     ;;
130 flameeyes 1.35 none)
131     [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && IUSE+=" doc"
132     ;;
133     esac
134 flameeyes 1.21
135 flameeyes 1.33 [[ ${RUBY_FAKEGEM_TASK_TEST} == "" ]] && RUBY_FAKEGEM_RECIPE_TEST="none"
136    
137     case ${RUBY_FAKEGEM_RECIPE_TEST} in
138     rake)
139     IUSE+=" test"
140     ruby_add_bdepend "test? ( dev-ruby/rake )"
141     ;;
142     rspec)
143     IUSE+=" test"
144     ruby_add_bdepend "test? ( dev-ruby/rspec:2 )"
145     ;;
146 flameeyes 1.34 cucumber)
147     IUSE+=" test"
148     # Unfortunately as of August 2012, cucumber is not supported on
149     # JRuby. We work it around here to avoid repeating the same
150     # code over and over again.
151     USE_RUBY="${USE_RUBY/jruby/}" ruby_add_bdepend "test? ( dev-util/cucumber )"
152     ;;
153 flameeyes 1.33 *)
154     RUBY_FAKEGEM_RECIPE_TEST="none"
155     ;;
156     esac
157 a3li 1.1
158 flameeyes 1.15 SRC_URI="mirror://rubygems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${RUBY_FAKEGEM_SUFFIX:+-${RUBY_FAKEGEM_SUFFIX}}.gem"
159 flameeyes 1.3
160 graaff 1.31 ruby_add_bdepend virtual/rubygems
161     ruby_add_rdepend virtual/rubygems
162 a3li 1.1
163     # @FUNCTION: ruby_fakegem_gemsdir
164     # @RETURN: Returns the gem data directory
165     # @DESCRIPTION:
166     # This function returns the gems data directory for the ruby
167     # implementation in question.
168     ruby_fakegem_gemsdir() {
169 grobian 1.24 has "${EAPI}" 2 && ! use prefix && EPREFIX=
170    
171     local _gemsitedir=$(ruby_rbconfig_value 'sitelibdir')
172     _gemsitedir=${_gemsitedir//site_ruby/gems}
173     _gemsitedir=${_gemsitedir#${EPREFIX}}
174 a3li 1.1
175     [[ -z ${_gemsitedir} ]] && {
176     eerror "Unable to find the gems dir"
177     die "Unable to find the gems dir"
178     }
179    
180     echo "${_gemsitedir}"
181     }
182    
183     # @FUNCTION: ruby_fakegem_doins
184     # @USAGE: file [file...]
185     # @DESCRIPTION:
186     # Installs the specified file(s) into the gems directory.
187     ruby_fakegem_doins() {
188     (
189     insinto $(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}
190     doins "$@"
191     ) || die "failed $0 $@"
192     }
193    
194     # @FUNCTION: ruby_fakegem_newsins()
195     # @USAGE: file filename
196     # @DESCRIPTION:
197     # Installs the specified file into the gems directory using the provided filename.
198     ruby_fakegem_newins() {
199     (
200     # Since newins does not accept full paths but just basenames
201     # for the target file, we want to extend it here.
202     local newdirname=/$(dirname "$2")
203     [[ ${newdirname} == "/." ]] && newdirname=
204    
205     local newbasename=$(basename "$2")
206    
207     insinto $(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}${newdirname}
208     newins "$1" ${newbasename}
209     ) || die "failed $0 $@"
210     }
211    
212 graaff 1.27 # @FUNCTION: ruby_fakegem_install_gemspec
213     # @DESCRIPTION:
214     # Install a .gemspec file for this package. Either use the file indicated
215     # by the RUBY_FAKEGEM_GEMSPEC variable, or generate one using
216     # ruby_fakegem_genspec.
217     ruby_fakegem_install_gemspec() {
218     local gemspec="${T}"/${RUBY_FAKEGEM_NAME}-${_ruby_implementation}
219    
220     (
221     if [[ ${RUBY_FAKEGEM_GEMSPEC} != "" ]]; then
222     ruby_fakegem_gemspec_gemspec ${RUBY_FAKEGEM_GEMSPEC} ${gemspec}
223     else
224     local metadata="${WORKDIR}"/${_ruby_implementation}/metadata
225    
226     if [[ -e ${metadata} ]]; then
227     ruby_fakegem_metadata_gemspec ${metadata} ${gemspec}
228     else
229     ruby_fakegem_genspec ${gemspec}
230     fi
231     fi
232 graaff 1.28 ) || die "Unable to generate gemspec file."
233 graaff 1.27
234     insinto $(ruby_fakegem_gemsdir)/specifications
235     newins ${gemspec} ${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}.gemspec || die "Unable to install gemspec file."
236     }
237    
238     # @FUNCTION: ruby_fakegem_gemspec_gemspec
239     # @USAGE: gemspec-input gemspec-output
240     # @DESCRIPTION:
241     # Generates an installable version of the specification indicated by
242     # RUBY_FAKEGEM_GEMSPEC. This file is eval'ed to produce a final specification
243     # in a way similar to packaging the gemspec file.
244     ruby_fakegem_gemspec_gemspec() {
245     ${RUBY} -e "puts eval(File::open('$1').read).to_ruby" > $2
246     }
247    
248     # @FUNCTION: ruby_fakegem_metadata_gemspec
249     # @USAGE: gemspec-metadata gemspec-output
250     # @DESCRIPTION:
251     # Generates an installable version of the specification indicated by
252     # the metadata distributed by the gem itself. This is similar to how
253     # rubygems creates an installation from a .gem file.
254     ruby_fakegem_metadata_gemspec() {
255 graaff 1.37 case ${RUBY} in
256     *ruby19)
257     ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1', :encoding => 'UTF-8').read).to_ruby" > $2
258     ;;
259     *)
260     ${RUBY} -r yaml -e "puts Gem::Specification.from_yaml(File::open('$1').read).to_ruby" > $2
261     ;;
262     esac
263 graaff 1.27 }
264    
265 a3li 1.1 # @FUNCTION: ruby_fakegem_genspec
266 graaff 1.27 # @USAGE: output-gemspec
267 a3li 1.1 # @DESCRIPTION:
268     # Generates a gemspec for the package and places it into the "specifications"
269     # directory of RubyGems.
270 graaff 1.27 # If the metadata normally distributed with a gem is present then that is
271     # used to generate the gemspec file.
272     #
273     # As a fallback we can generate our own version.
274 a3li 1.1 # In the gemspec, the following values are set: name, version, summary,
275     # homepage, and require_paths=["lib"].
276     # See RUBY_FAKEGEM_NAME and RUBY_FAKEGEM_VERSION for setting name and version.
277 flameeyes 1.8 # See RUBY_FAKEGEM_REQUIRE_PATHS for setting extra require paths.
278 a3li 1.1 ruby_fakegem_genspec() {
279 graaff 1.27 local required_paths="'lib'"
280     for path in ${RUBY_FAKEGEM_REQUIRE_PATHS}; do
281     required_paths="${required_paths}, '${path}'"
282     done
283 flameeyes 1.8
284 graaff 1.27 # We use the _ruby_implementation variable to avoid having stray
285     # copies with different implementations; while for now we're using
286     # the same exact content, we might have differences in the future,
287     # so better taking this into consideration.
288     local quoted_description=${DESCRIPTION//\"/\\\"}
289     cat - > $1 <<EOF
290 graaff 1.40 # generated by ruby-fakegem.eclass $Revision: 1.39 $
291 a3li 1.1 Gem::Specification.new do |s|
292     s.name = "${RUBY_FAKEGEM_NAME}"
293     s.version = "${RUBY_FAKEGEM_VERSION}"
294 graaff 1.14 s.summary = "${quoted_description}"
295 a3li 1.1 s.homepage = "${HOMEPAGE}"
296 flameeyes 1.8 s.require_paths = [${required_paths}]
297 a3li 1.1 end
298     EOF
299     }
300    
301     # @FUNCTION: ruby_fakegem_binwrapper
302     # @USAGE: command [path]
303     # @DESCRIPTION:
304     # Creates a new binary wrapper for a command installed by the RubyGem.
305     # path defaults to /usr/bin/$command
306     ruby_fakegem_binwrapper() {
307     (
308     local gembinary=$1
309     local newbinary=${2:-/usr/bin/$gembinary}
310 flameeyes 1.5 local relativegembinary=${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin/${gembinary}
311 flameeyes 1.12 local binpath=$(dirname $newbinary)
312     [[ ${binpath} = . ]] && binpath=/usr/bin
313 a3li 1.1
314 flameeyes 1.16 # Try to find out whether the package is going to install for
315     # one or multiple implementations; if we're installing for a
316     # *single* implementation, no need to use “/usr/bin/env ruby”
317     # in the shebang, and we can actually avoid errors when
318     # calling the script by default (see for instance the
319     # JRuby-specific commands).
320     local rubycmd=
321     for implementation in ${USE_RUBY}; do
322     # ignore non-enabled implementations
323     use ruby_targets_${implementation} || continue
324     if [ -z $rubycmd ]; then
325     # if no other implementation was set before, set it.
326 flameeyes 1.23 rubycmd="$(ruby_implementation_command ${implementation})"
327 flameeyes 1.16 else
328     # if another implementation already arrived, then make
329     # it generic and break out of the loop. This ensures
330     # that we do at most two iterations.
331     rubycmd="/usr/bin/env ruby"
332     break
333     fi
334     done
335    
336 a3li 1.1 cat - > "${T}"/gembin-wrapper-${gembinary} <<EOF
337 flameeyes 1.16 #!${rubycmd}
338 a3li 1.1 # This is a simplified version of the RubyGems wrapper
339     #
340 graaff 1.40 # Generated by ruby-fakegem.eclass $Revision: 1.39 $
341 a3li 1.1
342     require 'rubygems'
343    
344 flameeyes 1.5 load Gem::default_path[-1] + "/gems/${relativegembinary}"
345 a3li 1.1
346     EOF
347    
348 flameeyes 1.12 exeinto ${binpath:-/usr/bin}
349 a3li 1.1 newexe "${T}"/gembin-wrapper-${gembinary} $(basename $newbinary)
350     ) || die "Unable to create fakegem wrapper"
351     }
352    
353     # @FUNCTION: all_fakegem_compile
354     # @DESCRIPTION:
355     # Build documentation for the package if indicated by the doc USE flag
356     # and if there is a documetation task defined.
357     all_fakegem_compile() {
358 flameeyes 1.36 if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
359 flameeyes 1.35 case ${RUBY_FAKEGEM_RECIPE_DOC} in
360     rake)
361     rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
362     ;;
363     rdoc)
364     rdoc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
365     ;;
366 graaff 1.40 yard)
367     yard doc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
368     ;;
369 flameeyes 1.35 esac
370 a3li 1.1 fi
371     }
372    
373     # @FUNCTION: all_ruby_unpack
374     # @DESCRIPTION:
375     # Unpack the source archive, including support for unpacking gems.
376     all_ruby_unpack() {
377     # Special support for extracting .gem files; the file need to be
378     # extracted twice and the mtime from the archive _has_ to be
379     # ignored (it's always set to epoch 0).
380 flameeyes 1.19 for archive in ${A}; do
381 flameeyes 1.22 case "${archive}" in
382     *.gem)
383 graaff 1.29 # Make sure that we're not running unpack for more than
384 flameeyes 1.22 # one .gem file, since we won't support that at all.
385     [[ -d "${S}" ]] && die "Unable to unpack ${archive}, ${S} exists"
386    
387     ebegin "Unpacking .gem file..."
388 graaff 1.39 tar -mxf "${DISTDIR}"/${archive} || die
389 flameeyes 1.22 eend $?
390    
391 graaff 1.27 ebegin "Uncompressing metadata"
392     gunzip metadata.gz || die
393     eend $?
394    
395 flameeyes 1.22 mkdir "${S}"
396     pushd "${S}" &>/dev/null
397    
398     ebegin "Unpacking data.tar.gz"
399     tar -mxf "${my_WORKDIR}"/data.tar.gz || die
400     eend $?
401 graaff 1.27
402 flameeyes 1.22 popd &>/dev/null
403     ;;
404     *.patch.bz2)
405     # We apply the patches with RUBY_PATCHES directly from DISTDIR,
406     # as the WORKDIR variable changes value between the global-scope
407     # and the time all_ruby_unpack/_prepare are called. Since we can
408     # simply decompress them when applying, this is much easier to
409     # deal with for us.
410     einfo "Keeping ${archive} as-is"
411     ;;
412     *)
413     unpack ${archive}
414     ;;
415     esac
416 flameeyes 1.19 done
417 a3li 1.1 }
418    
419     # @FUNCTION: all_ruby_compile
420     # @DESCRIPTION:
421     # Compile the package.
422     all_ruby_compile() {
423     all_fakegem_compile
424     }
425    
426     # @FUNCTION: each_fakegem_test
427     # @DESCRIPTION:
428     # Run tests for the package for each ruby target if the test task is defined.
429     each_fakegem_test() {
430 flameeyes 1.33 case ${RUBY_FAKEGEM_RECIPE_TEST} in
431     rake)
432     ${RUBY} -S rake ${RUBY_FAKEGEM_TASK_TEST} || die "tests failed"
433     ;;
434     rspec)
435     ruby-ng_rspec
436     ;;
437 flameeyes 1.34 cucumber)
438     ruby-ng_cucumber
439     ;;
440 flameeyes 1.33 none)
441     ewarn "each_fakegem_test called, but \${RUBY_FAKEGEM_RECIPE_TEST} is 'none'"
442     ;;
443     esac
444     }
445    
446     if [[ ${RUBY_FAKEGEM_RECIPE_TEST} != none ]]; then
447     # @FUNCTION: each_ruby_test
448     # @DESCRIPTION:
449     # Run the tests for this package.
450     each_ruby_test() {
451     each_fakegem_test
452     }
453 flameeyes 1.13 fi
454 a3li 1.1
455     # @FUNCTION: each_fakegem_install
456     # @DESCRIPTION:
457     # Install the package for each ruby target.
458     each_fakegem_install() {
459 graaff 1.27 ruby_fakegem_install_gemspec
460 a3li 1.1
461 flameeyes 1.11 local _gemlibdirs="${RUBY_FAKEGEM_EXTRAINSTALL}"
462     for directory in bin lib; do
463 a3li 1.1 [[ -d ${directory} ]] && _gemlibdirs="${_gemlibdirs} ${directory}"
464     done
465    
466 flameeyes 1.9 [[ -n ${_gemlibdirs} ]] && \
467     ruby_fakegem_doins -r ${_gemlibdirs}
468 a3li 1.1 }
469    
470     # @FUNCTION: each_ruby_install
471     # @DESCRIPTION:
472     # Install the package for each target.
473     each_ruby_install() {
474     each_fakegem_install
475     }
476    
477     # @FUNCTION: all_fakegem_install
478     # @DESCRIPTION:
479     # Install files common to all ruby targets.
480     all_fakegem_install() {
481 flameeyes 1.20 if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && use doc; then
482 flameeyes 1.7 for dir in ${RUBY_FAKEGEM_DOCDIR}; do
483 flameeyes 1.20 [[ -d ${dir} ]] || continue
484    
485 flameeyes 1.11 pushd ${dir} &>/dev/null
486 flameeyes 1.7 dohtml -r * || die "failed to install documentation"
487 flameeyes 1.11 popd &>/dev/null
488 flameeyes 1.7 done
489 a3li 1.1 fi
490    
491     if [[ -n ${RUBY_FAKEGEM_EXTRADOC} ]]; then
492     dodoc ${RUBY_FAKEGEM_EXTRADOC} || die "failed to install further documentation"
493     fi
494 flameeyes 1.6
495     # binary wrappers; we assume that all the implementations get the
496     # same binaries, or something is wrong anyway, so...
497     if [[ -n ${RUBY_FAKEGEM_BINWRAP} ]]; then
498     local bindir=$(find "${D}" -type d -path "*/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/bin" -print -quit)
499    
500     if [[ -d "${bindir}" ]]; then
501 flameeyes 1.11 pushd "${bindir}" &>/dev/null
502 flameeyes 1.6 local binaries=$(eval ls ${RUBY_FAKEGEM_BINWRAP})
503     for binary in $binaries; do
504     ruby_fakegem_binwrapper $binary
505     done
506 flameeyes 1.11 popd &>/dev/null
507 flameeyes 1.6 fi
508     fi
509 a3li 1.1 }
510    
511     # @FUNCTION: all_ruby_install
512     # @DESCRIPTION:
513     # Install files common to all ruby targets.
514     all_ruby_install() {
515     all_fakegem_install
516     }

  ViewVC Help
Powered by ViewVC 1.1.20