frantisekz / rpms / wine

Forked from rpms/wine 4 years ago
Clone
4eadcff
#!/bin/sh
4eadcff
HAVE_32=false
4eadcff
HAVE_64=false
4eadcff
4eadcff
if [ -x "/usr/bin/wine32" ]; then
4eadcff
HAVE_32=true
4eadcff
fi
4eadcff
4eadcff
if [ -x "/usr/bin/wine64" ]; then
4eadcff
HAVE_64=true
4eadcff
fi
4eadcff
4eadcff
if [ -f "${1}" ]; then
4eadcff
    archtype=`file "${1}" | cut -d':' -f2 | cut -d' ' -f2`
4eadcff
4eadcff
    if [ ${archtype} = 'PE32+' ]; then # 64bit
4eadcff
	if $HAVE_64; then
4eadcff
	    exec "/usr/bin/wine64" "${@}";
4eadcff
	elif [ `uname -m` = 'x86_64' ]; then
4eadcff
	    echo "Your are trying to run a 64bit application. Please install the 64bit version of wine."
4eadcff
	    echo "You can achieve this by running 'su -c \"yum install \\\"wine(x86-64)\\\"\"'"
4eadcff
	else
4eadcff
	    echo "Your are trying to run a 64bit application on a 32bit installation of Fedora. You need a 64bit version of Fedora to run this application."
4eadcff
	fi
4eadcff
    else
4eadcff
	if $HAVE_32; then
4eadcff
	    exec "/usr/bin/wine32" "${@}"
4eadcff
	else
4eadcff
	    echo "Your are trying to run a 32bit application. Please install the 32bit version of wine."
4eadcff
	    echo "You can achieve this by running 'su -c \"yum install \\\"wine(x86-32)\\\"\"'"
4eadcff
	fi
4eadcff
    fi
4eadcff
else
4eadcff
    if $HAVE_64; then
4eadcff
	exec "/usr/bin/wine64" "${@}";
4eadcff
    else
4eadcff
	exec "/usr/bin/wine32" "${@}";
4eadcff
    fi
4eadcff
fi