summaryrefslogtreecommitdiff
blob: acc2a7f5a5c71f6a34f7e16b154b2f9398a21f6f (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
93
94
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2

inherit games

DESCRIPTION="Return to Castle Wolfenstein - Long awaited sequel to Wolfenstein 3D"
SRC_URI="ftp://ftp.idsoftware.com/idstuff/wolf/linux/wolf-linux-1.4-full.x86.run
	ftp://3dgamers.in-span.net/pub/3dgamers3/games/returnwolfenstein/wolf-linux-1.4-full.x86.run
	ftp://ftp.idsoftware.com/idstuff/wolf/linux/wolf-linux-update-${PV}.x86.run
	ftp://3dgamers.in-span.net/pub/3dgamers3/games/returnwolfenstein/wolf-linux-update-${PV}.x86.run"

HOMEPAGE="http://games.activision.com/games/wolfenstein/"

LICENSE="RTCW"
SLOT="0"
KEYWORDS="x86"
RESTRICT="nostrip nomirror"
IUSE="opengl dedicated"

DEPEND="virtual/glibc"
RDEPEND="dedicated? ( app-misc/screen )
	!dedicated? ( virtual/opengl )
	opengl? ( virtual/opengl )"

S=${WORKDIR}

pkg_setup() {
	check_license || die "License check failed"
	games_pkg_setup
}

src_unpack() {
	unpack_makeself wolf-linux-1.4-full.x86.run
	unpack_makeself wolf-linux-update-${PV}.x86.run
#	tail +179 ${DISTDIR}/wolf-linux-1.4-full.x86.run | gzip -cd | tar xf - || die "full"
}

src_install() {
	local dir=${GAMES_PREFIX_OPT}/${PN}
	dodir ${dir}

	cp -r main Docs pb ${D}/${dir}/

	exeinto ${dir}
	doexe bin/x86/*.x86 openurl.sh
	if [ "`use dedicated`" ];
	then
		doexe ${FILESDIR}/wolf-ded
		dosed "s:GENTOO_DIR:${dir}:" ${dir}/wolf-ded
		dogamesbin ${FILESDIR}/wolf-ded
		dosed "s:GENTOO_DIR:${dir}:" ${GAMES_BINDIR}/wolf-ded
	fi
	dogamesbin ${FILESDIR}/wolf
	dosed "s:GENTOO_DIR:${dir}:" ${GAMES_BINDIR}/wolf

	if [ "`use dedicated`" ];
	then
		doexe ${FILESDIR}/wolf-ded
		dosed "s:GENTOO_DIR:${dir}:" ${dir}/wolf-ded
		dogamesbin ${FILESDIR}/wolf-ded
		dosed "s:GENTOO_DIR:${dir}:" ${GAMES_BINDIR}/wolf-ded
		exeinto /etc/init.d
		newexe ${FILESDIR}/wolf-ded.rc wolf-ded
		dosed "s:GENTOO_DIR:${dir}:" /etc/init.d/wolf-ded
	fi

	insinto ${dir}
	doins WolfMP.xpm WolfSP.xpm INSTALL QUICKSTART CHANGES RTCW-README-1.4.txt
	insinto /usr/share/pixmaps
	doins WolfMP.xpm

	prepgamesdirs
	make_desktop_entry wolf "Return to Castle Wolfenstein" WolfMP.xpm
}

pkg_postinst() {
	einfo "You need to copy pak0.pk3, mp_pak0.pk3, mp_pak1.pk3, mp_pak2.pk3,"
	einfo "sp_pak1.pk3 and sp_pak2.pk3 from a Window installation into ${dir}/main/"
	echo
	einfo "To play the game run:"
	einfo " wolf"
	if [ "`use dedicated`" ];
	then
		echo
		einfo "To start a dedicated server run:"
		einfo " /etc/init.d/wolf-ded start"
		echo
		einfo "To run the dedicated server at boot, type:"
		einfo " rc-update add wolf-ded default"
		echo
		einfo "The dedicated server is started under the ${GAMES_USER_DED} user account"
	fi
	games_pkg_postinst
}