Advertisement
Guest User

games-puzzle/cogs ebuild

a guest
Jul 22nd, 2012
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.28 KB | None | 0 0
  1. # Copyright 1999-2011 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # $Header: $
  4.  
  5. EAPI=2
  6.  
  7. inherit eutils games versionator
  8.  
  9. MY_PN="Cogs"
  10. DESCRIPTION="An award-winning puzzle game where players build an incredible variety of machines from sliding tiles"
  11. HOMEPAGE="http://www.cogsgame.com/"
  12.  
  13. HIBPAGE="http://www.humblebundle.com"
  14. SRC_URI="${PN}-installer-build$(get_version_component_range 3)"
  15. ZIP_OFFSET="192708"
  16.  
  17. RESTRICT="fetch"
  18. LICENSE=""
  19.  
  20. SLOT="0"
  21. KEYWORDS="amd64 x86"
  22. IUSE=""
  23.  
  24. DEPEND="app-arch/unzip"
  25. RDEPEND="media-libs/libsdl[audio,joystick,video]
  26.      media-libs/openal"
  27.  
  28. S="${WORKDIR}/data"
  29.  
  30. GAMEDIR="${GAMES_PREFIX_OPT}/${PN}"
  31.  
  32. pkg_nofetch() {
  33.     einfo ""
  34.     einfo "Please buy and download \"${SRC_URI}\" from:"
  35.     einfo "  ${HIBPAGE}"
  36.     einfo "and move/link it to \"${DISTDIR}\""
  37.     einfo ""
  38. }
  39.  
  40. src_unpack() {
  41.     tail --bytes=+$(( ${ZIP_OFFSET} + 1 )) "${DISTDIR}/${A}" > "${P}.zip" || die "tail \"${DISTDIR}/${A}\" failed"
  42.     unpack "./${P}.zip" || die "unpack \"${P}\" failed"
  43.     rm -f "${P}.zip" || die "remove \"${P}\" failed"
  44. }
  45.  
  46. src_install() {
  47.     insinto "${GAMEDIR}" || die "insinto \"${GAMEDIR}\" failed"
  48.     doins -r "data" || die "doins \"data\" failed"
  49.  
  50.     exeinto "${GAMEDIR}" || die "exeinto \${GAMEDIR}\" failed"
  51.     if use amd64
  52.     then
  53.         newexe "${MY_PN}-amd64" "${PN}" || die "newexe \"${MY_PN}-amd64\" failed"
  54.     fi
  55.     if use x86
  56.     then
  57.         newexe "${MY_PN}-x86" "${PN}" || die "newexe \"${MY_PN}-x86\" failed"
  58.     fi
  59.  
  60.     # Make game wrapper
  61.     games_make_wrapper "${PN}" "./${PN}" "${GAMEDIR}" || die "games_make_wrapper \"./${PN}\" failed"
  62.  
  63.     # Install icon and desktop file
  64.     doicon "${PN}.png" || die "newicon \"${PN}.png\" failed"
  65.     make_desktop_entry "${PN}" "${MY_PN}" "/usr/share/pixmaps/${PN}.png" || die "make_desktop_entry failed"
  66.  
  67.     # Install documentation
  68.     dodoc *.txt || die "dodoc failed"
  69.  
  70.     # Setting permissions
  71.     prepgamesdirs
  72. }
  73.  
  74. pkg_postinst() {
  75.     echo ""
  76.     games_pkg_postinst
  77.  
  78.     einfo "Please report any bugs here:"
  79.     einfo "   http://bugzilla.icculus.org/"
  80.     einfo "An email list for discussion (not bug reports!) is available here:"
  81.     einfo "   http://icculus.org/mailman/listinfo/${PN}"
  82.     echo ""
  83.     einfo "${MY_PN} savegames and configurations are stored in:"
  84.     einfo "   \${HOME}/.local/share/${MY_PN}"
  85.     echo ""
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement