diff options
Diffstat (limited to 'games-fps/ut2004/ut2004-3369.3-r2.ebuild')
-rw-r--r-- | games-fps/ut2004/ut2004-3369.3-r2.ebuild | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/games-fps/ut2004/ut2004-3369.3-r2.ebuild b/games-fps/ut2004/ut2004-3369.3-r2.ebuild new file mode 100644 index 000000000000..9a5ffa68ae71 --- /dev/null +++ b/games-fps/ut2004/ut2004-3369.3-r2.ebuild @@ -0,0 +1,142 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit desktop eutils + +MY_P="${PN}-lnxpatch${PV%.*}-2.tar.bz2" + +DESCRIPTION="Editor's Choice Edition plus Mega Pack for the well-known first-person shooter" +HOMEPAGE="http://www.unrealtournament2004.com/" +SRC_URI=" + http://ut2004.ut-files.com/index.php?dir=Patches/Linux/&file=${MY_P} -> ${MY_P} + http://storage.guntoo.de/downs/downloads/Patch/ut2004-v${PV/./-}-linux-dedicated.7z + mirror://gentoo/ut2004-v${PV/./-}-linux-dedicated.7z" + +LICENSE="ut2003" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="dedicated opengl" +RESTRICT="bindist mirror strip" + +UIDEPEND=" + ~virtual/libstdc++-3.3 + virtual/opengl + x11-libs/libXext + x11-libs/libX11 + x11-libs/libXau + x11-libs/libXdmcp + media-libs/libsdl + media-libs/openal" +RDEPEND=" + sys-libs/glibc + games-fps/ut2004-data + games-fps/ut2004-bonuspack-ece + games-fps/ut2004-bonuspack-mega + dedicated? ( !games-server/ut2004-ded ) + opengl? ( ${UIDEPEND} ) + !dedicated? ( !opengl? ( ${UIDEPEND} ) )" +BDEPEND="app-arch/p7zip" + +S="${WORKDIR}/${PN^^}-Patch" + +# The executable pages are required #114733 +QA_PREBUILT=" + /opt/${PN}/System/ut2004-bin + /opt/${PN}/System/ucc-bin" + +src_prepare() { + default + + cd System || die + + # These files are owned by ut2004-bonuspack-mega + rm -f Manifest.in{i,t} Packages.md5 ucc-bin* || die + + if use amd64 ; then + mv -f ut2004-bin-linux-amd64 ut2004-bin || die + else + rm -f ut2004-bin-linux-amd64 || die + fi + + cd "${WORKDIR}"/ut2004-ucc-bin-09192008 || die + if use amd64 ; then + mv -f ucc-bin-linux-amd64 "${S}"/System/ucc-bin || die + else + mv -f ucc-bin "${S}"/System/ || die + fi + + if use dedicated && ! use opengl ; then + rm -f "${S}"/System/ut2004-bin || die + fi +} + +src_install() { + insinto /opt/${PN} + doins -r . + fperms +x /opt/${PN}/System/ucc-bin + + if use opengl || ! use dedicated ; then + fperms +x /opt/${PN}/System/ut2004-bin + + dosym ../../../usr/$(get_libdir)/libopenal.so /opt/${PN}/System/openal.so + dosym ../../../usr/$(get_libdir)/libSDL-1.2.so.0 /opt/${PN}/System/libSDL-1.2.so.0 + + make_wrapper ut2004 ./ut2004 /opt/${PN} /opt/${PN} + make_desktop_entry ut2004 "Unreal Tournament 2004" + fi + + if use dedicated ; then + make_wrapper ut2004-ded "./ucc-bin server" /opt/${PN}/System + fi +} + +pkg_postinst() { + # Here is where we check for the existence of a cdkey... + # If we don't find one, we ask the user for it + if [[ -f "${EROOT}"/opt/${PN}/System/cdkey ]] ; then + einfo "A cdkey file is already present in /opt/${PN}/System" + else + ewarn "You MUST run this before playing the game:" + ewarn "emerge --config =${CATEGORY}/${PF}" + ewarn "That way you can [re]enter your cdkey." + fi + elog "Starting with 3369, the game supports render-to-texture. To enable" + elog "it, you will need the Nvidia drivers of at least version 7676 and" + elog "you should edit the following:" + elog 'Set "UseRenderTargets=True" in the "[OpenGLDrv.OpenGLRenderDevice]"' + elog 'section of your UT2004.ini or Default.ini and set "bPlayerShadows=True"' + elog 'and "bBlobShadow=False" in the "[UnrealGame.UnrealPawn]" section of' + elog 'your User.ini or DefUser.ini.' +} + +pkg_postrm() { + ewarn "This package leaves a cdkey file in ${EROOT}/opt/${PN}/System that you need" + ewarn "to remove to completely get rid of this game's files." +} + +pkg_config() { + ewarn "Your CD key is NOT checked for validity here so" + ewarn "make sure you type it in correctly." + ewarn "If you CTRL+C out of this, the game will not run!" + ewarn + einfo "CD key format is: XXXXX-XXXXX-XXXXX-XXXXX" + while true ; do + einfo "Please enter your CD key:" + read CDKEY1 + einfo "Please re-enter your CD key:" + read CDKEY2 + if [[ -z ${CDKEY1} ]] || [[ -z ${CDKEY2} ]] ; then + echo "You entered a blank CD key. Try again." + else + if [[ ${CDKEY1} == ${CDKEY2} ]] ; then + echo "${CDKEY1}" | tr [:lower:] [:upper:] > "${EROOT}"/opt/${PN}/System/cdkey || die + einfo "Thank you!" + break + else + eerror "Your CD key entries do not match. Try again." + fi + fi + done +} |