# Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: $ DESCRIPTION="iD Software's Quake 2" HOMEPAGE="http://www.idsoftware.com" SRC_URI="ftp://ftp.idsoftware.com/idstuff/quake2/q2-3.20-x86-full-ctf.exe" LICENSE="Q2EULA" SLOT="0" KEYWORDS="x86" IUSE="" DEPEND="app-arch/unzip virtual/x11" RDEPEND=${DEPEND} S=${WORKDIR} DATA_DIR= pkg_setup() { for mline in `mount -t iso9660 | awk '{print $3}'` ; do [ -d ${mline}/Install/Data/baseq2 ] && DATA_DIR="${mline}/Install/Data" done [ -n "${USER_DATA_DIR}" ] && DATA_DIR="${USER_DATA_DIR}" if [ -z "${DATA_DIR}" ] ; then echo eerror "You must mount the Quake 2 CD first!" echo ewarn "If you do not have the CD, but have the data files" ewarn "mounted somewhere on your filesystem, just export" ewarn "the variable USER_DATA_DIR so that it points to the" ewarn "directory containing the baseq2 (pak0.pak, etc.)" echo die "You must provide the Quake 2 data before running the install" fi } src_unpack() { unzip -L -q ${DISTDIR}/q2-3.20-x86-full-ctf.exe } src_install() { # Docs... dodoc DOCS/* 3.20_Changes.txt newdoc ctf/readme.txt ctf-readme.txt cp -R ${DATA_DIR}/Docs/quake2_manual ${D}usr/share/doc/${PF}/ # The basic directories dodir /usr/share/games/quake2-data/ dodir /usr/share/games/quake2-data/baseq2 dodir /usr/share/games/quake2-data/ctf # The most important bit: the basic pak insinto /usr/share/games/quake2-data/baseq2 cp ${DATA_DIR}/baseq2/pak0.pak ${D}/usr/share/games/quake2-data/baseq2/ || die "Sorry, failed copying pak0.pak" # The videos (optional) cp -R ${DATA_DIR}/baseq2/video ${D}/usr/share/games/quake2-data/baseq2/ # Install the point-release paks, players and maplist insinto /usr/share/games/quake2-data/baseq2 doins baseq2/pak1.pak baseq2/pak2.pak || die "Sorry, failed copying the point-release paks" cp -R baseq2/players ${D}/usr/share/games/quake2-data/baseq2/ || die "Sorry, failed copying the player models" doins baseq2/maps.lst # Install the CTF stuff insinto /usr/share/games/quake2-data/ctf doins ctf/pak0.pak ctf/server.cfg # Why not? ::) insinto /usr/share/games/quake2-data doins ctf/ctf2.ico # Set some owners/permissions find ${D}/usr/share/games/quake2-data -type d -print0 | xargs --null chmod 755 find ${D}/usr/share/games/quake2-data -type f -print0 | xargs --null chmod 644 chown -R root.games ${D}/usr/share/games/quake2-data }