# Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # Aric LeDell 2003-01-11 16:20 inherit games S=${WORKDIR}/${P} DESCRIPTION="This is a collection of games from NetBSD" HOMEPAGE="http://www.advogato.org/proj/bsd-games/" SRC_URI="ftp://metalab.unc.edu/pub/Linux/games/${P}.tar.gz" SLOT="0" LICENSE="non-free" KEYWORDS="x86" DEPEND="sys-libs/ncurses sys-apps/miscfiles sys-apps/less sys-devel/bison sys-devel/flex" echo ${GAMES_TO_BUILD:="hack rogue"} > /dev/null export GAMES_TO_BUILD src_unpack() { unpack ${P}.tar.gz } src_compile() { cd ${S} einfo "Getting bsd-games's custom configure ready for gentoo" cp -a ${FILESDIR}/config.params-gentoo ./config.params # Set GAMES_TO_BUILD variable to whatever you want echo bsd_games_cfg_build_dirs=\"${GAMES_TO_BUILD}\" >> ./config.params ./configure || die make || die } src_install() { cd ${S} dodir ${GAMES_BINDIR} dodir /usr/share/man/man1 dodir /usr/share/man/man6 make DESTDIR=${D} install-strip || die dodoc AUTHORS BUGS COPYING ChangeLog ChangeLog.0 INSTALL NEWS \ PACKAGING README README.non-free SECURITY THANKS TODO YEAR2000 \ bsd-games-non-free.lsm DOCSDIR=${D}usr/share/doc/${PF} # Do the special stuff for each game if build_game hack ; then BEING_INSTALLED=hack einfo "Doing special installation tasks for $BEING_INSTALLED" gamesowners ${D}/${GAMES_BINDIR}/${BEING_INSTALLED} gamesperms ${D}/${GAMES_BINDIR}/${BEING_INSTALLED} gzip -c ${S}/hack/COPYRIGHT > ${DOCSDIR}/COPYRIGHT.hack.gz gzip -c ${S}/hack/OWNER > ${DOCSDIR}/OWNER.hack.gz gzip -c ${S}/hack/Original_READ_ME > ${DOCSDIR}/Original_README_ME.hack.gz gzip -c ${S}/hack/READ_ME > ${DOCSDIR}/READ_ME.hack.gz gzip -c ${S}/hack/help > ${DOCSDIR}/help.hack.gz fi if build_game rogue ; then BEING_INSTALLED=rogue einfo "Doing special installation tasks for $BEING_INSTALLED" gamesowners ${D}/${GAMES_BINDIR}/${BEING_INSTALLED} gamesperms ${D}/${GAMES_BINDIR}/${BEING_INSTALLED} chmod g+s ${D}/${GAMES_BINDIR}/${BEING_INSTALLED} cp -a ${S}/rogue/USD.doc/rogue.me ${DOCSDIR} gzip -c ${S}/rogue/CHANGES > ${DOCSDIR}/CHANGES.rogue fi } # Modeled after /usr/lib/portage/bin/ebuild.sh 's use() function build_game() { local x for x in ${GAMES_TO_BUILD} do if [ "${x}" = "${1}" ] then return 0 fi done return 1 }