summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Santos (javamonger) <daniel.santos@pobox.com>2010-10-21 01:09:22 +0000
committerDaniel Santos (javamonger) <daniel.santos@pobox.com>2010-10-21 01:09:22 +0000
commit97d52a5a2e9aecaa7b92add938dd001e91be6af7 (patch)
treef0a921c11926003a40ccf1ff198a84ca78f55ef5 /games-strategy
parentdev-python/python-cluster: Corrects python problems(PYTHON_MODNAME, bad inher... (diff)
downloadsunrise-97d52a5a2e9aecaa7b92add938dd001e91be6af7.tar.gz
sunrise-97d52a5a2e9aecaa7b92add938dd001e91be6af7.tar.bz2
sunrise-97d52a5a2e9aecaa7b92add938dd001e91be6af7.zip
games-strategy/ moo2: New ebuild for bug #341859.
svn path=/sunrise/; revision=11450
Diffstat (limited to 'games-strategy')
-rw-r--r--games-strategy/moo2/ChangeLog14
-rw-r--r--games-strategy/moo2/Manifest12
-rwxr-xr-xgames-strategy/moo2/files/1.40.24/moo2172
-rw-r--r--games-strategy/moo2/files/1.40.24/moo2rc14
-rwxr-xr-xgames-strategy/moo2/files/1.40.24/utils.sh99
-rw-r--r--games-strategy/moo2/files/DIG.INI10
-rw-r--r--games-strategy/moo2/files/MDI.INI10
-rw-r--r--games-strategy/moo2/files/ORIONCD.INIbin0 -> 50 bytes
-rw-r--r--games-strategy/moo2/files/installList.txt85
-rw-r--r--games-strategy/moo2/metadata.xml10
-rw-r--r--games-strategy/moo2/moo2-1.40.24.ebuild104
11 files changed, 530 insertions, 0 deletions
diff --git a/games-strategy/moo2/ChangeLog b/games-strategy/moo2/ChangeLog
new file mode 100644
index 000000000..db2c957c2
--- /dev/null
+++ b/games-strategy/moo2/ChangeLog
@@ -0,0 +1,14 @@
+# ChangeLog for games-strategy/moo2
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*moo2-1.40.24 (21 Oct 2010)
+
+ 21 Oct 2010; Daniel Santos (dansan) <daniel.santos@pobox.com>
+ +files/1.40.24/moo2, +moo2-1.40.24.ebuild, +files/1.40.24/moo2rc,
+ +files/1.40.24/utils.sh, +files/DIG.INI, +files/MDI.INI,
+ +files/ORIONCD.INI, +files/installList.txt, +metadata.xml:
+ New ebuild for bug #341859. The "Lord Brazen" version is actually labled
+ 1.40b.23, but I'm omitting the "b" as it neither fits in Gentoo's
+ versioning convention or seems to make much sense.
+
diff --git a/games-strategy/moo2/Manifest b/games-strategy/moo2/Manifest
new file mode 100644
index 000000000..6bcf49a4b
--- /dev/null
+++ b/games-strategy/moo2/Manifest
@@ -0,0 +1,12 @@
+AUX 1.40.24/moo2 5419 RMD160 e9b06a86128367bf663c42d33abf8daa6887ab8e SHA1 5c60b0dcebbc51241690f9033efe04145660baf5 SHA256 0dc33351a6ce0e996d80fe23eb4a21c4516bb504d8abc6f9258ad64a1bba7031
+AUX 1.40.24/moo2rc 570 RMD160 f6688234f8f056aed755cd33f74dcf18c366209e SHA1 3efabd165a33ba9297733f0b04c517f48896fb1c SHA256 36c10364aabf86f65207111e21c33e1a8190d5bc92ad8c646a732ebb49268db5
+AUX 1.40.24/utils.sh 2968 RMD160 eb27e65b49c4904354caffe851b325553ba7b381 SHA1 17bb9cfd873a68243ad58d2ad225b56036c93bd9 SHA256 e0d25478dcd13cc67e0787d383f91c46bfeebef7c1946233f776d3d56adeb095
+AUX DIG.INI 207 RMD160 565def1d6423ca19de4723dc45698490352d6f29 SHA1 367e61fd8e4dbec2c8d05a77c5d20747a80e0a1f SHA256 26fa505f40f5fd67275d08d8d5b4cd6eafaebfe17c1736b21746560b490049b6
+AUX MDI.INI 204 RMD160 53d1fd0216335575cf3f5bda288ff77e431ddf53 SHA1 14105c50c5a505f85164397453803523c6874bec SHA256 e6f5a679fd4edfd24c4c3d6b7331383cd13438f5d7d1416dc9c676652474712b
+AUX ORIONCD.INI 50 RMD160 58117d09aafeeb9d2625c7770702035c1d924e84 SHA1 11595b2e64bc5ea0c084224c913dc49366d956f9 SHA256 c35577d83cb314316d078b9957df8dbe88714fb242a4fa8f4fbfa1714d0c19b0
+AUX installList.txt 961 RMD160 547a43e427b1ae70462e78ffeb1414362ff7d399 SHA1 c34cdd4842114317ec052888fe11e2977e45567a SHA256 828657f5c837c28d142d8863838d2d45bf63caa177344e3732651a5065c790d0
+DIST Moo2v140b24.zip 21949 RMD160 246e2efef8b691055c4aac8ab4b09971704091c7 SHA1 19194bf840d394def506c2dfb5ddeabe4a25aa58 SHA256 725b95756f2c5bd284226e6552564e650b04f6a24ea5d049c4d903ae8420ce37
+DIST moo2v131.zip 3429509 RMD160 a975e939e940df9d2144befeecfc160ae67356fa SHA1 d2e2d0cdc59a57afe76381ccb081fa8de6182e64 SHA256 60fff876ad0a68f7750972dda2195c16b04b28ea76db8ecf1f27dd19109f05b5
+EBUILD moo2-1.40.24.ebuild 3174 RMD160 a7eeebc3a30e903ddaa1e73a92b691090b571086 SHA1 6d8b9396f5e0bd09e342d394a47f26a79b5d5ae1 SHA256 d809ba1ef376e04fe135db49ae6ed37abc033ff426c5a9647e8ac935b82b5099
+MISC ChangeLog 431 RMD160 bf1ecfdfaf0128c85e22fd994f2b463cf9d9137e SHA1 e1e9f5dad4cbd13dc14612c999d8b5721cca36ca SHA256 0698ccc885950d9943dc7091a42c69833e7b45616ccb5a4fafc0f8529a5f052c
+MISC metadata.xml 436 RMD160 2ec95e07f53b5f39d67e038414515a03411412cb SHA1 40c17a958db403a24c7a1d46828eaed497817986 SHA256 8e5de5670266bf6316d3f63e42b09e9f8e18b203aa4c4d63120375143fb967e3
diff --git a/games-strategy/moo2/files/1.40.24/moo2 b/games-strategy/moo2/files/1.40.24/moo2
new file mode 100755
index 000000000..8f4880d4d
--- /dev/null
+++ b/games-strategy/moo2/files/1.40.24/moo2
@@ -0,0 +1,172 @@
+#!/bin/bash
+
+# moo2 - Master of Orion II lanuch & user setup script
+# Copyright (C) 2010 Daniel Santos <daniel.santos@pobox.com>
+# $Header: $
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+moo2Dir="__MOO2DIR__"
+moo2UserDir="${HOME}/.moo2"
+configFile="${moo2UserDir}/moo2rc"
+. "${moo2Dir}/utils.sh"
+
+#############################################################################
+# Function : getSeed
+# Arguments : none
+# Description : Generates a signed 32-bit C-style random number.
+#############################################################################
+getSeed() {
+ # $RANDOM is a 15 bit random number so let's use a bunch of them to create
+ # a nasty 32 bit number
+ typeset -i i seed
+ #typeset -i seed
+ for (( i = 0; i < 18; ++i )); do
+ (( seed ^= ${RANDOM} << i ))
+ done
+
+ # Since bash doesn't treat this as a 32-bit C signed int, we have to
+ # convert it. However, we must first make sure the resulting value will
+ # be within INT_MIN and INT_MAX from <limit.h> and compatibile with all C
+ # standards.
+ (( seed ^ 0x7fffffff )) && ((seed &= 0xfffffffe ))
+
+ # Add sign if bit 31 is set
+ (( seed & 0x80000000 )) && echo -e "-\c"
+ echo $(( seed & 0x7fffffff ))
+}
+
+#############################################################################
+# Function : userInstall
+# Arguments : none
+# Description : Performs user-level install. This is only run once (for each
+# user) and does the following:
+# * Creates ${HOME}/.moo2 directory, both contain your config
+# files & serve as the dosbox C drive (jail).
+# * Copies default moo2rc from /opt/moo2/
+# * Generates dosboxrc, tweaks sound values and enables full
+# screen
+# * Creates symlink to /opt/moo2/cd, which will contain a copy
+# of the CD if you installed with USE=nocd, or will yet
+# another symlink to your CD-ROM drive where you had the
+# Orion2 CD when you ran the ebuild).
+# * Performs psudo-install into ${HOME}/.moo2/MPS/ORION2
+# * If you specified USE=lordbrazen, it will also run the
+# unofficial patch which is pretty slow.
+#############################################################################
+userInstall() {
+ getOrCreateUsableDir "${moo2UserDir}" || die
+ cd "${moo2UserDir}" || die
+ ln -s "${moo2Dir}/cd" . || die
+ cp "${moo2Dir}/moo2rc" . || die
+
+ local userMsg="@echo \
+Since this is your first time running Master of Orion II, we need to do some \
+user-level setup. Master of Orion II uses dosbox. See the Welcome box above for\
+help with that."
+
+ # Write the default dosbox config file
+ dosbox -conf /dev/null \
+ -c "${userMsg}" \
+ -c "@pause" \
+ -c "mount c ${moo2UserDir}" \
+ -c "c:" \
+ -c "config -writeconf dosboxrc" \
+ -c "exit"
+
+ sed -i -e 's/fullscreen=.*/fullscreen=true/g' \
+ -e 's/oplrate=.*/oplrate=22050/g' \
+ "${moo2UserDir}/dosboxrc" || die "sed failed"
+
+
+ # Setup the user's game directory
+ local src="${moo2Dir}/MPS/ORION2"
+ local dest="${moo2UserDir}/MPS/ORION2"
+
+ getOrCreateUsableDir "${dest}" || die
+ pushd "${src}" || die
+
+ # Some files cannot be read only and must be copied
+ cp -L SOUND.LBX SR_R* *.INI "${dest}"
+
+ # All the rest can be read-only symlinks
+ for f in *; do
+ test -e "${dest}/$f" || ln -s "${src}/$f" "${dest}" || die
+ done
+
+ popd
+
+ # if lordbrazen patch is installed, then we have to run it (and it's slow)
+ if [ -e "${dest}/MOO2V140.EXE" ]; then
+ dosbox \
+ -c "mount c ${moo2UserDir}" \
+ -c "c:" \
+ -c "cd MPS/ORION2" \
+ -c "MOO2V140.EXE" \
+ -c "exit" || die "dosbox exited with error"
+ fi
+}
+
+#############################################################################
+# Function : main
+# Arguments : none
+# Description : Main function
+#############################################################################
+main() {
+ local postRunMsg=""
+ local postRunCmd=""
+
+ # If this is the 1st time to run, do user setup
+ if [ ! -e "${moo2UserDir}/MPS/ORION2/ORION2.EXE" ]; then
+ userInstall
+ fi
+ . "${configFile}"
+
+ # If we have the unofficial patch specified in the config, but not installed, use the offical
+ # version
+ if [ ! -e "${moo2UserDir}/MPS/ORION2/M2V140.EXE" ]; then
+ moo2exe=ORION2.EXE
+ fi
+
+ # Make sure the CD is still in
+ if [ ! -e "${moo2UserDir}/cd/ORION2.EXE" ]; then
+ # DOS text management is a pain
+ postRunMsg="\
+You're Moo2 CD does not appear to be mounted. You can either put it in, \
+reinstall with the nocd USE option (while the CD in) or change the symlink \
+${moo2UserDir}/cd."
+ fi
+
+ if ((${#postRunMsg})); then
+ postRunCmd="@echo ${postRunMsg}"
+ echo
+ warn ${postRunMsg}
+ echo
+ fi
+
+ # Run the game
+ exec dosbox -conf "${moo2UserDir}/dosboxrc" \
+ -c "mount c ${moo2UserDir}" \
+ -c "c:" \
+ -c "cd MPS/ORION2" \
+ -c "${moo2exe} ${moo2args} /seed=$(getSeed)" \
+ -c "${postRunCmd}" \
+ -c "@pause" \
+ -c "exit" || warn "dosbox exited with error"
+}
+
+main
+
+# vim:ts=4 \ No newline at end of file
diff --git a/games-strategy/moo2/files/1.40.24/moo2rc b/games-strategy/moo2/files/1.40.24/moo2rc
new file mode 100644
index 000000000..db61bcc84
--- /dev/null
+++ b/games-strategy/moo2/files/1.40.24/moo2rc
@@ -0,0 +1,14 @@
+# Base directory to backup saved games to, relative to moo2UserDir (usually ~/.moo2)
+backupDirBase="saved-game-backups"
+
+# Which executable to run. M2V140.EXE is the unofficial, hacked-up executable and ORION2.EXE is
+# the official one
+moo2exe=M2V140.EXE
+#moo2exe=ORION2.EXE
+
+# The arguments to pass. Do not add /seed, as this is randomly generated for you each time. See
+# http://lordbrazen.blogspot.com/2005/01/moo2v140-patch-faq.html for a full list of command-line
+# options
+#moo2args="/picks=10 /hugestart /planets=3 /skipintro /monsters=3"
+moo2args="/picks=10"
+
diff --git a/games-strategy/moo2/files/1.40.24/utils.sh b/games-strategy/moo2/files/1.40.24/utils.sh
new file mode 100755
index 000000000..621a5b326
--- /dev/null
+++ b/games-strategy/moo2/files/1.40.24/utils.sh
@@ -0,0 +1,99 @@
+#!/bin/bash
+
+# utils.sh - Library of general utility functions
+# Copyright (C) 2010 Daniel Santos <daniel.santos@pobox.com>
+# $Header: $
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+#set -o functrace
+#shopt -s extdebug
+
+# Steal pretty colors from /etc/init.d/functions
+eval $(egrep '(GOOD|WARN|BAD|NORMAL|HILITE|BRACKET)=' /etc/init.d/functions.sh)
+
+warn() {
+ echo "${WARN}WARNING${NORMAL}: $*" >&2
+}
+
+die() {
+ echo "${BAD}ERROR${NORMAL}$(test $# -eq 0 || echo ": $*")" >&2
+ backtrace
+ exit 1
+}
+
+assert() {
+ echo "${BAD}Internal Script Error${NORMAL}: $*" >&2
+ backtrace
+ exit 1
+}
+
+#############################################################################
+# Function : backtrace
+# Arguments : none
+# Description : Prints out a cute Bash call stack backtrace. For it to fully
+# function, you must set -o functrace and shopt -s extdebug
+#############################################################################
+backtrace() {
+ typeset -i i frame=0 arg=0
+ while caller $frame > /dev/null; do
+ echo "${HILITE}[${frame}]${NORMAL} $(caller $frame)"
+
+ ((argsInFrame = BASH_ARGC[frame]))
+
+ for ((i = 0; i < argsInFrame; ++i)); do
+ ((arg = totalArgs + argsInFrame - i - 1))
+ echo " ${HILITE}\$$i${NORMAL}: ${BASH_ARGV[${arg}]}"
+ done
+ ((totalArgs += argsInFrame))
+ ((++frame))
+ done
+
+ if set -o|egrep 'functrace.*off' > /dev/null; then
+ echo "backtrace will not work without set -o functrace"
+ fi
+
+ if shopt|egrep 'extdebug.*off' >> /dev/null; then
+ echo "To see parameters in backtraces, use shopt -s extdebug"
+ fi
+}
+
+#############################################################################
+# Function : getOrCreateUsableDir
+# Arguments : directory_name
+# Description : Verifies that directory_name is fully usable (rwx) or creates
+# it.
+#############################################################################
+getOrCreateUsableDir() {
+ (($#)) || assert "getOrCreateUsableDir takes one or more arguments"
+
+ while (($#)); do
+
+ # Make sure no non-directories are in the way
+ test -e "$1" -a ! -d "$1" &&
+ die "A non-directory file named $1 is in the way"
+
+ # Create if missing
+ test -d "$1" || mkdir -p "$1" || die
+
+ # Verify fully usable
+ test -r "$1" || die "No read permissions to $1"
+ test -w "$1" || die "No write premissions to $1"
+ test -x "$1" || die "No execute (browse) premissions to $1"
+ shift
+
+ done
+}
+
+# vim:ts=4 \ No newline at end of file
diff --git a/games-strategy/moo2/files/DIG.INI b/games-strategy/moo2/files/DIG.INI
new file mode 100644
index 000000000..11807d138
--- /dev/null
+++ b/games-strategy/moo2/files/DIG.INI
@@ -0,0 +1,10 @@
+;
+;Miles Design Audio Interface Library V3.02 of 18-Jan-95
+;
+
+DEVICE Creative Labs Sound Blaster 16 or AWE32
+DRIVER SB16.DIG
+IO_ADDR 220h
+IRQ -1
+DMA_8_BIT -1
+DMA_16_BIT -1
diff --git a/games-strategy/moo2/files/MDI.INI b/games-strategy/moo2/files/MDI.INI
new file mode 100644
index 000000000..1fda6d39c
--- /dev/null
+++ b/games-strategy/moo2/files/MDI.INI
@@ -0,0 +1,10 @@
+;
+;Miles Design Audio Interface Library V3.02 of 18-Jan-95
+;
+
+DEVICE Creative Labs Sound Blaster(TM) 16
+DRIVER SBPRO2.MDI
+IO_ADDR 220h
+IRQ -1
+DMA_8_BIT -1
+DMA_16_BIT -1
diff --git a/games-strategy/moo2/files/ORIONCD.INI b/games-strategy/moo2/files/ORIONCD.INI
new file mode 100644
index 000000000..c581a6d5e
--- /dev/null
+++ b/games-strategy/moo2/files/ORIONCD.INI
Binary files differ
diff --git a/games-strategy/moo2/files/installList.txt b/games-strategy/moo2/files/installList.txt
new file mode 100644
index 000000000..ace18ee3d
--- /dev/null
+++ b/games-strategy/moo2/files/installList.txt
@@ -0,0 +1,85 @@
+ADLIBG.MDI
+ADLIB.MDI
+ADRV688.DIG
+AILDRVR.LST
+BEAMS.LBX
+BLDG0.LBX
+BLDG1.LBX
+BLDG2.LBX
+BLDG3.LBX
+BLDG4.LBX
+BLDG5.LBX
+BUFFER0.LBX
+CMBTSFX.LBX
+CMBTSHP.LBX
+COLBLDG.LBX
+COLGCBT.LBX
+COLONY.LBX
+COLROADS.LBX
+COLSUM.LBX
+COLVEGGI.LBX
+COMBAT.LBX
+CONFIRM.LBX
+DESIGN.LBX
+ENGMSG.LBX
+FIREPTS.LBX
+FLEET.LBX
+FLTICONS.LBX
+FONTS.LBX
+GAME.LBX
+HELP.LBX
+INBOX.LBX
+JAMMER.DIG
+LOADSAVE.LBX
+MAINMENU.LBX
+MAINPUPS.LBX
+MONSTER.LBX
+MPU401.MDI
+MT32MPU.MDI
+NDATA.LBX
+NEWGAME.LBX
+NEXTPLYR.LBX
+NULL.MDI
+OCPOL.LBX
+OFFICER.LBX
+OPL3.MDI
+ORION2.EXE
+PAS.MDI
+PASPLUS.MDI
+PCSPKR.MDI
+PLANETS.LBX
+PROAUDIO.DIG
+RACENAME.LBX
+RAP10.DIG
+README.TXT
+REFITPUP.LBX
+RKERNEL.COM
+SAMPLE.AD
+SAMPLE.BNK
+SAMPLE.CAT
+SAMPLE.MT
+SAMPLE.OPL
+SB16.DIG
+SBAWE32.MDI
+SBLASTER.DIG
+SBLASTER.MDI
+SBPRO1.MDI
+SBPRO2.MDI
+SBPRO.DIG
+SETSOUND.EXE
+SHIPS.LBX
+SNDSCAPE.DIG
+SNDSCAPE.MDI
+SOUND.LBX
+SPHERSFX.LBX
+SR_RC_SC.LBX
+SR_RC_SP.LBX
+SR_RC_TR.LBX
+STREAMHD.LBX
+SYSDISP.LBX
+TANDY.MDI
+TEXTBOX.LBX
+TURNSUM.LBX
+ULTRA.DIG
+ULTRA.MDI
+WARNING.LBX
diff --git a/games-strategy/moo2/metadata.xml b/games-strategy/moo2/metadata.xml
new file mode 100644
index 000000000..6a1edac53
--- /dev/null
+++ b/games-strategy/moo2/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer><email>maintainer-wanted@gentoo.org</email></maintainer>
+ <use>
+ <flag name="nocd">Install all files required to run the application without a CD mounted</flag>
+ <flag name="lordbrazen">Installs unofficial patch from lordbrazen.blogspot.com</flag>
+ </use>
+</pkgmetadata>
diff --git a/games-strategy/moo2/moo2-1.40.24.ebuild b/games-strategy/moo2/moo2-1.40.24.ebuild
new file mode 100644
index 000000000..c1b9d546c
--- /dev/null
+++ b/games-strategy/moo2/moo2-1.40.24.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=1
+
+inherit eutils games
+
+OFFICIAL_PATCH="moo2v131.zip"
+LB_PATCH="Moo2v140b24.zip"
+
+DESCRIPTION="A classic 4X turn-based space strategy game"
+HOMEPAGE="http://lordbrazen.blogspot.com"
+SRC_URI="ftp://ftp.infogrames.net/patches/moo2/${OFFICIAL_PATCH}
+ lordbrazen? ( http://www.spheriumnorth.com/blog-images/${LB_PATCH} )"
+
+LICENSE="EULA"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="nocd lordbrazen"
+
+DEPEND=""
+RDEPEND="games-emulation/dosbox"
+
+GAMES_CHECK_LICENSE="yes"
+destDir="${GAMES_PREFIX_OPT}/${PN}"
+
+pkg_setup() {
+ games_pkg_setup
+ cdrom_get_cds ORION2.EXE
+ test -e "${CDROM_ROOT}/ORION2.EXE" || die "CD_ROOT does not point to the Master of Orion 2 CD"
+}
+
+src_unpack() {
+ cd "${WORKDIR}"
+ sed "s:__MOO2DIR__:${destDir}:g" "${FILESDIR}/${PVR}/moo2" > moo2 || die "sed failed"
+
+ # Copy CD or create symlink
+ if use nocd; then
+ # ebuild complains about directx drivers :(
+ #tar cC "${CDROM_ROOT}" . | tar xC cd || die
+ mkdir -p cd || die
+ pushd "${CDROM_ROOT}" > /dev/null || die
+ einfo "Copying CD-ROM..."
+ tar c $(ls -1 | egrep -v 'DIRECTX') | tar xC "${WORKDIR}/cd" ||
+ die "Failed to copy CD-ROM data from ${CDROM_ROOT} to ${WORKDIR}/cd"
+ popd > /dev/null
+ else
+ ln -s "${CDROM_ROOT}" "${WORKDIR}/cd"
+ fi
+
+ # Now we're going to do everything that the normal DOS-based setup program does.
+ mkdir -p MPS/ORION2 || die
+ pushd MPS/ORION2 > /dev/null || die
+
+ # If nocd is specified, we'll take care of this in src_install
+ if ! use nocd; then
+ tar cC "${WORKDIR}/cd" $(cat "${FILESDIR}/installList.txt") | tar x || die
+ fi
+
+ # Apply official 1.31 patch (will overwrite some symlinks if USE=nocd, but that's OK).
+ unpack ${OFFICIAL_PATCH}
+
+ # Install pre-configured .INI files (hardware is simulated, so it's all the same)
+ cp -L "${FILESDIR}/"*.INI . || die
+
+ # Add unofficial patch if use flag set, although it has to be run in dosbox, so it will actually
+ # run the first time the user lanuches the game.
+ if use lordbrazen; then
+ unpack ${LB_PATCH} || die
+ fi
+ popd > /dev/null
+}
+
+src_install() {
+ dogamesbin "${WORKDIR}/moo2" || die
+
+ insinto "${destDir}"
+ doins -r MPS || die "doins failed"
+ doins "${FILESDIR}/${PVR}/"{moo2rc,utils.sh} || die "doins failed"
+
+ if use nocd; then
+ # Copy the CD to disk
+ doins -r cd || die "doins failed"
+
+ # If copying the entire CD to the hard drive anyway, we'll just use hard links to for the
+ # game install (what the DOS-based setup program normally does) except, of course, we wont
+ # overwrite files that have been replaced by a patch.
+ for f in $(cat "${FILESDIR}/installList.txt"); do
+ local src="${destDir}/cd/$f"
+ local dest="${destDir}/MPS/ORION2/$f"
+ if [[ ! -e "${WORKDIR}/MPS/ORION2/$f" ]]; then
+ dosym "${src}" "${dest}" || die "dosym ${src} ${dest} failed"
+ fi
+ done
+ else
+ # Create symlink to the CD. If the user has more than one CD-ROM drive or mount point, this
+ # can break later, but they can just re-install or fix it themselves.
+ ewarn "creating stupid link" "${CDROM_ROOT}" "${destDir}/cd"
+ dosym "${CDROM_ROOT}" "${destDir}/cd" || die
+ fi
+}
+
+# vim:ts=4 \ No newline at end of file