# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_DATA_V="2005-05-13" MY_DATA_PN="${PN}data" MY_DATA_P="${MY_DATA_PN}-${MY_DATA_V}" DESCRIPTION="Worms of Prey - A multi-player, real-time clone of Worms" HOMEPAGE="http://wormsofprey.org/" SRC_URI="http://wormsofprey.org/download/${P}-src.tar.bz2 http://wormsofprey.org/download/wopdata-${MY_DATA_V}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="X" DEPEND="virtual/libc X? ( virtual/x11 ) >=media-libs/libsdl-1.2 >=media-libs/sdl-net-1.2.5 >=media-libs/sdl-image-1.2 >=media-libs/sdl-mixer-1.2 >=media-libs/sdl-ttf-2.0" S="${WORKDIR}/${PN}" MY_DATA_S="${WORKDIR}/${MY_DATA_P}" src_unpack() { unpack ${A} # correct path to global woprc sed -i -e s:/etc/woprc:"${GAMES_SYSCONFDIR}/woprc":g "${S}/src/wopsettings.cpp" \ || die "sed failed" cd "${T}" echo '#!/bin/sh' > ${PN}-client echo "exec ${GAMES_BINDIR}/${PN} mode=client" \ >> "${PN}-client" echo '#!/bin/sh' > ${PN}-server echo "exec ${GAMES_BINDIR}/${PN} mode=server" \ >> "${PN}-server" } src_compile() { emake || die "emake failed" } src_install() { dogamesbin "${T}/${PN}"* bin/* || die "dogamesbin failed" dodir "${GAMES_DATADIR}/${MY_DATA_P}" cp -r "${MY_DATA_S}"/* "${D}${GAMES_DATADIR}/${MY_DATA_P}/" \ || die "cp failed" dosym "${GAMES_DATADIR}/${MY_DATA_P}" "${GAMES_DATADIR}/${PN}" dodoc AUTHORS COPYING ChangeLog PACKAGE_MAINTAINERS README{,-Libraries.txt} REVIEWS insinto "${GAMES_SYSCONFDIR}" doins "${S}/woprc" dosed -e 's:^data =.*$:data = '"${GAMES_DATADIR}/${PN}"':' "${GAMES_SYSCONFDIR}/woprc" \ || die "dosed failed" newicon "${GAMES_DATADIR}/${PN}/images/misc/icons/wop16.png" ${PN}.png make_desktop_entry wop-client "Worms of Prey - Client" wop.png ArcadeGame make_desktop_entry wop-server "Worms of Prey - Server" wop.png ArcadeGame prepgamesdirs } pkg_postinst() { games_pkg_postinst einfo "To run the server: ${PN}-server" einfo "To run the client: ${PN}-client" }