lbreakout2-2.6.5.ebuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit autotools eutils flag-o-matic gnome2-utils games
  5. levels_V=20141220
  6. themes_V=20141220
  7. DESCRIPTION="Breakout clone written with the SDL library"
  8. HOMEPAGE="http://lgames.sourceforge.net/index.php?project=LBreakout2"
  9. SRC_URI=" mirror://sourceforge/lgames/${P}.tar.gz
  10. mirror://sourceforge/lgames/add-ons/lbreakout2/${PN}-levelsets-${levels_V}.tar.gz
  11. themes? ( mirror://sourceforge/lgames/add-ons/lbreakout2/${PN}-themes-${levels_V}.tar.gz )"
  12. LICENSE="GPL-2"
  13. SLOT="0"
  14. KEYWORDS="amd64 ppc x86 ~x86-fbsd"
  15. IUSE="nls themes"
  16. RDEPEND="media-libs/libpng:0
  17. sys-libs/zlib
  18. media-libs/libsdl[sound,joystick,video]
  19. media-libs/sdl-net
  20. media-libs/sdl-mixer
  21. nls? ( virtual/libintl )"
  22. DEPEND="${RDEPEND}
  23. nls? ( sys-devel/gettext )"
  24. src_unpack() {
  25. unpack ${P}.tar.gz
  26. cd "${S}/client/levels"
  27. unpack ${PN}-levelsets-${levels_V}.tar.gz
  28. if use themes ; then
  29. mkdir "${WORKDIR}/themes"
  30. cd "${WORKDIR}/themes"
  31. unpack ${PN}-themes-${themes_V}.tar.gz
  32. # Delete a few duplicate themes (already shipped with lbreakout2
  33. # tarball). Some of them have different case than built-in themes, so it
  34. # is harder to just compare if the filename is the same.
  35. rm -f absoluteB.zip oz.zip moiree.zip
  36. for f in *.zip; do
  37. unzip -q "$f" && rm -f "$f" || die
  38. done
  39. fi
  40. }
  41. src_prepare() {
  42. epatch "${FILESDIR}"/${P}-gentoo.patch
  43. eautoreconf
  44. }
  45. src_configure() {
  46. filter-flags -O?
  47. egamesconf \
  48. --enable-sdl-net \
  49. --localedir=/usr/share/locale \
  50. --with-docdir="/usr/share/doc/${PF}/html" \
  51. $(use_enable nls)
  52. }
  53. src_install() {
  54. default
  55. if use themes ; then
  56. insinto "${GAMES_DATADIR}/lbreakout2/gfx"
  57. doins -r "${WORKDIR}/themes/"*
  58. fi
  59. newicon client/gfx/win_icon.png ${PN}.png
  60. newicon -s 32 client/gfx/win_icon.png ${PN}.png
  61. make_desktop_entry lbreakout2 LBreakout2
  62. prepgamesdirs
  63. }
  64. pkg_preinst() {
  65. games_pkg_preinst
  66. gnome2_icon_savelist
  67. }
  68. pkg_postinst() {
  69. games_pkg_postinst
  70. gnome2_icon_cache_update
  71. }
  72. pkg_postrm() {
  73. gnome2_icon_cache_update
  74. }