# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="4" SUPPORT_PYTHON_ABIS="1" RESTRICT_PYTHON_ABIS="2.5 3.*" inherit eutils versionator scons-utils python MY_PV=$(get_version_component_range 1-2) DESCRIPTION="Python binding to exiv2" HOMEPAGE="http://tilloy.net/dev/pyexiv2/" SRC_URI="http://launchpad.net/${PN}/${MY_PV}.x/${PV}/+download/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="doc examples" DEPEND=">=media-gfx/exiv2-0.20 doc? ( dev-python/sphinx ) dev-libs/boost[python]" RDEPEND="${DEPEND}" BOOSTLIB="" src_prepare() { preparation() { BOOSTLIB="boost_python-${PYTHON_ABI}" } python_execute_function preparation } src_compile() { escons lib BOOSTLIB="${BOOSTLIB}" || die if use doc; then escons doc || die # To enable doins -r in src_install rm -R doc/_build/.doctrees || die fi } src_install() { escons DESTDIR="${D}" BOOSTLIB="${BOOSTLIB}" install || die dodoc NEWS README todo || die if use examples; then insinto /usr/share/doc/${PF}/examples doins src/*example*.py fi if use doc; then insinto /usr/share/doc/${PF}/ doins -r doc/html || die # no dohtml due to mixed content fi } pkg_postinst() { python_mod_optimize ${PN} } pkg_postrm() { python_mod_cleanup ${PN} }