# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/games-roguelike/tome/tome-2.3.0.ebuild,v 1.1 2004/12/11 05:40:32 mr_bones_ Exp $ inherit eutils games MY_PV=${PV//./} DESCRIPTION="save the world from Morgoth and battle evil (or become evil ;])" HOMEPAGE="http://t-o-m-e.net/" SRC_URI="http://t-o-m-e.net/dl/src/tome-${MY_PV}-src.tar.bz2" LICENSE="Moria" SLOT="0" KEYWORDS="x86 ~ppc ~amd64" IUSE="sdl gtk X ncurses" RDEPEND="virtual/libc dev-lang/lua ncurses? ( >=sys-libs/ncurses-5 ) X? ( virtual/x11 ) sdl? ( media-libs/libsdl media-libs/sdl-image media-libs/sdl-ttf ) gtk? ( =x11-libs/gtk+-1* >=dev-libs/glib-1.2.5 )" DEPEND="${RDEPEND} >=sys-apps/sed-4" S="${WORKDIR}/tome-${MY_PV}-src" src_unpack() { unpack ${A} cd "${S}/src" mv makefile.std makefile epatch "${FILESDIR}/${PV}-gentoo-paths.patch" sed -i \ -e "s:GENTOO_DIR:${GAMES_STATEDIR}:" files.c init2.c \ || die "sed failed" GENTOO_TOME_USE="" GENTOO_TOME_LIBS="" GENTOO_TOME_INCLUDE="" if use sdl; then GENTOO_TOME_USE=" $GENTOO_TOME_USE -DUSE_SDL " GENTOO_TOME_LIBS=" $GENTOO_TOME_LIBS `sdl-config --libs` -lSDL_image -lSDL_ttf " GENTOO_TOME_INCLUDE=" $GENTOO_TOME_INCLUDE `sdl-config --cflags`" fi if use X; then GENTOO_TOME_USE=" $GENTOO_TOME_USE -DUSE_X11 " GENTOO_TOME_LIBS=" $GENTOO_TOME_LIBS -lX11 -L/usr/X11R6/lib " GENTOO_TOME_INCLUDE=" $GENTOO_TOME_INCLUDE -I/usr/X11R6/include " fi if use gtk; then GENTOO_TOME_USE=" $GENTOO_TOME_USE -DUSE_GTK " GENTOO_TOME_LIBS=" $GENTOO_TOME_LIBS `gtk-config --libs` " GENTOO_TOME_INCLUDE=" $GENTOO_TOME_INCLUDE `gtk-config --cflags`" fi if use ncurses; then GENTOO_TOME_USE=" $GENTOO_TOME_USE -DUSE_GCU " GENTOO_TOME_LIBS=" $GENTOO_TOME_LIBS -lncurses " fi if ! use sdl and ! use X and ! use gtk and ! use ncurses; then die "You need to choose either X, sdl, gtk or ncurses as use flags" fi sed -i -e "s:DEFINES = -DUSE_X11:DEFINES = $GENTOO_TOME_USE:" \ -e "s:LIBS = -lX11 -L/usr/X11R6/lib:LIBS = $GENTOO_TOME_LIBS:" \ -e "s:INCLUDES = -I/usr/X11R6/include:INCLUDES = $GENTOO_TOME_INCLUDE:" \ makefile \ || die "sed failed" find "${S}" -name .cvsignore -exec rm -f \{\} \; find "${S}/lib/edit" -type f -exec chmod a-x \{\} \; } src_compile() { cd src make depend || die "make depend failed" emake ./tolua || die "emake ./tolua failed" emake \ COPTS="${CFLAGS}" \ BINDIR="${GAMES_BINDIR}" \ LIBDIR="${GAMES_DATADIR}/${PN}" \ || die "emake failed" } src_install() { cd src make \ DESTDIR="${D}" \ OWNER="${GAMES_USER}" \ BINDIR="${GAMES_BINDIR}" \ LIBDIR="${GAMES_DATADIR}/${PN}" install \ || die "make install failed" cd "${S}" dodoc *.txt dodir "${GAMES_STATEDIR}" touch "${D}/${GAMES_STATEDIR}/${PN}-scores.raw" prepgamesdirs fperms g+w "${GAMES_STATEDIR}/${PN}-scores.raw" #FIXME: something has to be done about this. fperms g+w "${GAMES_DATADIR}/${PN}/data" } pkg_postinst() { games_pkg_postinst echo ewarn "ToME ${PV} is not save-game compatible with previous versions." echo einfo "If you have older save files and you wish to continue those games," einfo "you'll need to remerge the version of ToME with which you started" einfo "those save-games." }