Set PYTHON_MODNAME. Don't install useless files.
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Sat, 10 Jul 2010 14:10:14 +0000 (14:10 +0000)
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
Sat, 10 Jul 2010 14:10:14 +0000 (14:10 +0000)
Package-Manager: portage-HEAD/cvs/Linux x86_64

dev-python/docutils/Manifest
dev-python/docutils/docutils-0.7.ebuild

index 57ddf1f397c0971d06160daa05a01908372db9b2..6b2633d85e60af93c506e7559260ac17f8f22067 100644 (file)
@@ -8,7 +8,7 @@ DIST docutils-0.7_pre6334.tar.bz2 1229262 RMD160 cf7a7b806b0996881557147f86153e1
 DIST glep-0.4-r1.tbz2 4667 RMD160 bea44f2fe567422fd42bedebdf04cb6d984478ae SHA1 123516118f8bb2c75296a125702f4bf8f3ff1959 SHA256 d0b421869fb3437e96484687fd57f34d4f5cdd5a1fbdb2314f1474b1f9afa058
 EBUILD docutils-0.5-r1.ebuild 3282 RMD160 2f4e89df1597866bb2abb5d5ce75d2a05f23ec64 SHA1 173bdf0c1625e1ec760db5ea3040cf11ff8fed79 SHA256 d9f23f5b275951b5bec987cd0a1abaa67c411579be5b4adc68abdfe1d34f4a40
 EBUILD docutils-0.6.ebuild 3616 RMD160 b697f7e98c6b2bd0241135c109c6c68a3d9d6b5e SHA1 9836e95fc73acbf3ca3be39ff4158506c12ac7ff SHA256 98cc1b242ba6f52a717e714e4a0b18d3b1c5e4f05336835853786534fc07345e
-EBUILD docutils-0.7.ebuild 4068 RMD160 386c45405f2ee84e66c6d2ff61bdc88e3ed27ba3 SHA1 c93f6c9ae73dccc449e08650eac37e973d4e3dde SHA256 57033deab1b2a4b271430ad741386250246c6a3820541fac2e349383c9854676
+EBUILD docutils-0.7.ebuild 4534 RMD160 9b13d2c64fee137065cf35f76d16361fd8d2ffe7 SHA1 48f7700b1f35602af9e5cb21d796eaeb582cdf45 SHA256 bbd038c4e2b891f37a16435e73558e804a377fec45e4b9a551ac6580444c15c7
 EBUILD docutils-0.7_pre6334.ebuild 4082 RMD160 b29d09c720ae6ce4135830b57c4c2e52934f3853 SHA1 f60a49434b6701599889fc60190273d330a5fcf7 SHA256 a8677be137942ef33139282a5905b82ec96b50d9df722c03af4d06d1aa4c717e
 MISC ChangeLog 16535 RMD160 8ca65a849ac4747121dca30cdb5a415c41bae9cd SHA1 79f26a9f4423da2d80d1993245b4536bb2b0314d SHA256 44ead767e6a8fb32b9625332026e7f04257e4812af91d75f364fa969ace2ffad
 MISC metadata.xml 224 RMD160 37a2cf5db0ab817c0e2a1127e9cc4278bf88c904 SHA1 e2c1b45b839624cbc4bd949c8458d50dec01e7cb SHA256 0bb6bfd1577f4800009497c7813935f712ae6a44dbbdec1a903e79eaa5f21755
index a1175b3efc8aafa1fc14de88c953accbd54603c9..355563dcf3d5c2d03dce0e688064af9b657a42ea 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/docutils-0.7.ebuild,v 1.1 2010/07/07 19:57:50 arfrever Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-python/docutils/docutils-0.7.ebuild,v 1.2 2010/07/10 14:10:14 arfrever Exp $
 
 EAPI="3"
 SUPPORT_PYTHON_ABIS="1"
@@ -23,6 +23,7 @@ RDEPEND=""
 PDEPEND="emacs? ( || ( >=app-emacs/rst-0.4 >=virtual/emacs-23 ) )"
 
 DOCS="*.txt"
+PYTHON_MODNAME="docutils roman.py"
 
 GLEP_SRC="${WORKDIR}/glep-0.4-r1"
 
@@ -77,17 +78,30 @@ install_txt_doc() {
 src_install() {
        distutils_src_install
 
-       # Tools
-       cd tools
-       local tool
-       for tool in *.py; do
-               dobin "${tool}"
-       done
+       declare -A tools=()
+
+       postinstallation_preparation() {
+               # Install tools.
+               pushd $([[ -d build-${PYTHON_ABI}/lib/tools ]] && echo build-${PYTHON_ABI}/lib/tools || echo tools) > /dev/null
+               local tool
+               for tool in *.py; do
+                       newbin "${tool}" "${tool}-${PYTHON_ABI}"
+                       python_convert_shebangs -q $(python_get_version) "${ED}usr/bin/${tool}-${PYTHON_ABI}"
+                       tools+=(["${ED}usr/bin/${tool}"]=)
+               done
+               popd > /dev/null
+
+               # Delete useless files, which are installed only with Python 3.
+               rm -fr "${ED}$(python_get_sitedir)/"{test,tools}
+       }
+       python_execute_function -q postinstallation_preparation
 
-       # Docs
-       cd "${S}"
+       python_generate_wrapper_scripts -f -q "${!tools[@]}"
+
+       # Install documentation.
        dohtml -r docs tools
-       # Manually install the stylesheet file
+
+       # Install stylesheet file.
        insinto /usr/share/doc/${PF}/html
        doins docutils/writers/html4css1/html4css1.css
        local doc
@@ -95,26 +109,18 @@ src_install() {
                install_txt_doc "${doc}"
        done
 
-       # installing Gentoo GLEP tools. Uses versioned GLEP distribution
+       # Install Gentoo GLEP tools.
        if use glep; then
-               dobin ${GLEP_SRC}/glep.py || die "dobin failed"
+               dobin "${GLEP_SRC}/glep.py" || die "dobin failed"
 
                installation_of_glep_tools() {
                        insinto $(python_get_sitedir)/docutils/readers
-                       newins ${GLEP_SRC}/glepread.py glep.py || die "newins reader failed"
+                       newins "${GLEP_SRC}/glepread.py" glep.py || die "newins reader failed"
                        insinto $(python_get_sitedir)/docutils/transforms
-                       newins ${GLEP_SRC}/glepstrans.py gleps.py || die "newins transform failed"
+                       newins "${GLEP_SRC}/glepstrans.py" gleps.py || die "newins transform failed"
                        insinto $(python_get_sitedir)/docutils/writers
-                       doins -r ${GLEP_SRC}/glep_html || die "doins writer failed"
+                       doins -r "${GLEP_SRC}/glep_html" || die "doins writer failed"
                }
                python_execute_function --action-message 'Installation of GLEP tools with $(python_get_implementation) $(python_get_version)...' installation_of_glep_tools
        fi
 }
-
-pkg_postinst() {
-       python_mod_optimize docutils roman.py
-}
-
-pkg_postrm() {
-       python_mod_cleanup docutils roman.py
-}