ut2003-2225-r4.ebuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils games
  5. DESCRIPTION="Sequel to the 1999 Game of the Year multi-player first-person shooter"
  6. HOMEPAGE="http://www.unrealtournament2003.com/"
  7. SRC_URI="ftp://ftp.infogrames.net/misc/ut2003/ut2003lnx_patch2225.tar.tar"
  8. LICENSE="ut2003"
  9. SLOT="0"
  10. KEYWORDS="amd64 x86"
  11. IUSE="dedicated"
  12. RESTRICT="strip"
  13. RDEPEND="
  14. games-fps/ut2003-data
  15. dedicated? ( games-server/ut2003-ded )
  16. !dedicated? ( virtual/opengl[abi_x86_32(-)] )
  17. "
  18. DEPEND=""
  19. S=${WORKDIR}
  20. dir="${GAMES_PREFIX_OPT}/${PN}"
  21. Ddir="${D}/${dir}"
  22. src_unpack() {
  23. unpack ut2003lnx_patch${PV}.tar.tar
  24. }
  25. src_install() {
  26. insinto "${dir}"
  27. games_make_wrapper ut2003 ./ut2003 "${dir}" "${dir}"
  28. make_desktop_entry ut2003 "Unreal Tournament 2003" ut2003
  29. # TODO: change this to use doexe/doins
  30. # this brings our install up to the newest version
  31. cp -r "${S}"/ut2003-lnx-2225/* "${Ddir}" || die
  32. prepgamesdirs
  33. }
  34. pkg_postinst() {
  35. games_pkg_postinst
  36. # here is where we check for the existence of a cdkey...
  37. # if we don't find one, we ask the user for it
  38. if [[ -f "${dir}"/System/cdkey ]] ; then
  39. elog "A cdkey file is already present in ${dir}/System"
  40. else
  41. ewarn "You MUST run this before playing the game:"
  42. ewarn "emerge --config =${CATEGORY}/${PF}"
  43. ewarn "That way you can (re)enter your cdkey."
  44. fi
  45. elog
  46. elog "To play the game run:"
  47. elog " ut2003"
  48. ewarn
  49. ewarn "If you are not installing for the first time and you plan on running"
  50. ewarn "a server, you will probably need to edit your"
  51. ewarn "~/.ut2003/System/UT2003.ini file and add a line that says"
  52. ewarn "AccessControlClass=crashfix.iaccesscontrolini to your"
  53. ewarn "[Engine.GameInfo] section to close a security issue."
  54. }
  55. pkg_postrm() {
  56. ewarn "This package leaves a cdkey file in ${dir}/System that you need"
  57. ewarn "to remove to completely get rid of this game's files."
  58. }
  59. pkg_config() {
  60. ewarn "Your CD key is NOT checked for validity here."
  61. ewarn " Make sure you type it in correctly."
  62. eerror "If you CTRL+C out of this, the game will not run!"
  63. echo
  64. einfo "CD key format is: XXXX-XXXX-XXXX-XXXX"
  65. while true ; do
  66. einfo "Please enter your CD key:"
  67. read CDKEY1
  68. einfo "Please re-enter your CD key:"
  69. read CDKEY2
  70. if [[ "${CDKEY1}" == "" ]] ; then
  71. echo "You entered a blank CD key. Try again."
  72. else
  73. if [[ "${CDKEY1}" == "${CDKEY2}" ]] ; then
  74. echo "${CDKEY1}" | tr a-z A-Z > ${dir}/System/cdkey
  75. einfo "Thank you!"
  76. chown games:games "${dir}"/System/cdkey
  77. break
  78. else
  79. eerror "Your CD key entries do not match. Try again."
  80. fi
  81. fi
  82. done
  83. }