# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-emulation/pearpc/pearpc-0.4.ebuild,v 1.13 2009/09/06 21:18:20 robbat2 Exp $ EAPI=1 inherit eutils flag-o-matic linux-mod GIT_COMMIT="7eb63de8a92b86e1b7438019ddcf935005112501" PRE_VERSION="0.6" DESCRIPTION="PowerPC Architecture Emulator" HOMEPAGE="http://pearpc.sourceforge.net/" SRC_URI="https://github.com/sebastianbiallas/pearpc/archive/${GIT_COMMIT}.zip http://pearpc.sf.net/createdisk.py" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" #IUSE="debug jit X +sdl gtk qt" IUSE="debug jit X +sdl" RDEPEND="sys-apps/net-tools sdl? ( >=media-libs/libsdl-1.2.0 ) X? ( x11-libs/libX11 ) net-firewall/iptables net-misc/bridge-utils" DEPEND="${RDEPEND} sys-devel/flex sys-devel/bison x86? ( sys-devel/binutils ) jit? ( sys-devel/binutils )" src_unpack() { unpack ${A} mv "pearpc-${GIT_COMMIT}" "${S}" cd "${S}" } pkg_setup() { linux-mod_pkg_setup if ! linux_chkconfig_present TUN; then die "You must have TUN/TAP enabled in your kernel." fi if ! use X && ! use sdl && ! use gtk && ! use qt; then die "You must set at least one of these USE flags: X, sdl" # die "You must set at least one of these USE flags: X, sdl, gtk, qt" fi } src_compile() { local myconf ./autogen.sh use jit || myconf="${myconf} --enable-cpu=generic" if use sdl; then myconf="${myconf} --enable-ui=sdl" elif use X; then myconf="${myconf} --enable-ui=x11" # elif use gtk; then # myconf="${myconf} --enable-ui=gtk" # elif use qt; then # myconf="${myconf} --enable-ui=qt" fi econf \ $(use_enable debug) \ ${myconf} \ || die "econf failed" emake -j1 || die "emake failed" sed -i -e "s:video.x:/usr/share/${PN}-${PRE_VERSION}/video.x:g" ppccfg.example } src_install() { dobin src/ppc dodoc ChangeLog AUTHORS README TODO ppccfg.example insinto /usr/share/${PN}-${PRE_VERSION} doins scripts/ifppc_{down,up}{,.setuid} video.x fperms u+s,a+x /usr/share/${PN}-${PRE_VERSION}/ifppc_{up,down}.setuid insinto /usr/share/${PN}-${PRE_VERSION}/scripts doins "${FILESDIR}"/settings insopts -m0755 doins "${DISTDIR}"/createdisk.py } pkg_postinst() { elog "The main executable is called \"ppc\" and takes a configuration file as the" elog "only argument." elog "" elog "If you already have configuration files you will need to update them to point" elog "to the new location of video.x, which is now" elog " /usr/share/${PN}-${PRE_VERSION}/video.x" elog "" elog "To create disk images for PearPC, you can use the Python script located at:" elog " /usr/share/${PN}-${PRE_VERSION}/scripts/createdisk.py" elog "Usage: createdisk.py " elog "" elog "If you are new to PearPC be sure to check ppccfg.example for configuration" elog "options, it is located in:" elog " /usr/share/doc/${P}/" elog "" elog "Except for the new location of video.x, PearPC 0.5 configuration files should" elog "work without further modification." }