summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2012-08-14 21:10:45 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2012-08-14 21:10:45 +0000
commitfdde9a71c5c2470cec64d89160e2e3a911c8d85a (patch)
treef6d399a8056f8bf402101ccd0878a84eeeedccca /eclass/ruby-fakegem.eclass
parentStable ppc, bug #431378 (diff)
downloadhistorical-fdde9a71c5c2470cec64d89160e2e3a911c8d85a.tar.gz
historical-fdde9a71c5c2470cec64d89160e2e3a911c8d85a.tar.bz2
historical-fdde9a71c5c2470cec64d89160e2e3a911c8d85a.zip
Add support for documentation recipes as well, and implement an rdoc recipe.
Diffstat (limited to 'eclass/ruby-fakegem.eclass')
-rw-r--r--eclass/ruby-fakegem.eclass58
1 files changed, 46 insertions, 12 deletions
diff --git a/eclass/ruby-fakegem.eclass b/eclass/ruby-fakegem.eclass
index ff0cea2e8ec9..74280b9d63dc 100644
--- a/eclass/ruby-fakegem.eclass
+++ b/eclass/ruby-fakegem.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.34 2012/08/13 22:21:26 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby-fakegem.eclass,v 1.35 2012/08/14 21:10:45 flameeyes Exp $
# @ECLASS: ruby-fakegem.eclass
# @MAINTAINER:
@@ -46,10 +46,20 @@ inherit ruby-ng
# if RUBY_FAKEGEM_RECIPE_TEST is set to "rake" (the default).
# RUBY_FAKEGEM_TASK_TEST="test"
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_RECIPE_DOC
+# @DESCRIPTION:
+# Specify one of the default API doc building function for ruby-fakegem:
+# - rake (default; see also RUBY_FAKEGEM_TASK_DOC)
+# - rdoc (calls `rdoc-2`, adds dev-ruby/rdoc to the dependencies);
+# - none
+# RUBY_FAKEGEM_RECIPE_DOC="rake"
+
# @ECLASS-VARIABLE: RUBY_FAKEGEM_DOCDIR
# @DESCRIPTION:
# Specify the directory under which the documentation is built;
# if empty no documentation will be installed automatically.
+# Note: if RUBY_FAKEGEM_RECIPE_DOC is set to `rdoc`, this variable is
+# hardwired to `doc`.
# RUBY_FAKEGEM_DOCDIR=""
# @ECLASS-VARIABLE: RUBY_FAKEGEM_EXTRADOC
@@ -57,6 +67,12 @@ inherit ruby-ng
# Extra documentation to install (readme, changelogs, …).
# RUBY_FAKEGEM_EXTRADOC=""
+# @ECLASS-VARIABLE: RUBY_FAKEGEM_DOC_SOURCES
+# @DESCRIPTION:
+# Allow settings defined sources to scan for documentation.
+# This only applies if RUBY_FAKEGEM_DOC_TASK is set to `rdoc`.
+# RUBY_FAKEGEM_DOC_SOURCES="lib"
+
# @ECLASS-VARIABLE: RUBY_FAKEGEM_BINWRAP
# @DESCRIPTION:
# Binaries to wrap around (relative to the bin/ directory)
@@ -83,20 +99,31 @@ RUBY_FAKEGEM_NAME="${RUBY_FAKEGEM_NAME:-${PN}}"
RUBY_FAKEGEM_VERSION="${RUBY_FAKEGEM_VERSION:-${PV/_pre/.pre}}"
RUBY_FAKEGEM_SUFFIX="${RUBY_FAKEGEM_SUFFIX:-}"
+RUBY_FAKEGEM_RECIPE_DOC="${RUBY_FAKEGEM_RECIPE_DOC-rake}"
RUBY_FAKEGEM_TASK_DOC="${RUBY_FAKEGEM_TASK_DOC-rdoc}"
+RUBY_FAKEGEM_DOC_SOURCES="${RUBY_FAKEGEM_DOC_SOURCES-lib}"
+
RUBY_FAKEGEM_RECIPE_TEST="${RUBY_FAKEGEM_RECIPE_TEST-rake}"
RUBY_FAKEGEM_TASK_TEST="${RUBY_FAKEGEM_TASK_TEST-test}"
RUBY_FAKEGEM_BINWRAP="${RUBY_FAKEGEM_BINWRAP-*}"
-if [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]]; then
- IUSE="$IUSE doc"
- ruby_add_bdepend "doc? ( dev-ruby/rake )"
-fi
+[[ ${RUBY_FAKEGEM_TASK_DOC} == "" ]] && RUBY_FAKEGEM_RECIPE_DOC="none"
-if [[ -n ${RUBY_FAKEGEM_DOCDIR} ]]; then
- IUSE="$IUSE doc"
-fi
+case ${RUBY_FAKEGEM_RECIPE_DOC} in
+ rake)
+ IUSE+=" doc"
+ ruby_add_bdepend "doc? ( dev-ruby/rake )"
+ ;;
+ rdoc)
+ IUSE+=" doc"
+ ruby_add_bdepend "doc? ( dev-ruby/rdoc )"
+ RUBY_FAKEGEM_DOCDIR="doc"
+ ;;
+ none)
+ [[ -n ${RUBY_FAKEGEM_DOCDIR} ]] && IUSE+=" doc"
+ ;;
+esac
[[ ${RUBY_FAKEGEM_TASK_TEST} == "" ]] && RUBY_FAKEGEM_RECIPE_TEST="none"
@@ -246,7 +273,7 @@ ruby_fakegem_genspec() {
# so better taking this into consideration.
local quoted_description=${DESCRIPTION//\"/\\\"}
cat - > $1 <<EOF
-# generated by ruby-fakegem.eclass $Revision: 1.34 $
+# generated by ruby-fakegem.eclass $Revision: 1.35 $
Gem::Specification.new do |s|
s.name = "${RUBY_FAKEGEM_NAME}"
s.version = "${RUBY_FAKEGEM_VERSION}"
@@ -296,7 +323,7 @@ ruby_fakegem_binwrapper() {
#!${rubycmd}
# This is a simplified version of the RubyGems wrapper
#
-# Generated by ruby-fakegem.eclass $Revision: 1.34 $
+# Generated by ruby-fakegem.eclass $Revision: 1.35 $
require 'rubygems'
@@ -314,8 +341,15 @@ EOF
# Build documentation for the package if indicated by the doc USE flag
# and if there is a documetation task defined.
all_fakegem_compile() {
- if [[ ${RUBY_FAKEGEM_TASK_DOC} != "" ]] && use doc; then
- rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
+ if use doc; then
+ case ${RUBY_FAKEGEM_RECIPE_DOC} in
+ rake)
+ rake ${RUBY_FAKEGEM_TASK_DOC} || die "failed to (re)build documentation"
+ ;;
+ rdoc)
+ rdoc ${RUBY_FAKEGEM_DOC_SOURCES} || die "failed to (re)build documentation"
+ ;;
+ esac
fi
}