# $Header: /magellan-cvs/smage/quake3/quake3-1.32b3-r2.smage2,v 1.2 2008/02/07 14:23:53 niro Exp $ PNAME="quake3" PVER="1.32b3" PBUILD="r2" PCATEGORIE="x11-games" STATE="testing" DESCRIPTION="Quake III (Team-) Arena" HOMEPAGE="http://www.idsoftware.com/games/quake/quake3-arena/" DEPEND=">= virtual/opengl >= media-libs/libsdl-1.2 >= media-libs/openal-2005" SDEPEND=">= dev-util/desktop-file-utils-0.10" SRCFILE="linuxq3apoint-${PVER/b3/b-3}.x86.run" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" # do not strip any binaries NOSTRIP=true sminclude mtools xdg SRC_URI=( mirror://${PNAME}/${SRCFILE} ftp://ftp.idsoftware.com/idstuff/quake3/linux/${SRCFILE} http://games.mirrors.tds.net/pub/planetquake3/${SRCFILE} mirror://${PNAME}/quake3-wrapper.sh mirror://${PNAME}/quake3.png ) src_prepare() { install -d ${SRCDIR} || die cd ${SRCDIR} # determinate binary offset for makeself 2.1.3 # check with ver=$(grep -a '#.*Makeself' "${src}" | awk '{print $NF}') # and see http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/eutils.eclass # for more information (unpack_makeself) local src=${SOURCEDIR}/${PNAME}/${SRCFILE} offset=$(grep -a ^offset= ${src} | awk '{print $3}') let offset="offset + 1" # unpack tail -n +${offset} ${src} | tar --no-same-owner -xzvf - || die } src_install() { cd ${SRCDIR} # needed directories minstalldir /usr/bin || die minstalldir /usr/games/quake3/baseq3 || die minstalldir /usr/games/quake3/missionpack || die minstalldir /usr/games/quake3/pb || die minstalldir /usr/share/pixmaps || die # install data install -m0644 baseq3/*.pk3 ${BINDIR}/usr/games/quake3/baseq3 || die install -m0644 missionpack/*.pk3 ${BINDIR}/usr/games/quake3/missionpack || die # install libs and binaries cp -a pb/* ${BINDIR}/usr/games/quake3/pb || die install -m0755 bin/Linux/x86/* ${BINDIR}/usr/games/quake3 || die local i for i in quake3 quake3-smp do # build start wrapper minstallexec -s quake3-wrapper.sh /usr/games/quake3/${i} || die # symlink to /usr/bin mlink /usr/games/quake3/${i} /usr/bin || die # install desktop icons # menu-entry for kde and gnome minstall_desktop_icon \ --name ${i/q/Q} \ --file ${i} \ --exec ${i} \ --comment "First Person Shooter" \ --icon quake3.png \ --terminal \ --no-notify \ --categories "Game,ActionGame" \ || die done # pixmaps minstallpixmap quake3.png || die # install docs and other shared data install -m 0644 CHANGES* Q3A_EULA.txt README* ${BINDIR}/usr/games/quake3 || die minstalldocs CHANGES* Q3A_EULA.txt README* || die cp -a Docs/* ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die # set correct permissions mchown -R root:games /usr/games/quake3 || die mchown -R root:games /usr/bin || die mchmod 0754 /usr/games/quake3/quake3* || die mchmod 0754 /usr/games/quake3/q3ded || die mchmod 0754 /usr/bin/quake3* || die } postinstall() { echo echo "To run Quake3 Arena you must copy some files from the original cds." echo "For Q3 Arena you need to copy pak0.pk3 into /usr/games/quake3/base3q." echo "To play Q3 Team Arena copy pak0.pk3 to /usr/games/quake3/missionpack." echo echo "You need also a keyfile to play quake3, just create a txt-file with the key." echo "Run as root: echo 11223344556677 > /usr/games/quake3/q3key" echo "or as user: echo 11223344556677 > ~/.q3a/q3key" echo }