# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-fps/postal2/postal2-1409.2.ebuild,v 1.4 2007/04/17 15:57:02 wolf31o2 Exp $ inherit eutils games DESCRIPTION="Postal 2: Frudge Pack" HOMEPAGE="http://www.gopostal.com/" #SRC_URI="http://updatefiles.linuxgamepublishing.com/${PN}/${P/%?/1}.run # http://updatefiles.linuxgamepublishing.com/${PN}/${P}.run" LICENSE="postal2" SLOT="0" KEYWORDS="~amd64 x86" IUSE="" RESTRICT="strip" DEPEND="games-util/loki_patch" RDEPEND="x11-libs/libXext amd64? ( app-emulation/emul-linux-x86-baselibs app-emulation/emul-linux-x86-xlibs app-emulation/emul-linux-x86-soundlibs app-emulation/emul-linux-x86-sdl app-emulation/emul-linux-x86-compat )" S=${WORKDIR} # TODO: yes GAMES_CHECK_LICENSE="no" MS_Progress() { while read a; do echo -n . done } MS_dd() { blocks=`expr $3 / 1024` bytes=`expr $3 % 1024` dd if="$1" ibs=$2 skip=1 obs=1024 conv=sync 2> /dev/null | \ { test $blocks -gt 0 && dd ibs=1024 obs=1024 count=$blocks ; \ test $bytes -gt 0 && dd ibs=1 obs=1024 count=$bytes ; } 2> /dev/null } src_unpack() { cdrom_get_cds linux_installer.sh installer=$CDROM_ROOT/linux_installer.sh filesizes=$(grep -m 1 -a "filesizes=" $installer | egrep -o "[0-9]+") offset=$(head -n 403 $installer | wc -c | tr -d " ") for s in $filesizes; do echo -n ">>> extracting $s bytes from $installer " MS_dd $installer $offset $s | eval "cat" | ( cd ${S}; tar xvf - ) | MS_Progress echo " done" offset=$(expr $offset + $s) done # TODO: or postal2*.tar for everything # TODO: or selectable via useflags? for f in postal2-lnx-data.tar; do echo -n ">>> extracting $f " ( cd ${S}; tar vxf $f ) | MS_Progress echo " done" done } src_install() { echo ">>> installing game-data ... " insinto ${GAMES_PREFIX_OPT}/${PN} cd ${S} doins -r System # TODO: also for other bins? chmod u+x,g+x ${D}/${GAMES_PREFIX_OPT}/${PN}/System/postal2-bin cd ${CDROM_ROOT} doins -r \ KarmaData Sounds Animations Maps StaticMeshes \ Music Save Textures Web Help cd ${CDROM_ROOT}/System insinto ${GAMES_PREFIX_OPT}/${PN}/System doins *.bmp *.int *.u games_make_wrapper ${PN} ./${PN}-bin "${GAMES_PREFIX_OPT}/${PN}"/System . cd ${S} doicon ${PN}.xpm make_desktop_entry ${PN} "Postal 2: Share The Pain" ${PN}.xpm prepgamesdirs }