From fdde9a71c5c2470cec64d89160e2e3a911c8d85a Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Tue, 14 Aug 2012 21:10:45 +0000 Subject: Add support for documentation recipes as well, and implement an rdoc recipe. --- eclass/ruby-fakegem.eclass | 58 ++++++++++++++++++++++++++++++++++++---------- 1 file changed, 46 insertions(+), 12 deletions(-) (limited to 'eclass/ruby-fakegem.eclass') 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 <