diff -ur aap.orig/aap-1.091.ebuild aap/aap-1.091.ebuild --- aap.orig/aap-1.091.ebuild 2009-09-12 09:40:42.000000000 +0800 +++ aap/aap-1.091.ebuild 2011-11-19 01:24:05.381951195 +0800 @@ -2,7 +2,9 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/dev-util/aap/aap-1.091.ebuild,v 1.1 2009/09/12 01:40:42 patrick Exp $ -IUSE="doc" +EAPI="3" +PYTHON_DEPEND="2" +inherit python DESCRIPTION="Bram Moolenaar's super-make program" HOMEPAGE="http://www.a-a-p.org/" @@ -11,19 +14,22 @@ SLOT="0" KEYWORDS="~alpha ~amd64 ~ia64 ~mips ~ppc ~sparc ~x86" DEPEND="app-arch/unzip" RDEPEND="" +IUSE="doc" + S=${WORKDIR}/${PN} -src_unpack() { - mkdir "${S}" && cd "${S}" && unzip -q "${DISTDIR}"/${A} || die +pkg_setup() { + python_set_active_version 2 + python_pkg_setup } - + src_install() { rm doc/*.sgml rm doc/*.pdf if use doc ; then dodir /usr/share/doc/${PF}/html - cp -R doc/* "${D}"/usr/share/doc/${PF}/html + cp -R doc/* "${ED}"/usr/share/doc/${PF}/html fi rm doc/*.html rm -fr doc/images @@ -36,9 +41,19 @@ # Move the remainder directly into the dest tree dodir /usr/share cd "${WORKDIR}" - mv aap "${D}"/usr/share + mv aap "${ED}"/usr/share # Create a symbolic link for the executable dodir /usr/bin - ln -s ../share/aap/aap "${D}"/usr/bin/aap + ln -s ../share/aap/aap "${ED}"/usr/bin/aap + + python_convert_shebangs -r 2 "${ED}" +} + +pkg_postinst() { + python_mod_optimize /usr/share/aap +} + +pkg_postrm() { + python_mod_cleanup /usr/share/aap }