summarylogtreecommitdiffstats
path: root/setup.sh.in
diff options
context:
space:
mode:
authorJernuh Zakalwe2018-10-16 21:14:47 +0200
committerJernuh Zakalwe2018-10-16 21:14:47 +0200
commit9f3b4052f0beedcddcbbc4f85bcf9d6b8a2c3b66 (patch)
treebf613a3c9357a43307f55b9af1dbbd6fc0da4ff9 /setup.sh.in
parent09c5b0109994c4c31a1180a9702766f32a95a21d (diff)
downloadaur-9f3b4052f0beedcddcbbc4f85bcf9d6b8a2c3b66.tar.gz
Added build script for creating distribution independed installer.
File attributes changed to avoid accidentally executing in src directory. Minor fixes.
Diffstat (limited to 'setup.sh.in')
-rw-r--r--setup.sh.in88
1 files changed, 88 insertions, 0 deletions
diff --git a/setup.sh.in b/setup.sh.in
new file mode 100644
index 000000000000..65c3b667f965
--- /dev/null
+++ b/setup.sh.in
@@ -0,0 +1,88 @@
+#!/bin/sh
+
+set -e
+
+bootstrap_install() {
+ if [ -x "$(which wine)" ] ;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 "\nExiting.\n\n"
+ exit 0
+ fi
+ if [ -x "$(which winetricks)" ] ;then
+ echo "Winetricks version $(winetricks --version | cut -d' ' -f1) found."
+ else
+ echo "Winetricks not found. Winetricks are required."
+ echo " Please install Winetricks with your Package Manager."
+ printf "\nExiting.\n\n"
+ exit 0
+ fi
+ install -dv "${target}/bin/"
+ install -d "/usr/bin/"
+ install -d "/usr/share/applications/"
+ for cmd in evelauncher.sh everegedit evewine evewinecfg evewinetricks ;do
+ install "./$cmd" "${target}/bin/"
+ ln -s "${target}/bin/$cmd" "/usr/bin/$cmd"
+ if [ ! "$cmd" = "evewine" ] ;then
+ install -m 0644 "./${cmd%.*}.desktop" "/usr/share/applications/"
+ fi
+ done
+ install -dv "${target}/lib/"
+ for eta in $(find . -type f -name 'eve-transl*') ;do
+ install -m 0644 "$eta" "${target}/lib"
+ done
+ install -m 0644 "./evelauncher-${elver}.tar.gz" "${target}/lib"
+ for icons in $(find . -type f -name '*.png') ;do
+ install -m 0644 "$icons" "/usr/share/$icons"
+ done
+ if [ -x $(which gtk-update-icon-cache) ] ;then
+ gtk-update-icon-cache -f "/usr/share/icons/hicolor" 2>/dev/null && \
+ chmod 0644 "/usr/share/icons/hicolor/icon-theme.cache"
+ fi
+}
+
+bootstrap_remove() {
+ for icons in $(find . -type f -name '*.png') ;do
+ rm -f "/usr/share/$icons"
+ done
+ if [ -x $(which gtk-update-icon-cache) ] ;then
+ gtk-update-icon-cache -f "/usr/share/icons/hicolor" 2>/dev/null && \
+ chmod 0644 "/usr/share/icons/hicolor/icon-theme.cache"
+ fi
+ rm -rfv "${target}/lib/"
+ for cmd in evelauncher.sh eveoverrides everegedit \
+ evewine evewinecfg evewinetricks ;do
+ rm -fv "/usr/bin/$cmd"
+ if [ ! "$cmd" = "evewine" ] ;then
+ rm -f "/usr/share/applications/${cmd%.*}.desktop"
+ fi
+ done
+ rm -rfv "${target}"
+}
+
+target="/opt/evesetup"
+key=""
+qtver="5.11"
+elver="1385477"
+
+if [ $(id -u) -ne 0 ] ;then
+ printf "\nEVE Online Launcher Setup need root permissions."
+ printf "\nExiting.\n\n"
+ exit 0
+fi
+if [ -d "${target}/bin/" ] ;then
+ printf "\n"
+ read -p 'Remove EVE Online Launcher Setup? (Y/n) ' key
+ [ ! "x$(echo $key | tr [:upper:] [:lower:])" = "xn" ] && \
+ bootstrap_remove
+else
+ printf "\n"
+ read -p 'Install EVE Online Launcher Setup? (Y/n) ' key
+ [ ! "x$(echo $key | tr [:upper:] [:lower:])" = "xn" ] && \
+ bootstrap_install && \
+ printf "\nYou can now start EVE Online Launcher and his " && \
+ echo "Tools from your Application menu."
+fi
+printf "\nDone.\n\n"