#!/bin/sh set -e bootstrap_install() { install -dv "$destdir" install -dv "$bindir" install -dv "$libdir" install -dv "$docdir" install -d "$prefix/bin/" install -d "$prefix/share/applications/" for eta in ./eve-transl${qtver}-??.tar.gz ;do install -m 0644 "$eta" "$libdir" done install -m 0644 "./evesetup.shlib" "$libdir" install -m 0644 "./evelauncher-${elver}.tar.gz" "$libdir" install -m 0644 "./evelauncher.kwinrule" "$docdir" install -m 0644 "./evelauncher.lua" "$docdir" sed -i s,./eve-transl,$libdir/eve-transl, ./evelauncher.sh sed -i s,SETUPDIR=\"\",SETUPDIR=\"$destdir\", ./evelauncher.sh for cmd in backup launcher.sh regedit restore wine winecfg winetricks ;do cmd=eve$cmd if [ -f "./$cmd" ] ;then sed -i s,./evesetup.shlib,$libdir/evesetup.shlib, ./$cmd install "./$cmd" "$bindir/" else if [ "$cmd" = "everestore" ] ;then ln -s evebackup "$bindir/$cmd" else ln -s evewine "$bindir/$cmd" fi fi [ "$bindir" != "$prefix/bin" ] && ln -s "$bindir/$cmd" "$prefix/bin/$cmd" if [ ! "$cmd" = "evewine" ] ;then oexec=$(grep Exec= ./${cmd%.*}.desktop) sed -i s,$oexec,Exec=$prefix/bin/$cmd, ./${cmd%.*}.desktop install -m 0644 "./${cmd%.*}.desktop" "$prefix/share/applications/" fi done for icons in $(find . -type f -name '*.png') ;do install -D -m 0644 "$icons" "$prefix/share/${icons#*/}" done if [ -x $(which gtk-update-icon-cache) ] ;then if [ -f "${prefix}/share/icons/hicolor/icon-theme.cache" ] ;then gtk-update-icon-cache -t -f "${prefix}/share/icons/hicolor" 2>/dev/null chmod 0644 "${prefix}/share/icons/hicolor/icon-theme.cache" fi fi } bootstrap_remove() { for icons in $(find . -type f -name '*.png') ;do rm -f "$prefix/share/${icons#*/}" done for cmd in backup launcher.sh regedit restore wine winecfg winetricks ;do cmd=eve$cmd rm -fv "$prefix/bin/$cmd" if [ ! "$cmd" = "evewine" ] ;then rm -f "$prefix/share/applications/${cmd%.*}.desktop" fi done rm -rfv "$destdir" } build_lib() { if [ ! -r "./evelauncher-$elver.tar.gz" ] ;then if [ -x "$(which curl 2>/dev/null)" ] ;then echo "Curl version $(curl -V | head -n1 | cut -d' ' -f2) found." else echo "Curl not found. Curl are needed for downloading evelauncher binaries." echo " Please install curl with your Package Manager." printf "\nLeaving.\n\n" exit 0 fi printf "\nDownload evelauncher-$elver.tar.gz...\n\n" curl -L -O https://binaries.eveonline.com/evelauncher-$elver.tar.gz fi rcsum="$(sha256sum ./evelauncher-$elver.tar.gz| cut -d' ' -f1)" if [ "$rcsum" != "$elcsum" ] ;then printf "\n\nError: Checksum from evelauncher-$elver.tar.gz doesn't match!" printf "\nLeaving.\n\n" exit 0 fi printf "\nExtract evelauncher-$elver.tar.gz..." tar xf evelauncher-$elver.tar.gz echo "done." printf "\nClean up evelauncher directory..." cd evelauncher/ rm -f ./*.a ./*.la ./*.prl ./libxcb* chmod 0755 ./* chmod 0644 ./*.qm ./*.conf ./errorpage/* echo "done." printf "\nReplace identical files with symbolic links..." ln -sf evelauncher.sh LogLite.sh ln -sf libicudata.so.55.1 libicudata.so ln -sf libicudata.so.55.1 libicudata.so.55 ln -sf libicui18n.so.55.1 libicui18n.so ln -sf libicui18n.so.55.1 libicui18n.so.55 ln -sf libicuuc.so.55.1 libicuuc.so ln -sf libicuuc.so.55.1 libicuuc.so.55 ln -sf libgpr.so.6.0.0 libgpr.so ln -sf libgpr.so.6.0.0 libgpr.so.6 ln -sf libgrpc++.so.1.12.0 libgrpc++.so ln -sf libgrpc++.so.1.12.0 libgrpc++.so.1 ln -sf libgrpc++.so.1.12.0 libgrpc++.so.6 ln -sf libgrpc.so.6.0.0 libgrpc.so ln -sf libgrpc.so.6.0.0 libgrpc.so.6 ln -sf libpng12.so.0.54.0 libpng12.so.0 ln -sf libprotobuf.so.16.0.0 libprotobuf.so ln -sf libprotobuf.so.16.0.0 libprotobuf.so.16 echo "done." printf "\nRemove unneeded symbols from files..." find ./ -maxdepth 1 -type f -exec strip -s {} 2>/dev/null \; echo "done." printf "\nRepack evelauncher-$elver.tar.gz..." touch ./* cd ../ rm evelauncher-$elver.tar.gz tar czf evelauncher-$elver.tar.gz evelauncher/ rm -rf evelauncher/ echo "done." } check_req() { if [ -x "$(which 7z 2>/dev/null)" ] ;then echo "$(7z | head -n2 | cut -d: -f1 | tr -d [:cntrl:])found." else echo "p7zip not found. Please install p7zip with your Package Manager." printf "\nLeaving.\n\n" exit 0 fi if [ -x "$(which wine 2>/dev/null)" ] ;then echo "Wine version $(wine --version) found." else echo "Wine not found. Please install Wine with your Package Manager." echo "WineHQ or Developer Version are recommended." printf "\nLeaving.\n\n" exit 0 fi } prefix="/usr" destdir="/opt/evesetup" bindir="$destdir/bin" libdir="$destdir/lib" docdir="$destdir/doc" qtver="5.11" elver="" elcsum="" rcsum="" key="" if [ $(id -u) -ne 0 ] ;then printf "\nEVE Online Launcher Setup need root permissions." printf "\nLeaving.\n\n" exit 0 fi if [ -d "$destdir" ] ;then printf "\n" read -p 'Remove EVE Online Launcher Setup? (Y/n) ' key if [ "x$(echo $key | tr [:upper:] [:lower:])" != "xn" ] ;then printf "\nRemoving...\n\n" bootstrap_remove fi else printf "\n" read -p 'Install EVE Online Launcher Setup? (Y/n) ' key if [ "x$(echo $key | tr [:upper:] [:lower:])" != "xn" ] ;then printf "\nInstalling...\n\n" check_req build_lib printf "\n" bootstrap_install printf "\nYou can now start EVE Online Launcher and his Tools:\n\n" for cmd in *.desktop ;do oexec=$(grep Exec= $cmd | cut -d= -f2); oexec=${oexec##*/} [ ! "$oexec" = "evelauncher.sh" ] && \ printf " $oexec\t- $(grep Comment= $cmd | cut -d= -f2)\n" done printf "\n evelauncher.sh\t- EVE Online Launcher\n" fi fi printf "\nDone.\n\n"