public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] [PATCH distutils-r1] Support EXAMPLES for installing examples.
@ 2013-02-15 23:56 Michał Górny
  2013-02-21 22:21 ` [gentoo-python] " Mike Gilbert
  2013-02-25  8:31 ` [gentoo-python] " IAN DELANEY
  0 siblings, 2 replies; 3+ messages in thread
From: Michał Górny @ 2013-02-15 23:56 UTC (permalink / raw
  To: gentoo-python; +Cc: python, Michał Górny

A lot of ebuilds is installing examples manually. In EAPI 4+ this
additionally requires calling 'docompress' to disable compressing them.

To make that simpler, introduce EXAMPLES aside to HTML_DOCS and DOCS.
---
 gx86/eclass/distutils-r1.eclass | 33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass
index e662fa2..f3f8f73 100644
--- a/gx86/eclass/distutils-r1.eclass
+++ b/gx86/eclass/distutils-r1.eclass
@@ -151,7 +151,25 @@ fi
 #
 # Example:
 # @CODE
-# HTML_DOCS=( doc/html/ )
+# HTML_DOCS=( doc/html/. )
+# @CODE
+
+# @ECLASS-VARIABLE: EXAMPLES
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# An array containing examples installed into 'examples' doc
+# subdirectory. The files and directories listed there must exist
+# in the directory from which distutils-r1_python_install_all() is run
+# (${S} by default).
+#
+# The 'examples' subdirectory will be marked not to be compressed
+# automatically.
+#
+# If unset, no examples will be installed.
+#
+# Example:
+# @CODE
+# EXAMPLES=( examples/. demos/. )
 # @CODE
 
 # @ECLASS-VARIABLE: DISTUTILS_IN_SOURCE_BUILD
@@ -487,7 +505,7 @@ distutils-r1_python_install_all() {
 	if declare -p DOCS &>/dev/null; then
 		# an empty list == don't install anything
 		if [[ ${DOCS[@]} ]]; then
-			dodoc -r "${DOCS[@]}" || die "dodoc failed"
+			dodoc -r "${DOCS[@]}"
 		fi
 	else
 		local f
@@ -495,13 +513,20 @@ distutils-r1_python_install_all() {
 		for f in README* ChangeLog AUTHORS NEWS TODO CHANGES \
 				THANKS BUGS FAQ CREDITS CHANGELOG; do
 			if [[ -s ${f} ]]; then
-				dodoc "${f}" || die "(default) dodoc ${f} failed"
+				dodoc "${f}"
 			fi
 		done
 	fi
 
 	if declare -p HTML_DOCS &>/dev/null; then
-		dohtml -r "${HTML_DOCS[@]}" || die "dohtml failed"
+		dohtml -r "${HTML_DOCS[@]}"
+	fi
+
+	if declare -p EXAMPLES &>/dev/null; then
+		local DOCDESTTREE=examples
+		dodoc -r "${EXAMPLES[@]}"
+
+		docompress -x /usr/share/doc/${PF}/examples
 	fi
 }
 
-- 
1.8.1.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-02-25  8:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 23:56 [gentoo-python] [PATCH distutils-r1] Support EXAMPLES for installing examples Michał Górny
2013-02-21 22:21 ` [gentoo-python] " Mike Gilbert
2013-02-25  8:31 ` [gentoo-python] " IAN DELANEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox