summaryrefslogtreecommitdiff
blob: 9f3ae080d89a007c6dae368ccbb88a416a4d9ab3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit desktop toolchain-funcs

DATA_PV=1.5
DESCRIPTION="How many tomatoes can you smash in ten short minutes?"
HOMEPAGE="https://tomatoes.sourceforge.net/about.html"
SRC_URI="mirror://sourceforge/tomatoes/tomatoes-linux-src-${PV}.tar.bz2
	mirror://sourceforge/tomatoes/tomatoes-linux-${DATA_PV}.tar.bz2"

LICENSE="ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~ppc64 ~x86"

DEPEND="
	media-libs/libsdl[sound,video]
	media-libs/sdl-image[jpeg,png]
	media-libs/sdl-mixer[mod]
	virtual/opengl
	virtual/glu
"
RDEPEND="
	${DEPEND}
	acct-group/gamestat
"

PATCHES=(
	"${FILESDIR}"/${P}-c_str.patch
	"${FILESDIR}"/${P}-underlink.patch
	"${FILESDIR}"/${P}-gcc43.patch
)

src_prepare() {
	default

	mv ../tomatoes-1.5/* . || die "mv failed"
	mv icon.png ${PN}.png || die

	sed -i \
		-e "/^MPKDIR = /s:./:/usr/share/${PN}/:" \
		-e "/^MUSICDIR = /s:./music/:/usr/share/${PN}/music/:" \
		-e "/^HISCOREDIR = /s:./:/var/games/${PN}/:" \
		-e "/^CONFIGDIR = /s:./:/etc/${PN}/:" \
		-e "/^OVERRIDEDIR = /s:./data/:/usr/share/${PN}/data/:" \
		makefile \
		|| die "sed failed"
}

src_configure() {
	tc-export CXX
}

src_install() {
	dobin tomatoes
	dodoc README README-src

	insinto /usr/share/${PN}
	doins -r tomatoes.mpk music

	doicon ${PN}.png
	make_desktop_entry tomatoes "I Have No Tomatoes"

	dodir /var/games/${PN}
	touch "${ED}"/var/games/${PN}/hiscore.lst || die "touch failed"

	fperms 660 /var/games/${PN}/hiscore.lst
	fowners -R root:gamestat /var/games/${PN} /usr/bin/${PN}
	fperms g+s /usr/bin/${PN}

	insinto /etc/${PN}
	doins config.cfg
}