summaryrefslogtreecommitdiff
blob: dd8448d76abf0d5a626eb18f845f6233ea2d4cd1 (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
88
89
90
91
92
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-strategy/ufo2000/ufo2000-0.6.627.ebuild,v 1.7 2006/05/31 22:00:45 wolf31o2 Exp $

inherit games

DESCRIPTION="Free multiplayer remake of X-COM (UFO: Enemy Unknown)"
HOMEPAGE="http://ufo2000.sourceforge.net/"
SRC_URI="http://ufo2000.lxnt.info/files/${P}-src.tar.bz2
	ftp://ftp.microprose.com/pub/mps-online/x-com/xcomdemo.zip
	ftp://ftp.microprose.com/pub/mps-online/demos/terror.zip
	vorbis? ( http://ufo2000.lxnt.info/files/ufo2000-music-20041222.zip )"

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

RDEPEND="virtual/libc
	dev-libs/expat
	>=dev-games/hawknl-1.66
	>=media-libs/allegro-4.0.0
	vorbis? ( ~media-libs/aldumb-0.9.2
		~media-libs/dumb-0.9.2
		media-libs/libogg
		media-libs/libvorbis )"
DEPEND="${RDEPEND}
	app-arch/unzip"

src_unpack() {
	unpack ${P}-src.tar.bz2

	cd "${S}/XCOMDEMO"
	unpack xcomdemo.zip
	unzip -qLL XCOM.EXE -d .. || die "unzip failed"
	rm XCOM.EXE
	mv ../xcomdemo/* "${S}/XCOMDEMO/" || die "mv failed"

	cd "${S}/TFTDDEMO"
	unpack terror.zip
	unzip -qLL TFTD.ZIP || die "unzip failed"
	rm TFTD.ZIP

	if use vorbis ; then
		cd "${S}/newmusic"
		unpack ufo2000-music-20041222.zip
	fi
	cd "${S}"
	epatch "${FILESDIR}/${P}"-gcc41.patch
}

src_compile() {
	local myconf

	use vorbis && myconf="dumbogg=1"

	emake \
		DATA_DIR="${GAMES_DATADIR}/${PN}" \
		OPTFLAGS="${CXXFLAGS}" \
		${myconf} \
		|| die "emake failed"
}

src_install() {
	dogamesbin ufo2000 || die "dogamesbin failed"
	dodir "${GAMES_DATADIR}/${PN}"
	cp -R arts newmaps newmusic newunits init-scripts script \
		XCOMDEMO XCOM TFTDDEMO TFTD translations \
		*.dat ufo2000.default.ini soundmap.xml \
			"${D}/${GAMES_DATADIR}/${PN}" \
				|| die "cp failed"
	keepdir "${GAMES_DATADIR}/${PN}/newmusic"
	echo "Please copy data files from X-COM here" > \
		"${D}/${GAMES_DATADIR}/${PN}/XCOM/readme.txt"
	echo "Please copy data files from TFTD here" > \
		"${D}/${GAMES_DATADIR}/${PN}/TFTD/readme.txt"
	dodoc *.txt AUTHORS ChangeLog || die "dodoc failed"
	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	einfo "If you have a full version of X-COM, you can copy all the files"
	einfo "from the directory where you have it installed into:"
	einfo "   ${GAMES_DATADIR}/${PN}/XCOM"
	echo
	einfo "Likewise for Terror From The Deep, but to the directory:"
	einfo "   ${GAMES_DATADIR}/${PN}/TFTD"
	echo
	einfo "This will allow you to use more terrain types and units."
	echo
}