# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=4 PYTHON_DEPEND="*" SUPPORT_PYTHON_ABIS="1" inherit distutils DESCRIPTION="Basic functions for handling mime-types in python" HOMEPAGE="http://code.google.com/p/mimeparse" SRC_URI="http://mimeparse.googlecode.com/files/${P}.tar.gz" DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64" IUSE="test" PYTHON_MODNAME="mimeparse.py" RDEPEND="" DEPEND="${RDEPEND} dev-python/setuptools test? ( dev-python/simplejson )" src_prepare() { distutils_src_prepare 2to3_conversion() { echo "it is "${PYTHON_ABI} [[ "${PYTHON_ABI}" == 2.* ]] && return 2to3-${PYTHON_ABI} -w --no-diffs ${PN}.py > /dev/null } python_execute_function -s 2to3_conversion } src_test() { testing() { pushd "${S}-${PYTHON_ABI}" >/dev/null "$(PYTHON)" mimeparse_test.py popd >/dev/null } python_execute_function testing }