summaryrefslogtreecommitdiff
blob: 0b14aaf994ae6cab44e90e3dcc69a763c1b34a10 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-rpg/nwn/nwn-1.67.ebuild,v 1.3 2006/09/27 21:01:22 wolf31o2 Exp $

inherit eutils games

UPDATEVER=${PV//.}
PATCH_URL_BASE=http://files.bioware.com/neverwinternights/updates/linux/${UPDATEVER}/
DIALOG_URL_BASE=http://nwdownloads.bioware.com/neverwinternights/patch/dialog/
PACKAGE_NAME=_linuxclient${UPDATEVER}_orig.tar.gz

DESCRIPTION="Neverwinter Nights"
HOMEPAGE="http://nwn.bioware.com/downloads/linuxclient.html"
SRC_URI="http://nwdownloads.bioware.com/neverwinternights/linux/129/nwclient129.tar.gz
	linguas_fr? (
		${PATCH_URL_BASE}French${PACKAGE_NAME}
		${DIALOG_URL_BASE}/french/NWNFrench${PV}dialog.zip
		ftp://jeuxlinux.com/bioware/Neverwinter_Nights/nwfrench129.tar.gz )
	linguas_it? (
		${PATCH_URL_BASE}Italian${PACKAGE_NAME}
		${DIALOG_URL_BASE}/italian/NWNItalian${PV}dialog.zip
		http://nwdownloads.bioware.com/neverwinternights/linux/129/nwitalian129.tar.gz )
	linguas_es? (
		${PATCH_URL_BASE}Spanish${PACKAGE_NAME}
		${DIALOG_URL_BASE}/spanish/NWNSpanish${PV}dialog.zip
		http://nwdownloads.bioware.com/neverwinternights/linux/129/nwspanish129.tar.gz )
	linguas_de? (
	${PATCH_URL_BASE}German${PACKAGE_NAME}
	${DIALOG_URL_BASE}/german/NWNGerman${PV}dialog.zip
	http://xfer06.fileplanet.com/%5E389272944/082003/nwgerman129.tar.gz )
	!linguas_de? ( !linguas_fr? ( !linguas_es? ( !linguas_it? (
		${PATCH_URL_BASE}English${PACKAGE_NAME}
		${DIALOG_URL_BASE}/english/NWNEnglish${PV}dialog.zip ) ) ) )
	nowin? ( http://bsd.mikulas.com/nwresources129.tar.gz
		http://163.22.12.40/FreeBSD/distfiles/nwresources129.tar.gz
		ftp://jeuxlinux.com/bioware/Neverwinter_Nights/nwresources129.tar.gz )
	mirror://gentoo/nwn.png
	http://dev.gentoo.org/~wolf31o2/sources/dump/nwn.png"

LICENSE="NWN-EULA"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="nowin"
RESTRICT="mirror strip"

RDEPEND="virtual/opengl
	>=media-libs/libsdl-1.2.5
	x86? (
		=virtual/libstdc++-3.3
		x11-libs/libXext
		x11-libs/libX11 )
	amd64? (
		app-emulation/emul-linux-x86-baselibs
		app-emulation/emul-linux-x86-compat
		app-emulation/emul-linux-x86-xlibs )"
DEPEND="app-arch/unzip"

S="${WORKDIR}/nwn"
dir="${GAMES_PREFIX_OPT}/${PN}"

pkg_setup() {
#	use nocd && \
#	cdrom_get_cds \
#		Data_Shared.zip \
#		disk2.zip \
#		disk3.zip \
#		disk4.zip
#	elog "To download nwgerman129.tar.gz you need a gamespy account"
	games_pkg_setup
}

src_unpack() {
	mkdir -p "${S}"
	cd "${S}"
	unpack nwclient129.tar.gz
	rm -rf override/*
	# the following is so ugly, please pretend it doesnt exist
	declare -a Aarray=(${A})
	use nowin && if [ "${#Aarray[*]}" == "5" ]
	then
		cd "${WORKDIR}"
		unpack ${Aarray[3]}
		cd "${S}"
	fi
	unpack ${Aarray[1]}
	unpack ${Aarray[2]}
}

src_install() {
	dodir ${GAMES_PREFIX_OPT}
	sed \
		-e "s:GENTOO_USER:${GAMES_USER}:" \
		-e "s:GENTOO_GROUP:${GAMES_GROUP}:" \
		-e "s:GENTOO_DIR:${GAMES_PREFIX_OPT}:" \
		${FILESDIR}/fixinstall > ${WORKDIR}/nwn/fixinstall
	mv ${S} ${D}/${GAMES_PREFIX_OPT}
	doicon ${DISTDIR}/nwn.png
	games_make_wrapper nwn ./nwn "${dir}" "${dir}"
	make_desktop_entry nwn "Neverwinter Nights" nwn.png
	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	if ! use nowin ; then
		elog "The NWN linux client is now installed."
		elog "Proceed with the following steps in order to get it working:"
		elog "1) Copy the following directories/files from your installed and"
		elog "   patched (${PV}) Neverwinter Nights to ${GAMES_PREFIX_OPT}/nwn:"
		elog "    ambient/"
		elog "    data/ (all files except for patch.bif)"
		elog "    dmvault/"
		elog "    hak/"
		elog "    localvault/"
		elog "    modules/"
		elog "    music/"
		elog "    override/"
		elog "    portraits/"
		elog "    saves/"
		elog "    servervault/"
		elog "    texturepacks/"
		elog "    chitin.key"
		elog "2) Chown and chmod the files with the following commands"
		elog "    chown -R ${GAMES_USER}:${GAMES_GROUP} ${GAMES_PREFIX_OPT}/nwn"
		elog "    chmod -R g+rwX ${GAMES_PREFIX_OPT}/nwn"
		elog "3) Run ${GAMES_PREFIX_OPT}/nwn/fixinstall as root"
		elog "4) Make sure that you are in group ${GAMES_GROUP}"
		elog "5) Use ${GAMES_PREFIX_OPT}/nwn/nwn to run the game"
		echo
		elog "Or try emerging with USE=nowin"
	else
		elog "The NWN linux client is now installed."
		elog "Proceed with the following step in order to get it working:"
		elog "Run ${GAMES_PREFIX_OPT}/nwn/fixinstall as root"
	fi
}