Lakka/scripts/checkdeps
Stephan Raue 6929b86a10 scripts/checkdeps: remove check for lzo, not more needed
Signed-off-by: Stephan Raue <stephan@openelec.tv>
2010-10-21 07:46:54 +02:00

97 lines
2.9 KiB
Bash
Executable File

#!/bin/sh
. config/options $1
deps=
deps_pkg=
files=
files_pkg=
case $1 in
get)
deps="wget"
deps_pkg="wget"
;;
build)
deps="gcc g++ sed patch touch nasm tar bzip2 gzip perl flex bison cp gawk makeinfo gettext gperf autoconf automake m4 cvs zip unzip mkfontscale libtool diff byacc xsltproc msgfmt"
deps_pkg="gcc g++ sed patch fileutils nasm tar bzip2 gzip perl flex bison coreutils gawk texinfo gettext gperf autoconf automake m4 cvs zip unzip xutils libtool diff byacc xsltproc gettext"
files="/usr/include/stdio.h /usr/include/zlib.h /usr/include/ncurses.h"
files_pkg="libc6-dev zlib1g-dev libncurses5-dev"
;;
qemu)
if [ ! `which qemu` ]; then
echo "Your system doesn't seem to have QEMU installed"
exit 1
fi
;;
esac
getarg() {
eval echo \${$(($1+2))}
}
i=0
while dep=`getarg $i $deps` && [ -n "$dep" ]; do
[ -z "`which $dep 2>/dev/null`" ] && need="$need $dep" && need_pkg="$need_pkg `getarg $i $deps_pkg`"
i=$(($i+1))
done
i=0
while file=`getarg $i $files` && [ -n "$file" ]; do
[ ! -f $file ] && need="$need $file" && need_pkg="$need_pkg `getarg $i $files_pkg`"
i=$(($i+1))
done
if [ -n "$need" ]; then
echo "**** Your system lacks the following tools needed to $1 OpenELEC.tv ****"
echo $need
[ -f /etc/lsb-release ] && . /etc/lsb-release
if [ -n "`which aptitude 2>/dev/null`" ]; then
DISTRO="a Debian"
[ "$DISTRIB_ID" = "Ubuntu" ] && DISTRO="an Ubuntu"
echo "**** You seem to use $DISTRO system ****"
read -p "would you like to install the needed tools ? (y/n) " ans
[ "$ans" = "y" ] && sudo aptitude install $need_pkg
elif [ -f /etc/mandrake-release -a -n "`which urpmi 2>/dev/null`" ]; then
echo "**** You seem to use a mandrake system ****"
read -p "would you like to install the needed tools ? (y/n) " ans
[ "$ans" = "y" ] && sudo urpmi $need_pkg
elif [ -f /etc/gentoo-release -a -n "`which emerge 2>/dev/null`" ]; then
echo "**** You seem to use a gentoo system ****"
read -p "would you like to install the needed tools ? (y/n) " ans
[ "$ans" = "y" ] && sudo emerge -D $need_pkg
elif [ -f /etc/fedora-release -a -n "`which yum 2>/dev/null`" ]; then
echo "**** You seem to use a fedora system ****"
read -p "would you like to install the needed tools ? (y/n) " ans
[ "$ans" = "y" ] && sudo yum install $need_pkg
else
echo "********"
exit 1
fi
fi
need=""
need_pkg=""
i=0
while dep=`getarg $i $deps` && [ -n "$dep" ]; do
[ -z "`which $dep 2>/dev/null`" ] && need="$need $dep" && need_pkg="$need_pkg `getarg $i $deps_pkg`"
i=$(($i+1))
done
i=0
while file=`getarg $i $files` && [ -n "$file" ]; do
[ ! -f $file ] && need="$need $file" && need_pkg="$need_pkg `getarg $i $files_pkg`"
i=$(($i+1))
done
if [ -n "$need" ]; then
echo "**** The following packages were not installed correctly ****"
echo $need_pkg
echo "********"
exit 1
fi