summaryrefslogtreecommitdiff
blob: fdd221b7410814e2b13aa490b5f21fff2f525d8d (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
85
86
87
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-action/xshipwars/xshipwars-1.34.0.ebuild,v 1.15 2006/01/28 21:19:10 joshuabaergen Exp $

inherit toolchain-funcs eutils games

MY_P=xsw-${PV}
DESCRIPTION="massively multi-player, ultra graphical, space-oriented gaming system designed exclusively for network play"
HOMEPAGE="http://wolfpack.twu.net/ShipWars/XShipWars/"
SRC_URI="ftp://wolfpack.twu.net/users/wolfpack/${MY_P}.tar.bz2
	ftp://wolfpack.twu.net/users/wolfpack/xswdata-1.33d.tar.bz2
	ftp://wolfpack.twu.net/users/wolfpack/stimages1.7.tar.bz2
	ftp://wolfpack.twu.net/users/wolfpack/babylon5images1.1.tar.bz2
	ftp://wolfpack.twu.net/users/wolfpack/stsounds1.4.tgz"

LICENSE="GPL-2 xshipwars"
SLOT="0"
KEYWORDS="ppc x86"
IUSE=""

RDEPEND="|| ( x11-libs/libXpm virtual/x11 )
	>=media-sound/esound-0.2.23"
DEPEND="${RDEPEND}
	|| ( x11-proto/xextproto virtual/x11 )"

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${MY_P}.tar.bz2
	cd "${S}"
	epatch "${FILESDIR}"/${P}-gcc33.patch
}

src_compile() {
	local makefile

	./configure.client Linux --prefix=/usr || die
	./configure.monitor Linux --prefix=/usr || die
	./configure.server Linux --prefix=${GAMES_PREFIX} || die
	./configure.unvedit Linux --prefix=/usr || die

	[ $(gcc-major-version) == 3 ] && epatch ${FILESDIR}/${P}-gcc3.patch

	for makefile in Makefile.* ; do
		make \
			-f ${makefile} \
			CPPFLAGS="-D__cplusplus -Dc_plusplus ${CFLAGS}" \
			all || die
	done
}

src_install() {
	make -f Makefile.client PREFIX=${D}/usr install || die
	make -f Makefile.monitor PREFIX=${D}/usr install || die
	make -f Makefile.server PREFIX=${D}/${GAMES_PREFIX} install || die
	make -f Makefile.unvedit PREFIX=${D}/usr install || die

	dodir ${GAMES_DATADIR}/${PN}
	tar -jxC ${D}/${GAMES_DATADIR}/${PN} -f ${DISTDIR}/xswdata-1.33d.tar.bz2
	tar -jxC ${D}/${GAMES_DATADIR}/${PN} -f ${DISTDIR}/stimages1.7.tar.bz2
	tar -jxC ${D}/${GAMES_DATADIR}/${PN} -f ${DISTDIR}/babylon5images1.1.tar.bz2
	tar -zxC ${D}/${GAMES_DATADIR}/${PN} -f ${DISTDIR}/stsounds1.4.tgz

	# put the binaries in the right place
	dodir ${GAMES_BINDIR}
	mv ${D}/usr/games/{unvedit,xsw,monitor} ${D}/${GAMES_BINDIR}/

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	echo
	einfo "Before playing, you should get a copy of the installed "
	einfo "global XShipWars client configuration file and copy it to "
	einfo "your home directory: "
	echo
	einfo "# mkdir ~/.shipwars/"
	einfo "# cd /usr/share/games/xshipwars/etc/ "
	einfo "# cp xshipwarsrc ~/.shipwars/xshipwarsrc "
	einfo "# cp universes ~/.shipwars/universes "
	echo
	einfo "You will probably need to edit the xshipwarsrc to fit your needs."
	echo
	einfo "Then type 'xsw &' to start the game"
	echo
}