--- libcap-ng-0.7.3.ebuild 2013-02-21 00:01:31.000000000 +0000 +++ libcap-ng-0.7.3.ebuild 2013-06-02 04:41:29.586474911 +0000 @@ -4,10 +4,9 @@ EAPI=5 -SUPPORT_PYTHON_ABIS="1" -RESTRICT_PYTHON_ABIS="*-jython *-pypy-*" +PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} ) -inherit autotools flag-o-matic python +inherit autotools eutils flag-o-matic python-r1 DESCRIPTION="POSIX 1003.1e capabilities" HOMEPAGE="http://people.redhat.com/sgrubb/libcap-ng/" @@ -18,17 +17,13 @@ SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux" IUSE="python static-libs" -RDEPEND="python? ( dev-lang/python )" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND="python? ( ${PYTHON_DEPS} )" DEPEND="${RDEPEND} sys-kernel/linux-headers python? ( >=dev-lang/swig-2 )" -PYTHON_CFLAGS=("2.* + -fno-strict-aliasing") - -pkg_setup() { - use python && python_pkg_setup -} - src_prepare() { # Disable byte-compilation of Python modules. >py-compile @@ -52,16 +47,22 @@ src_compile() { default if use python; then - python_copy_sources bindings/python + S=bindings/python python_copy_sources building() { + if [[ ${EPYTHON} = python2.* ]]; then + local CFLAGS="${CFLAGS}" + append-cflags -fno-strict-aliasing + fi emake \ CFLAGS="${CFLAGS}" \ - PYTHON_VERSION="$(python_get_version)" \ + PYTHON="${PYTHON}" \ + PYTHON_VERSION="${EPYTHON#python}" \ pyexecdir="$(python_get_sitedir)" \ pythondir="$(python_get_sitedir)" } - python_execute_function -s --source-dir bindings/python building + BUILD_DIR=bindings/python \ + python_parallel_foreach_impl run_in_build_dir building fi } @@ -76,13 +77,15 @@ src_test() { if use python; then testing() { emake \ - PYTHON_VERSION="$(python_get_version)" \ + PYTHON="${PYTHON}" \ + PYTHON_VERSION="${EPYTHON#python}" \ pyexecdir="$(python_get_sitedir)" \ pythondir="$(python_get_sitedir)" \ TESTS_ENVIRONMENT="PYTHONPATH=..:../.libs" \ check } - python_execute_function -s --source-dir bindings/python testing + BUILD_DIR=bindings/python \ + python_parallel_foreach_impl run_in_build_dir testing fi } @@ -93,23 +96,16 @@ src_install() { installation() { emake \ DESTDIR="${D}" \ - PYTHON_VERSION="$(python_get_version)" \ + PYTHON="${PYTHON}" \ + PYTHON_VERSION="${EPYTHON#python}" \ pyexecdir="$(python_get_sitedir)" \ pythondir="$(python_get_sitedir)" \ install + python_optimize } - python_execute_function -s --source-dir bindings/python installation - - python_clean_installation_image + BUILD_DIR=bindings/python \ + python_parallel_foreach_impl run_in_build_dir installation fi - rm -f "${ED}"/usr/lib*/${PN}.la -} - -pkg_postinst() { - use python && python_mod_optimize capng.py -} - -pkg_postrm() { - use python && python_mod_cleanup capng.py + prune_libtool_files --modules }