--- libdnet.orig/libdnet-1.11-r1.ebuild 2010-07-20 05:35:59.000000000 +0800 +++ libdnet.orig/libdnet-1.11-r1.ebuild 2011-11-20 04:43:03.343927833 +0800 @@ -3,7 +3,9 @@ # $Header: /var/cvsroot/gentoo-x86/dev-libs/libdnet/libdnet-1.11-r1.ebuild,v 1.11 2010/07/19 21:35:59 maekke Exp $ #WANT_AUTOMAKE=1.6 -inherit eutils autotools +EAPI=3 +PYTHON_DEPEND="python? 2" +inherit eutils autotools python DESCRIPTION="simplified, portable interface to several low-level networking routines" HOMEPAGE="http://libdnet.sourceforge.net/" @@ -14,17 +16,29 @@ KEYWORDS="alpha amd64 ~arm hppa ia64 ppc ppc64 sparc x86" IUSE="python" -src_unpack() { - unpack ${A} - cd "${S}" +DEPEND="" +RDEPEND="${DEPEND}" + +pkg_setup() { + if use python; then + python_set_active_version 2 + fi +} + +src_prepare() { sed -i 's/suite_free(s);//' test/check/*.c || die "sed failed" epatch "${FILESDIR}"/${PN}-1.10-gcc4.diff + epatch "${FILESDIR}"/congig-h.patch AT_M4DIR="config" + eautoreconf } -src_compile () { +src_configure() { econf $(use_with python) || die "econf failed" +} + +src_compile() { emake || die "emake failed" } @@ -33,6 +47,6 @@ } src_install () { - emake DESTDIR="${D}" install || die "make install failed" + emake DESTDIR="${ED}" install || die "make install failed" dodoc README THANKS TODO } + if use python; then + python_set_active_version 2 + fi +} --- libdnet-1.11.orig/python/dnet.c +++ libdnet-1.11.orig/python/dnet.c @@ -6,7 +6,7 @@ #define PY_LONG_LONG LONG_LONG #endif #include "dnet.h" - +#include "config.h" typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/ typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/ --- libdnet-1.11.orig/test/dnet/dnet.c +++ libdnet-1.11.orig/test/dnet/dnet.c @@ -15,7 +15,7 @@ #include #include #include - +#include "config.h"> #include "dnet.h" #include "mod.h"