summaryrefslogtreecommitdiff
blob: bf3226f22cdab27874e604d7a2b7d371261d1873 (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
# Copyright 1999-2004 Gentoo Technologies, Inc.
# 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.5 2004/03/31 03:35:27 mr_bones_ Exp $

inherit gcc eutils games

MY_P=xsw-${PV}
S="${WORKDIR}/${MY_P}"
DESCRIPTION="massively multi-player, ultra graphical, space-oriented gaming system designed exclusively for network play"
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"
HOMEPAGE="http://wolfpack.twu.net/ShipWars/XShipWars/"

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

DEPEND="virtual/glibc
	>=media-sound/esound-0.2.23
	virtual/x11"

src_unpack() {
	unpack ${MY_P}.tar.bz2
}

src_compile() {
	./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.bz
	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() {
	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
}