# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs DESCRIPTION="Thread-safe ring buffer library" HOMEPAGE="http://nullkey.ath.cx/packetstream/" SRC_URI="http://nullkey.ath.cx/packetstream/archive/${P}.tar.gz" RESTRICT="nomirror" LICENSE="ZLIB" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="examples" DEPEND="" RDEPEND="" src_unpack() { unpack ${A} } src_compile() { cd "${WORKDIR}/${PN}" emake \ CC="$(tc-getCC)" \ LD="$(tc-getCC)" \ CFLAGS="${CFLAGS}" \ LDFLAGS="${LDFLAGS}" \ || die "emake failed" if use examples ; then make examples \ CC="$(tc-getCC)" \ LD="$(tc-getCC)" \ CFLAGS="${CFLAGS}" \ LDFLAGS="${LDFLAGS}" \ || die "make examples failed" fi if use amd64 ; then emake \ CC="$(tc-getCC)" \ LD="$(tc-getCC)" \ BUILD="build32" \ CFLAGS="${CFLAGS} -m32" \ LDFLAGS="${LDFLAGS} -m32" \ || die "emake failed" fi } src_install() { cd "${WORKDIR}/${PN}" if use examples ; then make install-examples \ DESTDIR="${D}" \ || die "make install failed" fi if use x86 ; then make install \ DESTDIR="${D}" \ MLIBDIR="lib" \ || die "make install failed" elif use amd64 ; then make install \ DESTDIR="${D}" \ MLIBDIR="lib64" \ || die "make install failed" make install \ DESTDIR="${D}" \ BUILD="build32" \ MLIBDIR="lib32" \ || die "make install failed" fi }