summaryrefslogblamecommitdiff
path: root/games/HeroesOfMightAndMagic/scripts/do-install
blob: 489da4882cc7a00d1f48c2e103d418590353a156 (plain) (tree)






















                                                                       
                            



                                                  
















                                                                         

                                         




                                                          





















                                                                          













                                                                   

                                       

  





                                                                                           
#!/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}
chmod 755 ${GAMEDIR}/heroes3
brandelf -t Linux ${GAMEDIR}/heroes3
ln -sf ${GAMEDIR}/heroes3 ${LOCALBASE}/bin/heroes3
touch ${GAMEDIR}/data/hiscore.dat
chmod 666 ${GAMEDIR}/data/hiscore.dat

# 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
else
	ln -sf ${CD}/maps ${GAMEDIR}/maps
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
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
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
else
	ln -sf ${CD}/mp3 ${GAMEDIR}/mp3
fi

# 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