games-fps/ut2004: Port to EAPI 7
authorDavid Seifert <soap@gentoo.org>
Sun, 20 Oct 2019 21:57:18 +0000 (23:57 +0200)
committerJames Le Cuirot <chewi@gentoo.org>
Sun, 27 Oct 2019 23:47:27 +0000 (23:47 +0000)
Closes: https://bugs.gentoo.org/601402
Package-Manager: Portage-2.3.77, Repoman-2.3.17
Signed-off-by: David Seifert <soap@gentoo.org>
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
games-fps/ut2004/ut2004-3369.3-r2.ebuild [moved from games-fps/ut2004/ut2004-3369.3-r1.ebuild with 72% similarity]

similarity index 72%
rename from games-fps/ut2004/ut2004-3369.3-r1.ebuild
rename to games-fps/ut2004/ut2004-3369.3-r2.ebuild
index 1daedb39a999e3199e5285746ae953e7a8fcb815..9a5ffa68ae7190b48433e05479470fc9d1cd9306 100644 (file)
@@ -1,14 +1,16 @@
 # Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
-inherit eutils multilib games
+EAPI=7
+
+inherit desktop eutils
+
+MY_P="${PN}-lnxpatch${PV%.*}-2.tar.bz2"
 
-MY_P="ut2004-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://treefort.icculus.org/${PN}/${MY_P}
+       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"
 
@@ -18,7 +20,8 @@ KEYWORDS="~amd64 ~x86"
 IUSE="dedicated opengl"
 RESTRICT="bindist mirror strip"
 
-UIDEPEND="=virtual/libstdc++-3.3
+UIDEPEND="
+       ~virtual/libstdc++-3.3
        virtual/opengl
        x11-libs/libXext
        x11-libs/libX11
@@ -26,24 +29,27 @@ UIDEPEND="=virtual/libstdc++-3.3
        x11-libs/libXdmcp
        media-libs/libsdl
        media-libs/openal"
-RDEPEND="sys-libs/glibc
+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} ) )"
-DEPEND="app-arch/p7zip"
+BDEPEND="app-arch/p7zip"
 
-S=${WORKDIR}/UT2004-Patch
-dir=${GAMES_PREFIX_OPT}/${PN}
+S="${WORKDIR}/${PN^^}-Patch"
 
 # The executable pages are required #114733
-QA_PREBUILT="${dir:1}/System/ut2004-bin
-       ${dir:1}/System/ucc-bin"
+QA_PREBUILT="
+       /opt/${PN}/System/ut2004-bin
+       /opt/${PN}/System/ucc-bin"
 
 src_prepare() {
-       cd "${S}"/System
+       default
+
+       cd System || die
 
        # These files are owned by ut2004-bonuspack-mega
        rm -f Manifest.in{i,t} Packages.md5 ucc-bin* || die
@@ -54,7 +60,7 @@ src_prepare() {
                rm -f ut2004-bin-linux-amd64 || die
        fi
 
-       cd "${WORKDIR}"/ut2004-ucc-bin-09192008
+       cd "${WORKDIR}"/ut2004-ucc-bin-09192008 || die
        if use amd64 ; then
                mv -f ucc-bin-linux-amd64 "${S}"/System/ucc-bin || die
        else
@@ -67,34 +73,30 @@ src_prepare() {
 }
 
 src_install() {
-       insinto "${dir}"
-       doins -r *
-       fperms +x "${dir}"/System/ucc-bin
+       insinto /opt/${PN}
+       doins -r .
+       fperms +x /opt/${PN}/System/ucc-bin
 
        if use opengl || ! use dedicated ; then
-               fperms +x "${dir}"/System/ut2004-bin
+               fperms +x /opt/${PN}/System/ut2004-bin
 
-               dosym /usr/$(get_libdir)/libopenal.so "${dir}"/System/openal.so
-               dosym /usr/$(get_libdir)/libSDL-1.2.so.0 "${dir}"/System/libSDL-1.2.so.0
+               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
 
-               games_make_wrapper ut2004 ./ut2004 "${dir}" "${dir}"
+               make_wrapper ut2004 ./ut2004 /opt/${PN} /opt/${PN}
                make_desktop_entry ut2004 "Unreal Tournament 2004"
        fi
 
        if use dedicated ; then
-               games_make_wrapper ut2004-ded "./ucc-bin server" "${dir}"/System
+               make_wrapper ut2004-ded "./ucc-bin server" /opt/${PN}/System
        fi
-
-       prepgamesdirs
 }
 
 pkg_postinst() {
-       games_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 ${dir}/System/cdkey ]] ; then
-               einfo "A cdkey file is already present in ${dir}/System"
+       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}"
@@ -110,7 +112,7 @@ pkg_postinst() {
 }
 
 pkg_postrm() {
-       ewarn "This package leaves a cdkey file in ${dir}/System that you need"
+       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."
 }
 
@@ -118,7 +120,7 @@ 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!"
-       echo
+       ewarn
        einfo "CD key format is: XXXXX-XXXXX-XXXXX-XXXXX"
        while true ; do
                einfo "Please enter your CD key:"
@@ -129,7 +131,7 @@ pkg_config() {
                        echo "You entered a blank CD key. Try again."
                else
                        if [[ ${CDKEY1} == ${CDKEY2} ]] ; then
-                               echo "${CDKEY1}" | tr [:lower:] [:upper:] > "${dir}"/System/cdkey
+                               echo "${CDKEY1}" | tr [:lower:] [:upper:] > "${EROOT}"/opt/${PN}/System/cdkey || die
                                einfo "Thank you!"
                                break
                        else