From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BEE51138A6A for ; Fri, 15 Feb 2013 23:56:09 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 64E4CE04AB; Fri, 15 Feb 2013 23:56:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 89796E04AB for ; Fri, 15 Feb 2013 23:56:07 +0000 (UTC) Received: from pomiocik.lan (unknown [213.195.173.220]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 9BB0433D86C; Fri, 15 Feb 2013 23:56:05 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-python@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-python] [PATCH distutils-r1] Support EXAMPLES for installing examples. Date: Sat, 16 Feb 2013 00:56:13 +0100 Message-Id: <1360972573-21766-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.2 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org X-Archives-Salt: ee730ec7-d07f-45b5-a34c-ca54798c7bc5 X-Archives-Hash: 27e98ee0424ffa37106105c8a8bcf3bf 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