2047f69074
PR: 25457 Submitted by: Holger Lamm <holger@eit.uni-kl.de>
109 lines
3 KiB
Bash
109 lines
3 KiB
Bash
#!/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
|