Add examples flag support to ruby eclass, per bug
authorCaleb Tennis <caleb@gentoo.org>
Fri, 4 Nov 2005 23:45:36 +0000 (23:45 +0000)
committerCaleb Tennis <caleb@gentoo.org>
Fri, 4 Nov 2005 23:45:36 +0000 (23:45 +0000)
#111508

eclass/ruby.eclass

index 2e872ecfdc6a56ef50298443c790223171f6f8f0..ef0ad5baec9313aa953ec14df6fc36787db86719 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ruby.eclass,v 1.48 2005/08/23 14:55:11 swegener Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ruby.eclass,v 1.49 2005/11/04 23:45:36 caleb Exp $
 #
 # Author: Mamoru KOMACHI <usata@gentoo.org>
 #
@@ -43,7 +43,7 @@ EXPORT_FUNCTIONS src_unpack src_compile src_install econf emake einstall
 HOMEPAGE="http://raa.ruby-lang.org/list.rhtml?name=${PN}"
 SRC_URI="mirror://gentoo/${P}.tar.gz"
 
-IUSE=""
+IUSE="examples"
 
 SLOT="0"
 LICENSE="Ruby"
@@ -148,12 +148,16 @@ erubydoc() {
        else
                dohtml -r *
        fi
-       for dir in sample example examples; do
-               if [ -d ${dir} ] ; then
-                       dodir /usr/share/doc/${PF}
-                       cp -pPR ${dir} ${D}/usr/share/doc/${PF} || die "cp failed"
-               fi
-       done
+
+       if ( use examples ); then       
+               for dir in sample example examples; do
+                       if [ -d ${dir} ] ; then
+                               dodir /usr/share/doc/${PF}
+                               cp -pPR ${dir} ${D}/usr/share/doc/${PF} || die "cp failed"
+                       fi
+               done
+       fi
+
        for i in ChangeLog* [A-Z][A-Z]* ; do
                [ -e $i ] && dodoc $i
        done