# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games build_n="20060718" distf="${PORTDIR}/distfiles" DESCRIPTION="A port of Duke Nukem 3D original engine on steroids" HOMEPAGE="http://www.eduke3d.com" SRC_URI="mirror://sourceforge/eduke32/eduke32_src_${build_n}.zip mirror://sourceforge/eduke32/txbuild_src_${build_n}.zip" RESTRICT="fetch" LICENSE="" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="" DEPEND=">=media-libs/libsdl-1.2.9 dev-lang/nasm virtual/libstdc++ app-arch/unzip >=x11-libs/gtk+-2.4.0" dn3d="dn3d.zip" destination="${GAMES_PREFIX_OPT}/eduke32" pkg_setup() { if test ! -f "${distf}/${dn3d}"; then ewarn "" ewarn "You must own a legally acquired copy of Duke Nukem 3D to continue." ewarn "If you've got one, please put the zipfile containing the original" ewarn "game into ${distf}/${dn3d}" ewarn "Please note that we don't checksum it, so be careful it's YOU that" ewarn "created the archive!" ewarn "" die "Game archive not available in ${distf}/${dn3d}!" fi games_pkg_setup } src_unpack() { cd "${WORKDIR}" unzip "${distf}/eduke32_src_${build_n}" || die mv eduke32_src_${build_n} duke3d unzip "${distf}/txbuild_src_${build_n}" || die mv txbuild_src_${build_n} build mkdir final unzip -Ld final "${distf}/${dn3d}" || die } src_compile() { cd "${WORKDIR}/duke3d" emake MAKEOPTS="-j 1" || die "Unable to compile eduke32" for i in mapster32{.map,.sym,} eduke32{.map,.sym,}; do cp -v ${i} "${WORKDIR}/final/" || die done } src_install() { insinto "${destination}" cd "${WORKDIR}/final" doins -r * || die "copying data" games_make_wrapper eduke32 ./eduke32 ${destination} games_make_wrapper mapster32 ./mapster32 ${destination} prepgamesdirs # force executable permissions on the two installed programs for i in mapster32 eduke32; do fperms u+rwx,g+rx "${destination}/${i}" done } pkg_postinst() { ewarn "" ewarn "eduke32 is known to have some problems with ATI cards. If you own" ewarn "one of them, please don't report any bug concerning malfunctions," ewarn "since it's an issue known also upstream, and that may be fixed (or" ewarn "not) in future versions of the program." ewarn "" games_pkg_postinst }