Skip to content

Commit

Permalink
games-fps/ut2003: Fix SRC_URI, EAPI 7, fix server, align with UT2004
Browse files Browse the repository at this point in the history
Closes: https://bugs.gentoo.org/715540
Package-Manager: Portage-2.3.96, Repoman-2.3.20
Signed-off-by: James Le Cuirot <[email protected]>
  • Loading branch information
chewi committed Mar 31, 2020
1 parent 7d4ec8f commit 3230345
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 100 deletions.
2 changes: 1 addition & 1 deletion games-fps/ut2003/Manifest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DIST ut2003lnx_patch2225.tar.tar 10039316 BLAKE2B a15398eb2b66606f3e7b1382b01fda6b5d38982bc3fe7065184232eb18a8c85792147187951e810ecb6af738b5f5a15a2e56832d7e91fb21ab8956d699817f76 SHA512 3c44b6254b2b778bf2aca826c710f51db4ec0687c21f1c98e1070f3a9ad7e1a809e741a5b94e20a44c56c60a8b1e4a049788ff5f2a4d581c4eedf3dbbc0da86d
DIST ut2003lnx_patch2225.tar.bz2 10039316 BLAKE2B a15398eb2b66606f3e7b1382b01fda6b5d38982bc3fe7065184232eb18a8c85792147187951e810ecb6af738b5f5a15a2e56832d7e91fb21ab8956d699817f76 SHA512 3c44b6254b2b778bf2aca826c710f51db4ec0687c21f1c98e1070f3a9ad7e1a809e741a5b94e20a44c56c60a8b1e4a049788ff5f2a4d581c4eedf3dbbc0da86d
6 changes: 6 additions & 0 deletions games-fps/ut2003/files/ut2003-ded.confd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# User and group the server should run as.
ut2003_ded_user="nobody"
ut2003_ded_group="nobody"

# Any extra options you want to pass to the server.
ut2003_ded_opts="DM-Antalus"
13 changes: 13 additions & 0 deletions games-fps/ut2003/files/ut2003-ded.initd
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

pidfile="/var/run/${RC_SVCNAME}.pid"
command_background="true"
command_user="${ut2003_ded_user}:${ut2003_ded_group}"
command="ut2003-ded"
command_args="${ut2003_ded_opts}"

depend() {
need net
}
99 changes: 0 additions & 99 deletions games-fps/ut2003/ut2003-2225-r4.ebuild

This file was deleted.

98 changes: 98 additions & 0 deletions games-fps/ut2003/ut2003-2225-r5.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit desktop eutils

DESCRIPTION="Sequel to the 1999 Game of the Year multi-player first-person shooter"
HOMEPAGE="https://en.wikipedia.org/wiki/Unreal_Tournament_2003"
SRC_URI="https://ftp.snt.utwente.nl/pub/games/UT2003/Patches/Linux/${PN}lnx_patch${PV}.tar.bz2"

LICENSE="ut2003"
SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE="dedicated"
RESTRICT="bindist strip"

RDEPEND="
!games-server/ut2003-ded
games-fps/ut2003-data
media-libs/libsdl[abi_x86_32]
sys-libs/glibc
virtual/opengl[abi_x86_32]
"

BDEPEND="app-admin/chrpath"

S="${WORKDIR}/${PN}-lnx-${PV}"
DIR="/opt/${PN}"

QA_PREBUILT="*"

src_prepare() {
default
chrpath -d System/{{ucc,${PN}}-bin,*.so} || die
}

src_install() {
insinto "${DIR}"
doins -r .
fperms +x "${DIR}"/System/{ucc,${PN}}-bin

make_wrapper ${PN} ./${PN}-bin "${DIR}"/System "${DIR}"/System
make_wrapper ${PN}-ded "./ucc-bin server" "${DIR}"/System "${DIR}"/System

make_desktop_entry ${PN} "Unreal Tournament 2003" applications-games

newconfd "${FILESDIR}"/${PN}-ded.confd ${PN}-ded
newinitd "${FILESDIR}"/${PN}-ded.initd ${PN}-ded
}

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}${DIR}/System/cdkey ]] ; then
einfo "A cdkey file is already present in ${EPREFIX}${DIR}/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
ewarn
ewarn "If you are not installing for the first time and you plan on running"
ewarn "a server, you will probably need to edit your"
ewarn "~/.ut2003/System/UT2003.ini file and add a line that says"
ewarn "AccessControlClass=crashfix.iaccesscontrolini to your"
ewarn "[Engine.GameInfo] section to close a security issue."
}

pkg_postrm() {
ewarn "This package leaves a cdkey file in ${EROOT}${DIR}/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!"
echo
einfo "CD key format is: XXXX-XXXX-XXXX-XXXX"
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^^}" > "${EROOT}${DIR}"/System/cdkey || die
einfo "Thank you!"
break
else
eerror "Your CD key entries do not match. Try again."
fi
fi
done
}

0 comments on commit 3230345

Please sign in to comment.