Translation(s): English - Italiano


The following script will download the necesserary ressources for gnome-video-arcade and mame 0.143

#!/bin/sh
set -e
# Downloader for data files used by gnome-video-arcade
# By default file are downloaded and unpacked in 
# /usr/local/share/gnome-video-arcade
# (which means you need to add 
# --with-category-file=/usr/local/share/gnome-video-arcade/catver.ini
# --with-history-file=/usr/local/share/gnome-video-arcade/history.dat
# --with-nplayers-file=/usr/local/share/gnome-video-arcade/nplayers.ini
# in the gnome-video-arcade ./configure step )

# FRONT END EXTRA RESSOURCES 
#MAME_INFO 
#http://mameinfo.mameworld.info/
#SNAPSHOTS
#http://www.progettoemma.net/snaps/

# MAME EXTRA RESSOURCES 
#IN GAME ARTWORK http://mrdo.mameworld.info/mame_artwork_ingame.html
#EXTRA ARTWORK http://mrdo.mameworld.info/mame_artwork_frontend.html
#CHEAT  http://cheat.retrogames.com/
#CROSSHAIR
#CTRL
#KEYMAPS
#ROMS
#SAMPLES

if test -z $1; then
                TARGET_DIR=/usr/local/share/gnome-video-arcade
        else
                TARGET_DIR=$1
fi

# no license
CATEGORY_FILE_URL='http://www.progettoemma.net/public/cat/catveren.zip'

# cc by sa
HISTORY_FILE=mamehistory143a.zip
HISTORY_FILE_URL='http://www.arcade-history.com/dats'

# free license
NPLAYERS_FILE=nplayers0143.zip
NPLAYERS_FILE_URL='http://nplayers.arcadebelgium.be/files/'

# Download
down_comm () {
        if which curl>/dev/null 2>&1; then
        curl --progress-bar --output $1 $2      
        elif which wget>/dev/null 2>&1; then
        wget --progress=bar --output-document $1 $2
        else die "Neither wget nor curl were found"
    fi
}

TMPDIR=$(mktemp --directory  --dry-run)
mkdir $TMPDIR

down_comm $TMPDIR/catver.zip $CATEGORY_FILE_URL

down_comm $TMPDIR/$HISTORY_FILE $HISTORY_FILE_URL/$HISTORY_FILE

down_comm $TMPDIR/$NPLAYERS_FILE $NPLAYERS_FILE_URL/$NPLAYERS_FILE

for FILE in $TMPDIR/catver.zip\
                $TMPDIR/$HISTORY_FILE\
                $TMPDIR/$NPLAYERS_FILE
do
        unzip $FILE -d $TMPDIR
done

cp $TMPDIR/Catver.ini $TARGET_DIR/catver.ini
cp $TMPDIR/nplayers.ini $TARGET_DIR/nplayers.ini
cp $TMPDIR/history.dat $TARGET_DIR/history.dat

rm -r $TMPDIR

echo "All data files installed OK"