summaryrefslogtreecommitdiff
blob: d6751bd0222444c5877cc8e05463c9bb922b4818 (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
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
# Derived from bug 65084

inherit eutils games
[ "$PV" == "9999" ] && inherit subversion

ESVN_REPO_URI="https://vegastrike.svn.sourceforge.net/svnroot/vegastrike/trunk"
ESVN_PROJECT="vegastrike"
ESVN_BOOTSTRAP="vegastrike/bootstrap-sh"

DESCRIPTION="A 3D space simulator that allows you to trade and bounty hunt"
HOMEPAGE="http://vegastrike.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~x86"
IUSE=""

RDEPEND=""
DEPEND="${RDEPEND}"

S="${WORKDIR}"

pkg_setup() {
	games_pkg_setup
}

src_unpack() {
	cd "${S}"
	local svn=${ESVN_TOP_DIR}

	if ([ ! -d "${svn}/data" ] && [ ! -d "${svn}/data" ]); then
		ESVN_MODULE="data"
		ESVN_MODULE_DIR="${ESVN_REPO_URI}/${ESVN_MODULE}"
		subversion_fetch $ESVN_MODULE_DIR $ESVN_MODULE || die "Fetching data failed"
	fi

	einfo "Copying data to work directory..."
	cp -a "${svn}"/{data} "${S}" >&/dev/null

	cd "${S}"/data
	# Clean up data dir
	esvn_clean "${S}"
	find "${S}" -name "*.pyc" -type f -exec rm -f '{}' \; >&/dev/null

	# Sort out directory references
	sed -i \
		-e "s!/usr/local/share/doc!/usr/share/doc!" \
		-e "s!/usr/local/share/vegastrike!${GAMES_DATADIR}/vegastrike!" \
		-e "s!/usr/local/bin!${GAMES_BINDIR}!" \
		-e "s!/usr/local/lib/man!/usr/share/man!" \
		"${S}/data/documentation/vegastrike.1" \
		|| die "sed data/documentation/vegastrike.1 failed"
}

src_install() {
	doman "${S}"/data/documentation/*.1
	dodoc "${S}"/data/documentation/*.txt

	doicon  "${S}/data/vegastrike.xpm"

	dodir "${GAMES_DATADIR}/vegastrike"
	cp -r data/ "${D}/${GAMES_DATADIR}/vegastrike/" || die "cp failed (data)"

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
}