summaryrefslogtreecommitdiff
path: root/games-rpg/nwn-data
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /games-rpg/nwn-data
reinit the tree, so we can have metadata
Diffstat (limited to 'games-rpg/nwn-data')
-rw-r--r--games-rpg/nwn-data/Manifest11
-rw-r--r--games-rpg/nwn-data/metadata.xml17
-rw-r--r--games-rpg/nwn-data/nwn-data-1.29-r5.ebuild654
3 files changed, 682 insertions, 0 deletions
diff --git a/games-rpg/nwn-data/Manifest b/games-rpg/nwn-data/Manifest
new file mode 100644
index 000000000000..211c41bd8f3e
--- /dev/null
+++ b/games-rpg/nwn-data/Manifest
@@ -0,0 +1,11 @@
+DIST nwclient129.tar.gz 5504342 SHA256 3d75e07f4d44fde789481240d02c07a7a7e0599bc2300d8a73f98f4c752da80e SHA512 79329eb6ed552008170a0306be224dd7c8db7a2b67f4c9749c2fbbc5977a0b058ab7a90a7a063301e9b410d0f5bbb5f91a4ae2f58a8c13586c2881afe2053d43 WHIRLPOOL 00edbec2d0087ed13ae241f78d82ec1f21deb32f61fbd677c03456474f6001e6c7cd3b797a258ef0e201731f25fa786a1bf0581005b4b0a825753a289a4f9799
+DIST nwfrench129.tar.gz 357777520 SHA256 9a5ddcbc8ca443cb5bbcacb76587b171d37441906a1319155bba35f1bfffa9e0 SHA512 bc43da1bd628c88ee9d7c02820d91cc026e36c7531fdf0da6e741dc6b94f1d1d95478e9169b9808368a4e6e0b3a54f3f287063a70fa1ec949f8b7f1e60ce4c7e WHIRLPOOL a0afb51ed3fdcbb37edcc0721b18cce21509d43e270cf0c983b08de55e3e0f05ebfe959b3842bd50178399d7b5d4bd6649dd87953a08a43b1fed733a1ec30407
+DIST nwgerman129.tar.gz 381832822 SHA256 950f730121a90fef2fd5a0810c329a04d1697a7b5f859e240e3307d31050e6e0 SHA512 b817123c5d66ac5420b83355e11bb29756bb2f75a2df8c7667048c6422e4f9c27595121a8bce3d072b027624fb550b65c83f20da96d5edcdb8f7dec822a266e4 WHIRLPOOL 7e30880b7aef31b74a01529a36b7f5b884813773dc617f12efa0f82bc9287c2850ac70c9918835362af93eb45a9afa5b27f2c779c9106abe8f8740f29a6b46d6
+DIST nwitalian129.tar.gz 3926804 SHA256 7a57c45ce2d0a712198dba40ddc2ab4788c817b79c20a6e99733ea842a13f974 SHA512 465728f66e5e3f5d0633408dfb41f0b11308f3b7fc421f512d2c38a3e18db9d2451c552db85a0d7514f9b5c4a76b4745d79eb6a69a2a5a06a16a0b6d050f00c7 WHIRLPOOL cac3325219c541577ee865647a4846c5fb6a4f78f9497fcf0397565b9915c6375246c8b486270c0e644b5ad8634b0c85f311cd5506572385e27fb2c10260b0e4
+DIST nwn.png 4296 SHA256 9703cb47b32d6bf0202198ab490395046d2ef4ffdde22dca91748a966134e139 SHA512 a79cc5e66317b3b0afa190c66d0dab15edf94a8da238e12eb2cbdbfcafa91d950519ad4209f1cb60cc2507120f6c363db18788226d70a77441412567f9b798c6 WHIRLPOOL 2d457ecf6fe85b0fa651f5d4d3bcf8c686aa00113f962cab1dc62cf62789affbd5192fdd0084f7a1cdfdb427a1e8e49aebd18daf8baf76172afe8135d193cd8b
+DIST nwresources129.tar.gz 1212356127 SHA256 4da35c38c63d7cbe40047833103fe0d56f417d1895fb572d52c23a873619f537 SHA512 3a38ee8b192136d9dd2f35c6abd2f3a7bbf711ac6819cb7960c292d5ddae225bd177ff2864e35becd1dfbfaaba8de224d4179c0cf4f0dc0be764e0e9170abc37 WHIRLPOOL d4ae0f294cbfc4a4b0922c82b4022258f212f0d956de4f52b123aff408f9c3e3541d9b8f0efd56890aa2062e8611b750de1347643be88657e9864efd04ebd83f
+DIST nwspanish129.tar.gz 3912516 SHA256 100833e91e3f729a473de3372019e1086aac444f3c90c799af43d16833b7a1ed SHA512 990c626168dc0bff6786760a5f1140ec0226c13d5a35248f27987c475f547f153647a7d6562dcf0c7765e98fa17b2681d1231365d04ad8cc8071740be42110de WHIRLPOOL 8f829b9717567c775bf503299f054d9338d9143711d3ab32a85736e0d4a758dabac942b5b410111dfe744f6e845e2a8932ad9421f1aaee615e21995fb7526e27
+EBUILD nwn-data-1.29-r5.ebuild 20584 SHA256 40582a810f336178bfeb0638cb50ff4b5f4e0529e06e312e4a924ed83c67ca56 SHA512 3695289702c40ea4d7bddf9a6914b3fd164bf58e18af9ae879f31cf30052ea75276924f7efe60fce3e96b95e16a3e9e73542095e8559f0b96a652b4597356387 WHIRLPOOL 3e4b2f06c0ca7452c63ad1d4a12ff1a106bac068434b814012c1406eccc273772384c96782976e79ed3b3344fbb1bfc733a1dcb969606c717a080d0ae3f3b050
+MISC ChangeLog 2435 SHA256 07de6b4a3baf99090fdf0c0a07bca980360566739a7772a855549807090a6bac SHA512 e682a03a82eba0327038b18466d77e0baa7497b41590672db71fe879f8bf29cc90b540194905dbc8e0d234be95e518f43b7e83a624df3202f4238f9f9a3eed9e WHIRLPOOL bab57f5202b8e71473578b005507bc92c3b612369bb3a3685190db34a93e6715cead6abd66710f18eb0dc2233ad7dd06903804a7a0195967b87d5640df6ebbe8
+MISC ChangeLog-2015 8716 SHA256 c073adc4f72df58abc80e72b645eb4a0b752111b094826b533c690ac5964182a SHA512 94a595628eb37fed93270ab8ec9e1db6bf2d3cb839959ad04008d62301ab64b79d42b2abc50fb3a104157373173f6cdff0e5a46661c071a2cf801005be49814c WHIRLPOOL 43b284d91986cf50516b13ce4cd9b57b6bbe6605e813433c7d9af322d6664dd2a4012d52b83795cfff3d660788c0e3610b903bc6c6696e678344006641dce559
+MISC metadata.xml 661 SHA256 e71a981a9745ff94c83c13b41e46b48ba4e5cedb714bcfa031eda0f61d2f0af8 SHA512 6edd2851e2b8ac8a3c1744aa93a921ed44f9cef8329d0766928f81273e40091e96f13abd60606e46afc0f8d7d74690daf4c9867a637a00827088342b0a322497 WHIRLPOOL 379f93411ea9100addfff0e9a3fdac95f348ca6814caa0410edefdb20276a623d4e71f24e3ab39b6de13002d92befa411fb020be1f32c551a53b0a348dde0eda
diff --git a/games-rpg/nwn-data/metadata.xml b/games-rpg/nwn-data/metadata.xml
new file mode 100644
index 000000000000..38a7ce4c43b3
--- /dev/null
+++ b/games-rpg/nwn-data/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>calchan@gentoo.org</email>
+ <name>Denis Dupeyron</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>games@gentoo.org</email>
+ <name>Gentoo Games Project</name>
+ </maintainer>
+ <use>
+ <flag name="hou">Install the Hordes of the Underdark expansion pack</flag>
+ <flag name="nowin">For those people who cant grab the 1.2 gigs of data files from a windows partition</flag>
+ <flag name="sou">Installs the Shadows of Undrentide expension pack</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-rpg/nwn-data/nwn-data-1.29-r5.ebuild b/games-rpg/nwn-data/nwn-data-1.29-r5.ebuild
new file mode 100644
index 000000000000..eda7cf751c8c
--- /dev/null
+++ b/games-rpg/nwn-data/nwn-data-1.29-r5.ebuild
@@ -0,0 +1,654 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+CDROM_OPTIONAL="yes"
+inherit eutils cdrom games
+
+# 3-in-1 DVD - NWN, SoU, HotU (1 disk)
+# Diamond DVD - NWN, SoU, HotU (1 disk)
+# Platinum CD/DVD - NWN, SoU, HotU (4 disks/1 disk)
+# Deluxe CD - NWN, SoU, HotU (5 disks)
+# Gold CD - NWN, SoU (4 disks)
+# Original CD - NWN (1 disk)
+
+LANGUAGES="linguas_fr linguas_it linguas_es linguas_de linguas_en"
+
+MY_PV=${PV//.}
+CLIENT_BASEURL="http://nwdownloads.bioware.com/neverwinternights/linux"
+UPDATE_BASEURL="http://files.bioware.com/neverwinternights/updates/linux"
+
+NOWIN_SRC_URI="${UPDATE_BASEURL}/nwresources${MY_PV}.tar.gz
+ http://bsd.mikulas.com/nwresources${MY_PV}.tar.gz
+ http://163.22.12.40/FreeBSD/distfiles/nwresources${MY_PV}.tar.gz"
+
+LINGUAS_SRC_URI="linguas_fr? (
+ ${UPDATE_BASEURL}/nwfrench${MY_PV}.tar.gz )
+ linguas_it? (
+ ${UPDATE_BASEURL}/nwitalian${MY_PV}.tar.gz )
+ linguas_es? (
+ ${UPDATE_BASEURL}/nwspanish${MY_PV}.tar.gz )
+ linguas_de? (
+ ${UPDATE_BASEURL}/nwgerman${MY_PV}.tar.gz )"
+
+DESCRIPTION="Neverwinter Nights Data Files"
+HOMEPAGE="http://nwn.bioware.com/downloads/linuxclient.html"
+SRC_URI="${CLIENT_BASEURL}/${MY_PV}/nwclient${MY_PV}.tar.gz
+ nowin? ( ${NOWIN_SRC_URI} ${LINGUAS_SRC_URI} )
+ !nowin? ( cdinstall? ( ${LINGUAS_SRC_URI} ) )
+ mirror://gentoo/nwn.png"
+
+LICENSE="NWN-EULA"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="cdinstall hou nowin sou videos ${LANGUAGES}"
+RESTRICT="strip mirror"
+
+RDEPEND=""
+DEPEND="cdinstall? (
+ games-util/biounzip
+ app-arch/unshield )
+ app-arch/unzip
+ app-arch/p7zip
+"
+
+QA_PREBUILT="${GAMES_PREFIX_OPT:1}/nwn/lib/libSDL-1.2.so.0.0.5
+ ${GAMES_PREFIX_OPT:1}/nwn/miles/msssoft.m3d
+ ${GAMES_PREFIX_OPT:1}/nwn/miles/libmss.so.6.5.2
+ ${GAMES_PREFIX_OPT:1}/nwn/miles/mssmp3.asi
+ ${GAMES_PREFIX_OPT:1}/nwn/miles/mssdsp.flt"
+
+S=${WORKDIR}/nwn
+
+dir=${GAMES_PREFIX_OPT}/nwn
+Ddir=${D}/${dir}
+
+NWN_SET=
+
+# This is my fun section where I try to determine which CD/DVD set we have.
+# Expect this to be very messy and ugly, and hopefully it all works as we want
+# it to on all of the various media.
+get_nwn_set() {
+ # First we check to see if we have CD_ROOT defined already. If we do,
+ # this will make our lives so much easier.
+ if [[ -n "${CD_ROOT}" ]]
+ then
+ if [[ -f "${CD_ROOT}"/data5.cab ]]
+ then
+ NWN_SET="3in1_dvd"
+ einfo "Neverwinter Nights 3-in-1 DVD found..."
+ elif [[ -f "${CD_ROOT}"/KingmakerSetup.exe ]]
+ then
+ NWN_SET="diamond_dvd"
+ einfo "Neverwinter Nights Diamond DVD found..."
+ elif [[ -f "${CD_ROOT}"/ArcadeInstallNWNXP213f.EXE ]]
+ then
+ NWN_SET="platinum_cd"
+ einfo "Neverwinter Nights Platinum DVD/CD set found..."
+ elif [[ -f "${CD_ROOT}"/ArcadeInstallNWNXP1_12d.EXE ]]
+ then
+ NWN_SET="gold_cd"
+ einfo "Neverwinter Nights Gold CD set found..."
+ elif [[ -f "${CD_ROOT}"/ArcadeInstallNWN109.exe ]]
+ then
+ NWN_SET="original_cd"
+ einfo "Neverwinter Nights Original/Deluxe CD set found..."
+ fi
+ # Now we check to see if we have CD_ROOT_1 set, which means we have a CD
+ # set, or even a DVD set.
+ elif [[ -n "${CD_ROOT_1}" ]]
+ then
+ if [[ -f "${CD_ROOT_1}"/data5.cab ]]
+ then
+ NWN_SET="3in1_dvd"
+ einfo "Neverwinter Nights 3-in-1 DVD found..."
+ elif [[ -f "${CD_ROOT_1}"/KingmakerSetup.exe ]]
+ then
+ NWN_SET="diamond_dvd"
+ einfo "Neverwinter Nights Diamond DVD found..."
+ elif [[ -f "${CD_ROOT_1}"/ArcadeInstallNWNXP213f.EXE ]]
+ then
+ NWN_SET="platinum_cd"
+ einfo "Neverwinter Nights Platinum DVD/CD set found..."
+ elif [[ -f "${CD_ROOT_1}"/ArcadeInstallNWNXP1_12d.EXE ]]
+ then
+ NWN_SET="gold_cd"
+ einfo "Neverwinter Nights Gold CD set found..."
+ elif [[ -f "${CD_ROOT_1}"/ArcadeInstallNWN109.exe ]]
+ then
+ NWN_SET="original_cd"
+ einfo "Neverwinter Nights Original/Deluxe CD set found..."
+ fi
+ # OK. Neither were set, so now we're going to start our detection and try
+ # to figure out what we have to work from.
+ else
+ local mline=
+ for mline in $(cat /etc/mtab | egrep -e '(iso|cdrom|udf)' | awk '{print $2}')
+ do
+ if [[ -f "${mline}"/data5.cab ]]
+ then
+ NWN_SET="3in1_dvd"
+ einfo "Neverwinter Nights 3-in-1 DVD found..."
+ elif [[ -f "${mline}"/KingmakerSetup.exe ]]
+ then
+ NWN_SET="diamond_dvd"
+ einfo "Neverwinter Nights Diamond DVD found..."
+ elif [[ -f "${mline}"/ArcadeInstallNWNXP213f.EXE ]]
+ then
+ NWN_SET="platinum_cd"
+ einfo "Neverwinter Nights Platinum DVD/CD set found..."
+ elif [[ -f "${mline}"/ArcadeInstallNWNXP1_12d.EXE ]]
+ then
+ NWN_SET="gold_cd"
+ einfo "Neverwinter Nights Gold CD set found..."
+ elif [[ -f "${mline}"/ArcadeInstallNWN109.exe ]]
+ then
+ NWN_SET="original_cd"
+ einfo "Neverwinter Nights Original/Original CD set found..."
+ fi
+ done
+ fi
+}
+
+get_cd_set() {
+ while `[[ -z "${NWN_SET}" ]]`
+ do
+ echo "Please insert your first Neverwinter Nights CD/DVD into your drive and"
+ echo "press any key to continue"
+ read -n 1
+ get_nwn_set
+ done
+ # Here is where we start our CD/DVD detection for changing disks.
+ export CDROM_NAME_1="CD1" CDROM_NAME_2="CD2" CDROM_NAME_3="CD3"
+ case "${NWN_SET}" in
+ 3in1_dvd)
+ einfo "Both Shadows of Undrentide and Hordes of the Underdark will"
+ einfo "be installed from your DVD along with Neverwinter Nights."
+ touch .metadata/sou || die "touch sou"
+ touch .metadata/hou || die "touch hou"
+ touch .metadata/orig || die "touch orig"
+ cdrom_get_cds data5.cab
+ ;;
+ diamond_dvd)
+ einfo "Both Shadows of Undrentide and Hordes of the Underdark will"
+ einfo "be installed from your DVD along with Neverwinter Nights."
+ touch .metadata/sou || die "touch sou"
+ touch .metadata/hou || die "touch hou"
+ touch .metadata/orig || die "touch orig"
+ cdrom_get_cds KingmakerSetup.exe
+ ;;
+ platinum_cd)
+ einfo "Both Shadows of Undrentide and Hordes of the Underdark will"
+ einfo "be installed from your CDs along with Neverwinter Nights."
+ touch .metadata/orig || die "touch orig"
+ touch .metadata/sou || die "touch sou"
+ touch .metadata/hou || die "touching hou"
+ export CDROM_NAME_4="CD4"
+ cdrom_get_cds ArcadeInstallNWNXP213f.EXE \
+ disk2.zip disk3.zip disk4.zip
+ ;;
+ gold_cd)
+ einfo "Shadow of Undrentide will be installed from your CDs along"
+ einfo "with the original Neverwinter Nights. If you have the"
+ einfo "Hordes of the Underdark expansion, it will be installed after."
+ touch .metadata/orig || die "touch orig"
+ touch .metadata/sou || die "touch sou"
+ export CDROM_NAME_4="CD4"
+ if use hou
+ then
+ einfo "You will also need the HoU CD for this installation."
+ export CDROM_NAME_5="HoU"
+ cdrom_get_cds ArcadeInstallNWNXP1_12d.EXE disk2.zip \
+ disk3.zip disk4.zip ArcadeInstallNWNXP213f.EXE
+ else
+ cdrom_get_cds ArcadeInstallNWNXP1_12d.EXE disk2.zip \
+ disk3.zip disk4.zip
+ fi
+ ;;
+ original_cd)
+ einfo "We will be installing the original Neverwinter Nights. If"
+ einfo "you also have the Shadows of Undrentide or Hordes of the"
+ einfo "Underdark expansions, they will be installed afterwards."
+ touch .metadata/orig || die "touch orig"
+ if use sou && use hou
+ then
+ einfo "You will also need the SoU and HoU CDs for this installation."
+ export CDROM_NAME_4="SoU" CDROM_NAME_5="HoU"
+ cdrom_get_cds ArcadeInstallNWN109.exe disk2.bzf \
+ movies/NWNintro.bik NWNSoUInstallGuide.rtf \
+ ArcadeInstallNWNXP213f.EXE
+ elif use sou
+ then
+ einfo "You will also need the SoU CD for this installation."
+ export CDROM_NAME_4="SoU"
+ cdrom_get_cds ArcadeInstallNWN109.exe disk2.bzf \
+ movies/NWNintro.bik NWNSoUInstallGuide.rtf
+ elif use hou
+ then
+ einfo "You will also need the HoU CD for this installation."
+ export CDROM_NAME_4="HoU"
+ cdrom_get_cds ArcadeInstallNWN109.exe disk2.bzf \
+ movies/NWNintro.bik ArcadeInstallNWNXP213f.EXE
+ else
+ cdrom_get_cds ArcadeInstallNWN109.exe disk2.bzf \
+ movies/NWNintro.bik
+ fi
+ ;;
+ esac
+}
+
+src_unpack() {
+ mkdir -p "${S}"
+ cd "${S}"
+ # We create this .metadata directory so we can keep track of what we have
+ # installed without needing to keep all of these multiple USE flags in all
+ # of the ebuilds.
+ mkdir -p .metadata || die "Creating .metadata"
+ # Since we don't *always* want to do this, we check for USE=cdinstall
+ if use cdinstall
+ then
+ # Here, we determine which CD/DVD set that we have. This will seem a
+ # bit odd, since we'll be doing the detection a few times.
+ get_nwn_set
+ # Now that we know what we're looking for, let's look for the media.
+ get_cd_set
+
+ case ${NWN_SET} in
+ 3in1_dvd)
+ mkdir -p "${S}"
+ cd "${S}"
+ einfo "Unpacking files..."
+ # We don't give the user the option to install SoU/HotU. While some
+ # people might complain about this, most newer NWN stuff requires
+ # them both anyway, so it makes no sense not to install them.
+ unshield x "${CDROM_ROOT}"/data1.hdr || die "unpacking"
+ # We have to adjust the files after unpacking the cab file.
+ rm -rf _*
+
+ mv -f App_Executables/{ambient,data,modules,music,texturepacks} .
+ mv -f App_Executables/{dm,local}vault .
+ mv -f App_Executables/*.key .
+ mv -f App_Executables/nwm .
+ if use videos
+ then
+ mv -f App_Executables/movies .
+ fi
+ mkdir -p utils/nwupdateskins/
+ mv -f App_Executables/utils/nwupdateskins/*.bmp utils/nwupdateskins/
+ rm -rf App_Executables/
+ ;;
+ diamond_dvd)
+ # This is probably the simplest NWN to install.
+ mkdir -p "${S}"
+ cd "${S}"
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/Data_Shared.zip || die "unpacking"
+ # I think these are not needed. Can someone verify this?
+# unzip -qo "${CDROM_ROOT}"/Language_data.zip || die "unpacking"
+# unzip -qo "${CDROM_ROOT}"/Language_update.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Data_linux.zip || die "unpacking"
+ # We don't give the user the option to install SoU/HotU. While some
+ # people might complain about this, most newer NWN stuff requires
+ # them both anyway, so it makes no sense not to install them.
+ unzip -qo "${CDROM_ROOT}"/data/XP1.zip
+ unzip -qo "${CDROM_ROOT}"/data/XP2.zip
+ 7z x "${CDROM_ROOT}/KingmakerSetup.exe" -xr0\!*PLUGINSDIR* -xr\!*.exe -xr\!*.dat &> /dev/null || die "unpacking"
+ use videos || rm -rf \$0/movies
+ cp -rf \$0/* ./
+ rm -rf \$0
+ ;;
+ platinum_cd)
+ # This one isn't too bad, either. Luckily, everything is in a ZIP.
+ mkdir -p "${S}"
+ cd "${S}"
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/Data_Shared.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_data.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_update.zip || die "unpacking"
+ unshield x "${CDROM_ROOT}"/data2.cab || die "unpacking"
+ # We have to adjust the files after unpacking the cab file.
+ mkdir -p miles/
+ mkdir -p ambient/
+ mkdir -p utils/nwupdateskins/
+ mv -f NWN_Platinum/Miles/* miles/
+ mv -f NWN_Platinum/ambient/*.wav ambient/
+ mv -f NWN_Platinum/docs .
+ mv -f NWN_Platinum/modules .
+ mv -f NWN_Platinum/nwm .
+ mv -f NWN_Platinum/utils/nwupdateskins/*.bmp utils/nwupdateskins/
+ rm -rf NWN_Platinum/
+ rm -rf _*
+ # If we have the DVD, we're done. If not, we need to switch CDs and
+ # unpack the files on them.
+ if [[ $(du -b "${CDROM_ROOT}"/Data_Shared.zip | awk '{print $1}') -lt 700000000 ]]
+ then
+ cdrom_load_next_cd
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/disk2.zip || die "unpacking"
+ cdrom_load_next_cd
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/disk3.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Data_Linux.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/language_data.zip || die "unpacking"
+ cdrom_load_next_cd
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/disk4.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/xp1.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/xp1_data.zip || die "unpacking"
+ fi
+ ;;
+ gold_cd)
+ # Variety of ZIP's off 4 CD's
+ mkdir -p "${S}"
+ cd "${S}"
+ einfo "Unpacking files..."
+ einfo "Copying files from CD1"
+ cp "${CDROM_ROOT}"/Data_Shared.zip . || die "unpacking"
+ cp "${CDROM_ROOT}"/Language_data.zip . || die "unpacking"
+ cp "${CDROM_ROOT}"/Language_update.zip . || die "unpacking"
+ # Yay cd switching
+ cdrom_load_next_cd
+ unzip -qo "${CDROM_ROOT}"/disk2.zip || die "unpacking"
+ cdrom_load_next_cd
+ unzip -qo "${CDROM_ROOT}"/disk3.zip || die "unpacking"
+ cdrom_load_next_cd
+ unzip -qo "${CDROM_ROOT}"/disk4.zip || die "unpacking"
+ # Amazingly enough, the order of operations matter.
+ unzip -qo "${S}"/Data_Shared.zip || die "unpacking"
+ unzip -qo "${S}"/Language_data.zip || die "unpacking"
+ unzip -qo "${S}"/Language_update.zip || die "unpacking"
+ rm -f Data_Shared.zip
+ rm -f Language_data.zip
+ rm -f Language_update.zip
+ # Expansion pack
+ if use hou
+ then
+ rm -f xp1patch.key data/xp1patch.bif override/*
+ cdrom_load_next_cd
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/Data_Shared.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_data.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_update.zip || die "unpacking"
+ touch .metadata/hou || die "touching hou"
+ fi
+ ;;
+ original_cd)
+ # Now, we need to create our directories, since we know we'll end up
+ # needing them for our install.
+ mkdir -p ambient data dmvault docs lib localvault miles modules \
+ music nwm override texturepacks scripttemplates
+
+ # Handle NWN CD1
+ mkdir "${S}"/disc1_tmp
+ cd "${S}"/disc1_tmp
+ einfo "Unpacking files..."
+ unshield x ${CDROM_ROOT}/data1.cab || die "unpacking files"
+ rm -f miles/Mss32.dll
+ mv -f */* .
+ cd "${S}"
+
+ mv -f disc1_tmp/*.bif data
+ mv -f disc1_tmp/dungeonmaster.bic dmvault
+ mv -f disc1_tmp/*.bic localvault
+ mv -f disc1_tmp/*.{pdf,txt} docs
+ mv -f disc1_tmp/*.erf texturepacks
+ mv -f disc1_tmp/chitin.key .
+ rm -rf disc1_tmp
+
+ # NWN CD2
+ cdrom_load_next_cd
+ biounzip ${CDROM_ROOT}/disk2.bzf . || die "unpacking files"
+
+ # NWN CD3
+ cdrom_load_next_cd
+ einfo "Copying files from cd..."
+ for i in ambient data music
+ do
+ cp ${CDROM_ROOT}/${i}/* "${S}"/${i} || die "error copying data"
+ chmod -x "${S}"/${i}/*
+ done
+ if use videos
+ then
+ mkdir -p "${S}"/movies
+ cp ${CDROM_ROOT}/movies/* "${S}"/movies || die "error copying data"
+ chmod -x "${S}"/movies/*
+ fi
+
+ # Now, we install HoU and SoU, if necessary
+ if use sou
+ then
+ cdrom_load_next_cd
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/Data_Shared.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_data.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_update.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Data_Linux.zip || die "unpacking"
+ touch .metadata/sou || die "touching sou"
+ fi
+ if use hou
+ then
+ cdrom_load_next_cd
+ if use sou && use hou
+ then
+ rm -f xp1patch.key data/xp1patch.bif override/*
+ fi
+ einfo "Unpacking files..."
+ unzip -qo "${CDROM_ROOT}"/Data_Shared.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_data.zip || die "unpacking"
+ unzip -qo "${CDROM_ROOT}"/Language_update.zip || die "unpacking"
+ touch .metadata/hou || die "touching hou"
+ fi
+ ;;
+ esac
+ fi
+ # We unpack this for all media sets.
+ unpack nwclient${MY_PV}.tar.gz
+ if use nowin
+ then
+ if (use sou || use hou) && ! use cdinstall ; then
+ ewarn "If you really want to install SoU and/or HoU, you must"
+ ewarn "emerge with USE=cdinstall."
+ die "SoU and/or HoU require USE=cdinstall."
+ fi
+ cd "${WORKDIR}"
+ unpack nwresources${MY_PV}.tar.gz \
+ || die "unpacking nwresources${MY_PV}.tar.gz"
+ cd "${S}"
+ fi
+
+ rm -rf override/*
+ for a in ${A}
+ do
+ currentlocale=""
+ if [[ -z ${a/*german*/} ]]
+ then
+ currentlocale=de
+ elif [[ -z ${a/*spanish*/} ]]
+ then
+ currentlocale=es
+ elif [[ -z ${a/*italian*/} ]]
+ then
+ currentlocale=it
+ elif [[ -z ${a/*french*/} ]]
+ then
+ currentlocale=fr
+ fi
+ if [[ -n "$currentlocale" ]]
+ then
+ touch ".metadata/linguas_$currentlocale"
+ mkdir -p $currentlocale
+ cd ${currentlocale}
+ unpack ${a} || die "unpacking ${a}"
+ cd ..
+ fi
+ done
+ if use linguas_en
+ then
+ touch ".metadata/linguas_en"
+ fi
+ # These files aren't needed and come from the patches (games-rpg/nwn)
+ rm -f data/patch.bif patch.key
+ rm -f data/xp1patch.bif xp1patch.key
+
+ # Rename nwn.ini to avoid overwriting it every time
+ mv nwn.ini nwn.ini.default
+
+ sed -i -e 's,/bin/sh,/bin/bash,g' -e '\:^./nwmain .*:i \
+'"dir='${dir}';LINGUAS='${LINGUAS}'"';LANG="${LANG/_*}" \
+die() { \
+ echo "$*" 1>&2 \
+ exit 1 \
+} \
+cd "${dir}" || die "cd ${dir}" \
+if [[ -d "$LANG" ]] \
+then \
+ p=${HOME}/.nwn/${LANG} \
+elif [[ -d "en" ]] \
+then \
+ LANG=en \
+ p=${HOME}/.nwn/${LANG} \
+else \
+ LANG="" \
+ p=${HOME}/.nwn \
+ for i in ${LINGUAS} \
+ do \
+ if [ -z "${LANG}" -a -r ".metadata/linguas_$i" -a -d "$i" ] \
+ then \
+ LANG=$i \
+ p=${HOME}/.nwn \
+ fi \
+ done \
+fi \
+mkdir -p "${p}" \
+find "${p}" -type l -delete \
+for i in * ; do \
+ if [[ ! -f ".metadata/linguas_${i}" && ${i: -4} != ".ini" ]] \
+ then \
+ cp -rfs ${dir}/${i} ${p}/. || die "copy ${i}" \
+ fi \
+done \
+if [[ -n "$LANG" ]] \
+then \
+ cd "${LANG}" || die "cd ${LANG}" \
+ for i in * ; do \
+ cp -rfs ${dir}/${LANG}/${i} ${p}/. || die "copy ${LANG}/${i}" \
+ done \
+fi \
+cd "${p}" || die "cd ${p}" \
+if [[ -r ./nwmovies.so ]]; then \
+ export LD_PRELOAD=./nwmovies.so:$LD_PRELOAD \
+ export SDL_AUDIODRIVER=alsa \
+fi \
+if [[ -r ./nwmouse.so ]]; then \
+ export XCURSOR_PATH="$(pwd)" \
+ export XCURSOR_THEME=nwmouse \
+ export LD_PRELOAD=./nwmouse.so:$LD_PRELOAD \
+fi \
+ ' "${S}"/nwn || die "sed nwn"
+}
+
+src_install() {
+ dodir "${dir}"
+ mkdir -p "${S}"/dmvault "${S}"/hak "${S}"/portraits "${S}"/localvault
+ rm -rf "${S}"/dialog*.{tlk,TLK} "${S}"/*/dialog*.{tlk,TLK} \
+ "${S}"/dmclient "${S}"/nwmain "${S}"/nwserver \
+ "${S}"/SDL-1.2.5 "${S}"/fixinstall
+ # Remove the softlink to the built-in SDL library so that we don't have to re-install
+ # this whole thing whenever we need to update to a different custom SDL
+ rm "${S}"/lib/libSDL-1.2.so.0
+ if ! use videos
+ then
+ rm -rf "${S}"/movies/*
+ fi
+ mv "${S}"/* "${Ddir}"
+ mv "${S}"/.metadata "${Ddir}"
+ keepdir "${dir}"/servervault
+ keepdir "${dir}"/scripttemplates
+ keepdir "${dir}"/saves
+ keepdir "${dir}"/portraits
+ keepdir "${dir}"/hak
+ cd "${Ddir}"
+ for d in ambient data dmvault hak localvault movies music override portraits
+ do
+ if [[ -d ${d} ]]
+ then
+ ( cd ${d}
+ for f in $(find . -name '*.*') ; do
+ lcf=$(echo ${f} | tr [:upper:] [:lower:])
+ if [[ ${f} != ${lcf} ]] && [[ -f ${f} ]]
+ then
+ mv ${f} ${lcf}
+ fi
+ done )
+ fi
+ done
+
+ doicon "${DISTDIR}"/nwn.png
+
+ prepgamesdirs
+ chmod -R g+rwX "${Ddir}/saves" "${Ddir}/localvault" "${Ddir}/dmvault" \
+ 2>&1 > /dev/null || die "could not chmod"
+ chmod g+rwX "${Ddir}" || die "could not chmod"
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ if ! use cdinstall && ! use nowin ; then
+ elog "The NWN linux client data 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 (1.68) Neverwinter Nights to ${dir}:"
+ elog " ambient/"
+ elog " data/"
+ elog " dmvault/"
+ elog " hak/"
+ elog " localvault/"
+ elog " modules/"
+ if use videos
+ then
+ elog " movies/"
+ fi
+ elog " music/"
+ elog " portraits/"
+ elog " saves/"
+ elog " servervault/"
+ elog " texturepacks/"
+ elog " chitin.key"
+ elog "2) Remove some files to make way for the patch"
+ elog " rm ${dir}/music/mus_dd_{kingmaker,shadowgua,witchwake}.bmu"
+ elog " rm ${dir}/override/iit_medkit_001.tga"
+ elog " rm ${dir}/data/patch.bif"
+ if use sou
+ then
+ elog " rm ${dir}/xp1patch.key ${dir}/data/xp1patch.bif"
+ fi
+ if use hou
+ then
+ elog " rm ${dir}/xp2patch.key ${dir}/data/xp2patch.bif"
+ fi
+ elog "3) Chown and chmod the files with the following commands"
+ elog " chown -R ${GAMES_USER}:${GAMES_GROUP} ${dir}"
+ elog " chmod -R g+rwX ${dir}"
+ echo
+ elog "Or try emerging with USE=nowin and/or USE=cdinstall."
+ echo
+ else
+ einfo "The NWN linux client data is now installed."
+ echo
+ fi
+ if use cdinstall && ! use nowin ; then
+ ewarn "Some/all demo modules will be missing. You can copy them manually into :"
+ ewarn "${dir}/modules"
+ ewarn "or emerge with USE=nowin."
+ fi
+ if ! use cdinstall && use nowin && use videos
+ then
+ ewarn "Some/all movies will be missing. You can copy them manually into :"
+ ewarn "${dir}/movies"
+ ewarn "or emerge with USE=cdinstall and/or USE=-nowin."
+ fi
+ elog "This is only the data portion, you will also need games-rpg/nwn to"
+ elog "play Neverwinter Nights."
+ echo
+}