summaryrefslogtreecommitdiff
path: root/games-strategy/gratitious-space-battles/gratitious-space-battles-1.56.0.ebuild
blob: 8c356e16e20397b542c80626622671d86c11d0c3 (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
76
77
78
79
80
81
82
83
84
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header:  $

EAPI=2
inherit eutils games

MY_PN="GSB"
MY_VER="1324679796"
MY_ARCH="${ARCH/amd64/x86_64}"

DESCRIPTION="a space battle strategy game focusing on ship-to-ship combat"
HOMEPAGE="http://www.positech.co.uk/gratuitousspacebattles/"
SRC_URI="gsb${MY_VER}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="-* amd64 ~x86"
IUSE="doc"
RESTRICT="fetch"

RDEPEND="app-arch/bzip2
	app-arch/xz-utils
	dev-libs/expat
	media-libs/fontconfig
	virtual/jpeg:0
	media-libs/libpng:1.2
	media-libs/libvorbis
	media-libs/openal
	media-libs/sdl-image
	media-libs/tiff
	net-dns/libidn
	virtual/opengl
	x11-libs/libXext
	x11-libs/libXft
	x11-libs/libxcb"
DEPEND=""

S=${WORKDIR}/${MY_PN}

GAMEDIR=${GAMES_PREFIX_OPT}/${PN}

pkg_nofetch() {
	elog "Please purchase and download '${SRC_URI}'"
	elog "then copy to: '${DISTDIR}'"
	echo
}

src_install() {
	insinto "${GAMEDIR}"
	exeinto "${GAMEDIR}"

	# install game files
	doins -r data || die "install data failed"
	newexe ${MY_PN}.bin.${MY_ARCH} ${MY_PN}.bin || die "install bin failed"

	# install necessary budled libraries
	[ "$ARCH" == "amd64" ] && LIBDIR=lib64 || LIBDIR=lib
	exeinto "${GAMEDIR}/${LIBDIR}"
	# curl - this version is older than Gentoo stable
	# sdl_image - system version linked against newer PNG/JPEG; will crash
	doexe ${LIBDIR}/{libcurl.so.3,libSDL_image-1.2.so.0} \
		|| die "install libs failed"

	# install documentation
	dodoc README.linux || die "install required doc failed"
	if use doc; then
		dodoc GSBManual.pdf || die "install optional doc failed"
	fi

	# install shortcuts
	newicon ${MY_PN}.png ${PN}.png || die "install icon failed"
	games_make_wrapper ${PN} ./${MY_PN}.bin "${GAMEDIR}" \
		|| die "install wrapper failed"
	make_desktop_entry ${PN} "Gratuitous Space Battles" \
		|| die "install shortcut failed"
	prepgamesdirs
}

pkg_postinst() {
	einfo "To play the game, run:"
	einfo "${PN}"
	games_pkg_postinst
}