aboutsummaryrefslogtreecommitdiff
path: root/games/HeroesOfMightAndMagic/scripts
diff options
context:
space:
mode:
authorDmitry Sivachenko <demon@FreeBSD.org>2001-03-07 11:35:58 +0000
committerDmitry Sivachenko <demon@FreeBSD.org>2001-03-07 11:35:58 +0000
commit2047f690740c126aa65c762f184a146c9c336ad9 (patch)
tree91ec04d3517528ae0b484a2c8323b12d635221b3 /games/HeroesOfMightAndMagic/scripts
parent0aaeab888ea16b44fcd6c824a8a0632d3a856db8 (diff)
downloadports-2047f690740c126aa65c762f184a146c9c336ad9.tar.gz
ports-2047f690740c126aa65c762f184a146c9c336ad9.zip
Notes
Diffstat (limited to 'games/HeroesOfMightAndMagic/scripts')
-rw-r--r--games/HeroesOfMightAndMagic/scripts/configure56
-rw-r--r--games/HeroesOfMightAndMagic/scripts/do-install109
2 files changed, 165 insertions, 0 deletions
diff --git a/games/HeroesOfMightAndMagic/scripts/configure b/games/HeroesOfMightAndMagic/scripts/configure
new file mode 100644
index 000000000000..b23b90c2e439
--- /dev/null
+++ b/games/HeroesOfMightAndMagic/scripts/configure
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Gently borrowed code from x11/XFree86-4
+
+yesno () {
+ answ=X
+ while [ $answ = X ]; do
+ echo -n "$2 [$1] "
+ read answ
+ if [ X$answ = X ]; then answ=$1; fi
+ case $answ in
+ y|yes|Y|YES) answ=YES;;
+ n|no|N|NO) answ=NO;;
+ *) echo invalid answer
+ answ=X
+ ;;
+ esac
+ done
+}
+
+question() {
+ echo -n "$2 [$1] "
+ read answ
+ if [ X$answ = X ]; then answ=$1; fi
+}
+
+F=$WRKDIR/.config
+rm -f $F
+
+cat <<EOF
+Welcome to the Heroes of Might And Magic 3 installer.
+You may now choose to install parts of the distribution on disk.
+If you choose not to install a part, I will make a link to the CDROM
+so you will have them in case you have your CD mounted while you play.
+You must have your CDROM mounted right now.
+
+EOF
+question /cdrom "Where is your CD mounted?"
+if [ ! -f $answ/Heroes_III_Tutorial.pdf ] ; then
+ echo "Might and Magic III CD not found. Please mount the CD and retry."
+ exit 1
+fi
+echo CD=$answ >> $F
+echo "Do you want to install the Basis game packet?"
+yesno YES "Without this you can't play without CD. (112 MB) "
+echo BASIC=$answ >> $F
+echo "Do you want to install the Graphic packet?"
+yesno YES "Without this you can't play without CD. (14 MB) "
+echo GRAPHIC=$answ >> $F
+yesno YES "Do you want to install the Scenarios (1 MB) "
+echo SCENARIO=$answ >> $F
+yesno NO "Do you want to install Music (64 MB) "
+echo MUSIC=$answ >> $F
+yesno NO "Do you want to install Videos (137 MB) "
+echo VIDEOS=$answ >> $F
+
+exit 0
diff --git a/games/HeroesOfMightAndMagic/scripts/do-install b/games/HeroesOfMightAndMagic/scripts/do-install
new file mode 100644
index 000000000000..7b17e5a55ce3
--- /dev/null
+++ b/games/HeroesOfMightAndMagic/scripts/do-install
@@ -0,0 +1,109 @@
+#!/bin/sh
+
+F=$WRKDIR/.config
+
+. $F
+GAMESUBDIR=games/Heroes3
+GAMEDIR=${LOCALBASE}/${GAMESUBDIR}
+
+if [ ! -f ${CD}/Heroes_III_Tutorial.pdf ] ; then
+ echo Might and Magic III CD not found in ${CD}. Please mount the CD
+ echo And retry. If you want to specify another CDROM mount point,
+ echo rerun the configure script.
+ exit 1
+fi
+
+# Base installation
+echo Base installation
+mkdir -p ${GAMEDIR}/data
+${INSTALL_DATA} ${CD}/README ${CD}/Heroes_III_Tutorial.pdf ${GAMEDIR}
+${INSTALL_DATA} ${CD}/icon.bmp ${CD}/icon.xpm ${GAMEDIR}
+
+# INSTALL_PROGRAM (its parameter -s) currupts the file. Using cp.
+cp ${CD}/bin/x86/heroes3 ${GAMEDIR}
+brandelf -t Linux ${GAMEDIR}/heroes3
+ln -sf ${GAMEDIR}/heroes3 ${LOCALBASE}/bin/heroes3
+touch ${GAMEDIR}/data/hiscore.dat
+chmod 666 ${GAMEDIR}/data/hiscore.dat
+cat ${PKGDIR}/files/pkg-plist.base > ${PLIST}
+
+# Basis packet
+if [ $BASIC = YES ]; then
+ echo Installing Basic packet
+ mkdir -p ${GAMEDIR}/data
+ ${INSTALL_DATA} ${CD}/data/*.lod ${CD}/data/*.snd ${GAMEDIR}/data
+else
+ for file in h3bitmap.lod h3sprite.lod heroes3.snd heroes3cd.snd; do
+ ln -sf ${CD}/data/${file} ${GAMEDIR}/data/${file}
+ done
+fi
+
+# Scenario files
+if [ $SCENARIO = YES ]; then
+ echo Installing Scenarios
+ mkdir -p ${GAMEDIR}/maps
+ ${INSTALL_DATA} ${CD}/maps/* ${GAMEDIR}/maps
+ cat ${PKGDIR}/files/pkg-plist.scenario >> ${PLIST}
+else
+ ln -sf ${CD}/maps ${GAMEDIR}/maps
+ echo ${GAMESUBDIR}/maps >> ${PLIST}
+fi
+
+# Neither sound nor Music, make the whole data tree a link
+if [ $GRAPHIC = NO -a $MUSIC = NO ]; then
+ ln -sf ${CD}/data/video ${GAMEDIR}/data/video
+ echo ${GAMESUBDIR}/data/video >> ${PLIST}
+else
+ cat ${PKGDIR}/files/pkg-plist.video >> ${PLIST}
+fi
+
+# Graphics (recommended)
+if [ $GRAPHIC = YES ]; then
+ echo Installing Graphics
+ mkdir -p ${GAMEDIR}/data/video
+ ${INSTALL_DATA} ${CD}/data/video/credits.pcx ${GAMEDIR}/data/video
+ ${INSTALL_DATA} ${CD}/data/video/*.mjpg ${GAMEDIR}/data/video
+elif [ $VIDEOS = YES ]; then
+# Videos are installed, so create links
+ cd $CD/data/video
+ for file in *.mjpg credits.pcx; do
+ ln -sf $CD/data/video/${file} ${GAMEDIR}/data/video/${file}
+ done
+ cd -
+fi
+
+# Videos
+if [ $VIDEOS = YES ]; then
+ echo Installing Videos
+ mkdir -p ${GAMEDIR}/data/video
+ ${INSTALL_DATA} ${CD}/data/video/*.mpg ${GAMEDIR}/data/video
+ cat ${PKGDIR}/files/pkg-plist.video >> ${PLIST}
+elif [ $GRAPHIC = YES ]; then
+# Music is installed, so create links
+ cd $CD/data/video
+ for file in *.mpg; do
+ ln -sf $CD/data/video/${file} ${GAMEDIR}/data/video/${file}
+ done
+ cd -
+fi
+
+# Music
+if [ $MUSIC = YES ]; then
+ echo Installing Music
+ mkdir -p ${GAMEDIR}/mp3
+ ${INSTALL_DATA} ${CD}/mp3/* ${GAMEDIR}/mp3
+ cat ${PKGDIR}/files/pkg-plist.music >> ${PLIST}
+else
+ ln -sf ${CD}/mp3 ${GAMEDIR}/mp3
+ echo ${GAMESUBDIR}/mp3 >> ${PLIST}
+fi
+
+ echo @dirrm ${GAMESUBDIR}/data >> ${PLIST}
+ echo @dirrm ${GAMESUBDIR} >> ${PLIST}
+
+# Goodbye message
+if [ $BASIC = YES -a $GRAPHIC = YES ]; then
+ echo
+ echo Congratulation. Remember, with your installation you can also play without CD!
+fi
+exit 0