games-server/nwn-ded: update Manifest
[gentoo.git] / games-server / nwn-ded / nwn-ded-1.69-r1.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit eutils
6
7 LANGUAGES="linguas_en"
8 DIALOG_URL_BASE=http://files.bioware.com/neverwinternights/dialog/
9
10 DESCRIPTION="Neverwinter Nights Dedicated server"
11 HOMEPAGE="http://nwn.bioware.com/downloads/standaloneserver.html"
12 SRC_URI="http://files.bioware.com/neverwinternights/updates/windows/server/NWNDedicatedServer${PV}.zip
13         linguas_en? ( ${DIALOG_URL_BASE}/english/NWNEnglish${PV}dialog.zip )"
14
15 LICENSE="NWN-EULA"
16 SLOT="0"
17 KEYWORDS="-* ~amd64 ~x86"
18 IUSE="${LANGUAGES}"
19 RESTRICT="mirror strip"
20
21 DEPEND="app-arch/unzip"
22
23 S=${WORKDIR}
24
25 dir="/opt/${PN}"
26 QA_PREBUILT="${dir:1}/common/nwserver"
27
28 src_unpack() {
29         mkdir common || die
30         cd common || die
31         unpack NWNDedicatedServer${PV}.zip
32         tar -zxf linuxdedserver${PV/./}.tar.gz || die
33         rm -f *dedserver*.{tar.gz,sit,zip} *.exe *.dll || die
34         cd ..
35         local currentlocale=""
36         local a
37         for a in ${A}
38         do
39                 if [ -z "${a/*dialog*/}" ] ; then
40                         if [ -z "${a/*English*/}" ]; then currentlocale="en"; fi
41                         if [ -z "${a/*French*/}" ]; then currentlocale="fr"; fi
42                         if [ -z "${a/*German*/}" ]; then currentlocale="de"; fi
43                         if [ -z "${a/*Italian*/}" ]; then currentlocale="it"; fi
44                         if [ -z "${a/*Spanish*/}" ]; then currentlocale="es"; fi
45                         if [ -z "${a/*Japanese*/}" ]; then currentlocale="ja"; fi
46                         mkdir ${currentlocale} || die
47                         cd ${currentlocale} || die
48                         cp -rfl ../common/* . || die
49                         unpack "${a}"
50                         cd ..
51                 fi
52         done
53 }
54
55 src_install() {
56         dodir ${dir}
57
58         local currentlocale
59         for currentlocale in * ; do
60                 if [[ ${currentlocale} != "common" ]]
61                 then
62                         make_wrapper nwserver-${currentlocale} ./nwserver "${dir}/${currentlocale}" "${dir}/${currentlocale}"
63                 fi
64         done
65
66         mv * "${D}/${dir}"/ || die
67
68         chmod -R g+w "${D}/${dir}"
69 }