# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/svnroot/gentoo-x86/games-rpg/vegastrike/vegastrike-9999.ebuild,v 1.13 2004/06/24 23:17:11 agriffis Exp $ inherit flag-o-matic eutils games subversion ESVN_REPO_URI="https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk" ESVN_PROJECT="vegastrike" ESVN_BOOTSTRAP="vegastrike/bootstrap-sh" DESCRIPTION="A 3D space simulator that allows you to trade and bounty hunt" HOMEPAGE="http://vegastrike.sourceforge.net/" LICENSE="GPL-2" SLOT="0" KEYWORDS="amd64 x86 ~ppc" IUSE="stencil-buffer gtk no-sound sdl debug" #LANGS="de en-GB it" RDEPEND=" dev-lang/python virtual/opengl media-libs/jpeg media-libs/libpng dev-libs/expat media-libs/openal sdl? ( media-libs/libsdl ) !no-sound? ( media-libs/libvorbis media-libs/libogg sdl? ( media-libs/sdl-mixer ) ) virtual/glut virtual/glu gtk? ( x11-libs/gtk+ ) !games-rpg/vegastrike-ded " DEPEND="${RDEPEND} dev-lang/perl >=sys-devel/autoconf-2.58" S="${WORKDIR}" pkg_setup() { games_pkg_setup einfo "If compiling fails for you on gl_globals.h, try to replace your" einfo "glext.h (usually found in /usr/include/GL/ with this one" einfo "http://oss.sgi.com/projects/ogl-sample/ABI/glext.h" einfo "remember to make backup of the original though" } src_unpack() { cd ${S} local svn=${ESVN_TOP_DIR} if [ ! -d "${svn}/vegastrike" ]; then ESVN_MODULE="vegastrike" ESVN_MODULE_DIR="${ESVN_REPO_URI}/${ESVN_MODULE}" subversion_fetch $ESVN_MODULE_DIR $ESVN_MODULE || die "Fetching vegastrike failed" fi if ([ ! -d "${svn}/data" ] && [ ! -d "${svn}/data4.x" ]); then ESVN_MODULE="data4.x" ESVN_MODULE_DIR="${ESVN_REPO_URI}/${ESVN_MODULE}" subversion_fetch $ESVN_MODULE_DIR $ESVN_MODULE || die "Fetching data failed" fi # translations are quite incoplete # if [ ! -d "${svn}/translations" ]; then # ESVN_MODULE="translations" # ESVN_MODULE_DIR="${ESVN_REPO_URI}/${ESVN_MODULE}" # subversion_fetch $ESVN_MODULE_DIR $ESVN_MODULE || die "Fetching translations failed" # fi einfo "Copying data to work directory..." cp -a ${svn}/{vegastrike,data4.x,vssetup} ${S} >&/dev/null # cd ${S}/data4.x # music dir will be downloaded always # if use music; then # if [ ! -d "${svn}/music" ]; then # ESVN_MODULE="music" # ESVN_MODULE_DIR="${ESVN_REPO_URI}/${ESVN_MODULE}" # subversion_fetch $ESVN_MODULE_DIR "data4.x/$ESVN_MODULE" || die "Fetching music failed" # fi # einfo "Copying game music to work directory..." # cp -a ${svn}/music ${S}/data4.x >&/dev/null # fi # We don't need any windows stuff rm -r ${S}/data4.x/bin/* # Clean up data dir find -name ".svn" -type d -exec rm -rf '{}' \; >&/dev/null find -name '*~' -type f -exec rm -f '{}' \; >&/dev/null # Converts vegastrike.ico into png if we've got imagemagick convert vegastrike.ico png:vegastrike.png >&/dev/null # Sort out directory references sed -i \ -e "s!/usr/local/share/doc!/usr/share/doc!" \ -e "s!/usr/local/share/vegastrike!${GAMES_DATADIR}/vegastrike!" \ -e "s!/usr/games/vegastrike!${GAMES_DATADIR}/vegastrike!" \ -e "s!/usr/local/bin!${GAMES_BINDIR}!" \ -e "s!/usr/local/lib/man!/usr/share/man!" \ ${S}/data4.x/documentation/vegastrike.1 \ || die "sed data/documentation/vegastrike.1 failed" cd ${S}/vegastrike sed -i \ -e "s!/usr/games/vegastrike!${GAMES_DATADIR}/vegastrike!" \ -e "s!/usr/local/bin!${GAMES_BINDIR}!" \ launcher/saveinterface.cpp \ || die "sed launcher/saveinterface.cpp failed" sed -i \ "s!/usr/local/share/vegastrike!${GAMES_DATADIR}/vegastrike!" \ src/common/common.cpp \ || die "sed src/common/common.cpp failed" sed -i \ "s!/usr/share/local/vegastrike!${GAMES_DATADIR}/vegastrike!" \ src/vsfilesystem.cpp \ || die "sed src/filesys.cpp failed" sed -i \ -e '/^SUBDIRS =/s:tools::' \ Makefile.am \ || die "sed Makefile.am failed" # is not possible here to use built in function subversion_bootstrap: it # won't work as expected: ./bootstrap isn't in main compile dir ./bootstrap-sh } src_compile() { cd ${S}/vegastrike local conf_opts="${conf_opts} --disable-dependency-tracking" if use debug; then conf_opts="${conf_opts} --enable-debug" else conf_opts="${conf_opts} --enable-release=2" fi if ! use gtk; then conf_opts="${conf_opts} --disable-gtk" fi CONFIGURE_OPTIONS=" $(use_enable stencil-buffer) $(use_enable sdl) $(use_enable !no-sound sound) ${conf_opts}" egamesconf $CONFIGURE_OPTIONS \ || die "egamesconf failed" #it causes corruptions filter-flags -ffast-math #the dirty way if ! use debug; then sed -e "s:-ffast-math:${CXXFLAGS}:g" \ Makefile > Makefile.temp \ || die "sed of CXXFLAGS failed" mv Makefile.temp Makefile -f fi emake || die "emake failed" # cd ${S}/vssetup/src/ # perl ./build || die "perl build failed" } src_install() { cd ${S} cat << EOF > vsinstall #!/bin/sh ( mkdir \${HOME}/.vegastrike 2> /dev/null cd \${HOME}/.vegastrike if [ -f save.4.x.txt ] ; then touch save.4.x.txt else echo "default"> save.4.x.txt fi cp ${GAMES_DATADIR}/${PN}/data4.x/setup.config . cp ${GAMES_DATADIR}/${PN}/data4.x/.vegastrike/*.m3u . cp ${GAMES_DATADIR}/${PN}/data4.x/vegastrike.config . ${GAMES_BINDIR}/vssetup ) echo "If you wish to have your own music edit ~/.vegastrike/*.m3u" echo "Each playlist represents a place or situation in Vega Strike" exit 0 EOF dogamesbin vegastrike/vegastrike \ || die "Creation of vegastrike (the binary) failed" dogamesbin vsinstall \ || die "Creation of vsinstall failed" dogamesbin vegastrike/vegaserver \ || die "Creation of vegaserver failed" if use gtk; then dogamesbin vegastrike/vslauncher \ || die "Creation of vslauncher failed" newgamesbin vegastrike/vssetup vssetup || die "newgamesbin failed" fi cp -rf vegastrike/setup data4.x/bin/ || die "cp failed" cp -rf vsinstall data4.x/bin/vsinstall || die "cp failed" doman data4.x/documentation/*.1 dodoc data4.x/documentation/*.txt dodir "${GAMES_DATADIR}/${PN}" cp -r data4.x/ "${D}/${GAMES_DATADIR}/${PN}/" || die "cp failed (data)" prepgamesdirs } pkg_postinst() { games_pkg_postinst einfo "run vsinstall to setup your Account," einfo "then run vegastrike (or the deprecated vslauncher)" einfo " to start Vega Strike;" einfo "or run vssetup to set up Vega Strike." einfo "to start Vega Strike Server run vegaserver." }