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