|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
debian_os(){
|
|
|
|
[ -f /etc/os-release ] && source /etc/os-release || return 1;
|
|
|
|
[ "$ID" == "ubuntu" ] && prefix="sudo" || prefix='';
|
|
|
|
install_log="$ldir/os-install.log";
|
|
|
|
failed=0;
|
|
|
|
packages="";
|
|
|
|
|
|
|
|
for e in "${binvars[@]}";
|
|
|
|
do
|
|
|
|
if ! hash "$e" 2>/dev/null; then
|
|
|
|
inst="$e";
|
|
|
|
case $e in
|
|
|
|
svn)
|
|
|
|
inst="subversion";
|
|
|
|
;;
|
|
|
|
xz)
|
|
|
|
inst="xz-utils";
|
|
|
|
;;
|
|
|
|
makeinfo)
|
|
|
|
inst="texinfo";
|
|
|
|
;;
|
|
|
|
python3-config)
|
|
|
|
inst="python3-dev";
|
|
|
|
;;
|
|
|
|
libtoolize)
|
|
|
|
inst="libtool";
|
|
|
|
;;
|
|
|
|
libtool)
|
|
|
|
inst="libtool-bin";
|
|
|
|
;;
|
|
|
|
composite)
|
|
|
|
inst="imagemagick";
|
|
|
|
;;
|
|
|
|
cmp)
|
|
|
|
inst="diffutils";
|
|
|
|
;;
|
|
|
|
esac;
|
|
|
|
printf -v pad %40s; e=$e$pad; e=${e:0:15};
|
|
|
|
echo -e "$w_l select $g_l$e$y_l from: $inst";
|
|
|
|
packages="$packages $inst";
|
|
|
|
fi;
|
|
|
|
done;
|
|
|
|
|
|
|
|
for e in "${headervars[@]}";
|
|
|
|
do
|
|
|
|
e1=$(find /usr/include/* |grep -m1 "$e");
|
|
|
|
if [ ! ${#e1} -gt 8 ]; then
|
|
|
|
case $e in
|
|
|
|
crypto.h)
|
|
|
|
inst="libssl-dev";
|
|
|
|
;;
|
|
|
|
opensslconf.h)
|
|
|
|
inst="libssl-dev";
|
|
|
|
;;
|
|
|
|
libusb.h)
|
|
|
|
inst="libusb-1.0.0-dev";
|
|
|
|
;;
|
|
|
|
pcsclite.h)
|
|
|
|
inst="libpcsclite-dev";
|
|
|
|
;;
|
|
|
|
pthread.h)
|
|
|
|
inst="libc-dev-bin";
|
|
|
|
;;
|
|
|
|
ncurses)
|
|
|
|
inst="libncurses-dev";
|
|
|
|
;;
|
|
|
|
libacl.h)
|
|
|
|
inst="libacl1-dev";
|
|
|
|
;;
|
|
|
|
sys/capability.h)
|
|
|
|
inst="libcap-dev";
|
|
|
|
;;
|
|
|
|
readline.h)
|
|
|
|
inst="libreadline-dev";
|
|
|
|
;;
|
|
|
|
glib-2.0/glib.h)
|
|
|
|
inst="libglib2.0-dev";
|
|
|
|
;;
|
|
|
|
esac;
|
|
|
|
printf -v pad %40s; e=$e$pad; e=${e:0:15};
|
|
|
|
echo -e "$w_l select $g_l$e$y_l from: $inst";
|
|
|
|
packages="$packages $inst";
|
|
|
|
fi;
|
|
|
|
done;
|
|
|
|
|
|
|
|
for e in "${libvars[@]}";
|
|
|
|
do
|
|
|
|
e1=$(find /usr/lib* |grep -m1 "$e");
|
|
|
|
if [ ! ${#e1} -gt 8 ]; then
|
|
|
|
case $e in
|
|
|
|
libccidtwin.so)
|
|
|
|
inst="libccid";
|
|
|
|
;;
|
|
|
|
libstdc++.so.6)
|
|
|
|
inst="libstdc++6";
|
|
|
|
;;
|
|
|
|
esac;
|
|
|
|
printf -v pad %40s; e=$e$pad; e=${e:0:15};
|
|
|
|
echo -e "$w_l select $g_l$e$y_l from: $inst";
|
|
|
|
packages="$packages $inst";
|
|
|
|
fi;
|
|
|
|
done;
|
|
|
|
|
|
|
|
if [ "$(uname -m)" == "x86_64" ] && [ ! -f /usr/lib32/libz.so.1 ]; then
|
|
|
|
if [ ! -f /usr/lib32/libz.so.1 ]; then
|
|
|
|
e="zlib32";
|
|
|
|
inst="lib32z1";
|
|
|
|
printf -v pad %40s; e=$e$pad; e=${e:0:15};
|
|
|
|
echo -e "$w_l select $g_l$e$y_l from: $inst";
|
|
|
|
packages="$packages $inst";
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ${#packages} -gt 0 ]; then
|
|
|
|
echo -n >"$install_log" &2>/dev/null;
|
|
|
|
echo -e "$w_l\n INSTALLATION\n ============";
|
|
|
|
if [ "$EUID" -ne 0 ] && [ ! "$ID" == "ubuntu" ]; then
|
|
|
|
echo -en "$r_l\n enter root ";
|
|
|
|
su root -c "
|
|
|
|
echo -e '\033[1;37m\n update\033[1;32m package list...\n';
|
|
|
|
apt-get -y update |grep --line-buffered -v '^T\|(\|^I\|^H' 2>&1;
|
|
|
|
echo -e '\n\033[1;37m install\033[1;32m $txt_selected packages\033[1;33m $txt_wait\n';
|
|
|
|
apt-get -y -qq install $packages |grep --line-buffered '(' |grep --line-buffered -v 'nicht\|dpkg';
|
|
|
|
"
|
|
|
|
else
|
|
|
|
echo -e "\033[1;37m update\033[1;32m package list... \n";
|
|
|
|
$prefix apt-get -y update |grep --line-buffered -v '^T\|(\|^I\|^H' 2>&1;
|
|
|
|
echo -e "\n\033[1;37m install\033[1;32m packages \033[1;33m$txt_wait \n";
|
|
|
|
$prefix apt-get -y -qq install $packages |grep --line-buffered '(' |grep --line-buffered -v 'nicht';
|
|
|
|
fi;
|
|
|
|
fi;
|
|
|
|
|
|
|
|
[ $failed == 1 ] && echo -e "\n$r_l Installation with errors - see: $install_log";
|
|
|
|
|
|
|
|
return $failed;
|
|
|
|
}
|