# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games flag-o-matic MY_P="400b26" S="${WORKDIR}/dc${MY_P}-src" SLOT="0" LICENSE="crawl" KEYWORDS="~x86 ~amd64" # possibly others too, but haven't been able to test. DESCRIPTION="A free and portable roguelike molded in the tradition of the \ early greats of the genre." SRC_URI="ftp://ftp.dungeoncrawl.org/dev/4.0.x/src/dc${MY_P}-src.tbz2 patch? ( http://www.angelfire.com/trek/mazewest/crawl/crawl-patches.diff.gz http://www.angelfire.com/trek/mazewest/crawl/crawl-patch-info.txt )" HOMEPAGE="http://www.dungeoncrawl.org/" DEPEND="sys-libs/ncurses" RDEPEND="sys-libs/ncurses app-arch/zip app-arch/unzip" IUSE="debug patch" src_unpack() { unpack dc${MY_P}-src.tbz2 cd ${S} cd source epatch ${FILESDIR}/dungeon-crawl-patch.patch || die if use patch; then epatch ${DISTDIR}/crawl-patches.diff.gz || die epatch ${FILESDIR}/space.patch || die cd .. epatch ${FILESDIR}/morgue-patch.patch || die else epatch ${FILESDIR}/religion.patch || die cd .. epatch ${FILESDIR}/morgue-orig.patch || die fi cd source sed "s#/opt/crawl/lib#${GAMES_STATEDIR}/crawl#g" AppHdr.h > \ AppHdr.h.bak mv AppHdr.h.bak AppHdr.h } src_compile() { cd source append-flags -Wall -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -DLINUX if use debug then append-flags -g -DFULLDEBUG -DWIZARD fi emake -f makefile.lnx } src_install() { dogamesbin source/crawl dodoc docs/*.txt docs/changes.* use patch && dodoc ${DISTDIR}/crawl-patch-info.txt doman docs/crawl.6 dodir ${GAMES_STATEDIR}/crawl dodir ${ROOT}etc/games/crawl cp macro.txt init.txt ${D}/etc/games/crawl echo "CRAWL_DIR=${ROOT}etc/games/crawl/" > 90crawl insinto /etc/env.d doins 90crawl prepgamesdirs } pkg_postinst() { games_pkg_postinst chmod g+w ${GAMES_STATEDIR}/crawl } pkg_postrm() { ewarn "Any saved games, bones files, etc. will not have been removed" ewarn "in this process. To get rid of Crawl completely, you will need" ewarn "to remove the ${GAMES_STATEDIR}/crawl directory manually." }