Der Installer ist fertig und voll funktionstüchtig. Es wurden diverse Verbesserungen in der dynamischen Installation gemacht. Dies ist die erste Version welche voll funktionstüchtig unter allen Linuxversionen laufen sollte

This commit is contained in:
Leon Gaultier 2014-04-03 11:30:25 +02:00
parent 5926920ff8
commit b90801c1c3
5 changed files with 62 additions and 44 deletions

View File

@ -2,7 +2,7 @@
# Programmversion # Programmversion
PROGNAME=`basename $0` PROGNAME=`basename $0`
VERSION="0.6" VERSION="0.11"
QUIET=0 QUIET=0
func_term_output () { func_term_output () {
@ -14,37 +14,37 @@ func_term_output () {
func_usage () # Gibt Auskunft über Verwendung des Scriptes func_usage () # Gibt Auskunft über Verwendung des Scriptes
{ {
echo "Usage: $PROGNAME [OPTION...]" echo "Verwendung: $PROGNAME [OPTION...]"
echo "Try '$PROGNAME --help' or '$PROGNAME -h' for more information." echo -e "Verwende $PROGNAME --help oder $PROGNAME -h für mehr Informationen.\n"
} }
func_help () # Listet alle Optionsschalter auf func_help () # Listet alle Optionsschalter auf
{ {
func_term_output func_term_output
echo "Usage: $PROGNAME [OPTION...]" echo "Verwende: $PROGNAME [OPTION...]"
echo "$PROGNAME -- the Calibre-Autoupdate-Installer (CAUI)" echo "$PROGNAME -- Der Calibre-Autoupdate-Installer (CAUI)"
echo "" echo ""
echo "Options:" echo "Options:"
echo " -q, --quiet ohne Konsolenausgabe" echo " -q, --quiet ohne Konsolenausgabe"
echo " -h, --help zeigt die Hilfe an" echo " -h, --help zeigt die Hilfe an"
echo " -V, --version gibt die Programmversion aus" echo " -V, --version gibt die Programmversion aus"
echo " -i, --install installiert den Calibre-Autoupdater (CAU)" echo " -i, --install installiert den Calibre-Autoupdater (CAU)"
#echo " -u, --uninstall deinstalliert den Calibre-Autoupdater (CAU)" #echo " -u, --uninstall deinstalliert den Calibre-Autoupdater (CAU), soll kommen "
echo "" echo ""
echo -e "Report bugs to <leongaultier@gmail.com>.\n"; echo -e "Sende Fehler an <leongaultier@gmail.com>.\n";
} }
func_version () # Versionsauskunft des Installers func_version () # Versionsauskunft des Installers
{ {
echo "$PROGNAME: the Calibre-Autoupdate-Installer (CAUI) v$VERSION" echo "$PROGNAME: Der Calibre-Autoupdate-Installer (CAUI) v$VERSION"
echo "Copyright (C) Leon Gaultier 2013-2014. This program is distributed" echo "Leon Gaultier 2013-2014. Das Programm darf verteilt werden,"
echo "in the hope that it will be useful, but WITHOUT ANY WARRANTY" echo "in der Hoffnung das es hilfreich ist, aber OHNR IRGENDEINE GARANTIE"
} }
func_change_install_dir() # Funktion zur Abfrage des Installationsortes func_change_install_dir() # Funktion zur Abfrage des Installationsortes
{ {
read -p "Wo soll der Calibre Updater installiert werden? [default /usr/local] " UPDATER_INSTALL_LOCATION read -p "Wo soll der Calibre-Autoupdater installiert werden? [default /usr/local] " UPDATER_INSTALL_LOCATION
if [ -z $UPDATER_INSTALL_LOCATION ]; then if [ -z $UPDATER_INSTALL_LOCATION ]; then
UPDATER_INSTALL_LOCATION=/usr/local UPDATER_INSTALL_LOCATION=/usr/local
@ -64,7 +64,7 @@ BIN=$UPDATER_INSTALL_LOCATION/bin/
func_check_dir() # Install oder Update Calibre Updater, Check ob Calibre überhaupt installiert ist func_check_dir() # Install oder Update Calibre Updater, Check ob Calibre überhaupt installiert ist
{ {
if test ! -d $CALIBRE_INSTALL_LOCATION ; then if test ! -d $CALIBRE_INSTALL_LOCATION ; then
echo -e "\n\033[1;31mKeine Calibre Installation unter $CALIBRE_INSTALL_LOCATION gefunden. Installation des Updaters wurde abgebrochen.\e[m\n"; >&2 echo -e "\n\033[1;31mKeine Calibre Installation unter $CALIBRE_INSTALL_LOCATION gefunden. Installation des Updaters nicht möglich.\e[m\n"; >&2
exit 1 exit 1
fi fi
@ -82,7 +82,7 @@ func_check_dir() # Install oder Update Calibre Updater, Check ob Calibre überh
done done
echo echo
if (( ! result )); then if (( ! result )); then
echo -e "\n\033[1;31mDie installation des Updaters wurde abgebrochen.\e[m\n" echo -e "\n\033[1;31mDie installation des Calibre-Autoupdaters wurde durch Dich beendet.\e[m\n"
exit 1 exit 1
fi fi
fi fi
@ -94,31 +94,44 @@ func_term_output
func_change_install_dir func_change_install_dir
func_check_dir func_check_dir
# Ersetzen der Platzhaltervatiablen für die Installationsverzeichnisvariablen
if [ -w "$BIN" ]; then if [ -w "$BIN" ]; then
echo -e "\n\033[1;34mDer Calibre Autoupdater wird nun unter $UPDATER_INSTALL_LOCATION installiert...\e[m"; echo -e "\n\033[1;34mDer Calibre-Autoupdater wird nun unter $UPDATER_INSTALL_LOCATION installiert...\e[m";
echo -e "\n\033[1;32mProgrammdatei wird nach $BIN kopiert\e[m"; sleep 3 echo -e "\n\033[1;32mProgrammdatei wird nach $BIN kopiert\e[m"; sleep 3
cp -v calibre-autoupdate $BIN cp -v calibre-autoupdate $BIN
sed -i "s/_-INC-_/${INC//\//\/}/g" $BIN"calibre-autoupdate"
sed -i "s/_-ETC-_/${ETC//\//\/}/g" $BIN"calibre-autoupdate"
sed -i "s/_-BIN-_/${BIN//\//\/}/g" $BIN"calibre-autoupdate"
sed -i "s/_-VERSION-_/${VERSION//\//\/}/g" $BIN"calibre-autoupdate"
chmod -v 755 $BIN/calibre-autoupdate chmod -v 755 $BIN/calibre-autoupdate
echo -e "\n\033[1;32mDie Header-Dateien werden nach $INC kopiert\e[m"; sleep 3 echo -e "\n\033[1;32mDie Header-Dateien werden nach $INC kopiert\e[m"; sleep 3
cp -v calibre-autoupdate.h calibre-autoupdate_checks.h $INC cp -v calibre-autoupdate.h calibre-autoupdate_checks.h $INC
chmod -v 644 $INC/calibre-autoupdate.h $INC/calibre-autoupdate_checks.h chmod -v 644 $INC/calibre-autoupdate.h $INC/calibre-autoupdate_checks.h
echo -e "\n\033[1;32mDie Konfigurationsdatei wird nach $ETC kopiert\e[m"; sleep 3 echo -e "\n\033[1;32mDie Konfigurationsdatei wird nach $ETC kopiert\e[m"; sleep 3
cp -v calibre-autoupdate.conf $ETC cp -v calibre-autoupdate.conf $ETC
sed -i "s/_-CALIBRE_INSTALL_LOCATION-_/${CALIBRE_INSTALL_LOCATION//\//\/}/g" $ETC"calibre-autoupdate.conf"
chmod -v 644 $ETC/calibre-autoupdate.conf chmod -v 644 $ETC/calibre-autoupdate.conf
else else
echo -e "\n\033[1;34mDu hast kein Schreibrecht auf $UPDATER_INSTALL_LOCATION, daher wird SUDO versucht zu verwenden...\e[m"; echo -e "\n\033[1;34mDu hast kein Schreibrecht auf $UPDATER_INSTALL_LOCATION, daher wird SUDO versucht zu verwenden...\e[m";
echo -e "\n\033[1;32mProgrammdatei wird nach $BIN kopiert\e[m\e[m"; echo -e "\n\033[1;32mProgrammdatei wird nach $BIN kopiert\e[m\e[m"; sleep 3
sudo cp -v calibre-autoupdate $BIN sudo cp calibre-autoupdate $BIN
sudo chmod -v 755 $BIN/calibre-autoupdate; sudo sed -i "s/_-INC-_/${INC//\//\/}/g" $BIN"calibre-autoupdate"
sudo sed -i "s/_-ETC-_/${ETC//\//\/}/g" $BIN"calibre-autoupdate"
sudo sed -i "s/_-BIN-_/${BIN//\//\/}/g" $BIN"calibre-autoupdate"
sudo sed -i "s/_-VERSION-_/${VERSION//\//\/}/g" $BIN"calibre-autoupdate"
sudo chmod 755 $BIN"calibre-autoupdate";
echo -e "\n\033[1;32mDie Header-Dateien werden nach $INC kopiert\e[m"; sleep 3 echo -e "\n\033[1;32mDie Header-Dateien werden nach $INC kopiert\e[m"; sleep 3
sudo cp -v calibre-autoupdate.h calibre-autoupdate_checks.h $INC sudo cp calibre-autoupdate.h calibre-autoupdate_checks.h $INC
sudo chmod -v 644 $INC/calibre-autoupdate.h $INC/calibre-autoupdate_checks.h; sudo chmod 644 $INC"calibre-autoupdate.h" $INC"calibre-autoupdate_checks.h";
echo -e "\n\033[1;32mDie Konfigurationsdatei wird nach $ETC kopiert\e[m"; sleep 3 echo -e "\n\033[1;32mDie Konfigurationsdatei wird nach $ETC kopiert\e[m"; sleep 3
sudo cp -v calibre-autoupdate.conf $ETC sudo cp calibre-autoupdate.conf $ETC
sudo chmod -v 644 $ETC/calibre-autoupdate.conf; sudo sed -i "s/_-CALIBRE_INSTALL_LOCATION-_/${CALIBRE_INSTALL_LOCATION//\//\/}/g" $ETC"calibre-autoupdate.conf"
sudo chmod 644 $ETC"calibre-autoupdate.conf";
fi fi
echo -e "\n\033[1;36mDer Calibre-Autoupdater wurde erfolgreich installiert\e[m\n" echo -e "\n\n\n\033[1;36mDer Calibre-Autoupdater wurde erfolgreich installiert und"
echo -e "kann nun mit calibre-update oder $BIN"calibre-update" aufgerufen werden\e[m\n"
} }
func_uninstall() func_uninstall()
@ -152,5 +165,5 @@ do
done done
func_term_output func_term_output
echo -e "\033[1;34mGib eine Option an! Oder verwende -h für Hilfe\n\e[m"; func_usage
exit 0 exit 0

View File

@ -56,6 +56,11 @@
# v0.10 hinzufügen eines Installationsskriptes für den calibre-autoupdater, Installsript prüft # v0.10 hinzufügen eines Installationsskriptes für den calibre-autoupdater, Installsript prüft
# vorhanden sein von calibre und des updaters und fragt nach Installationsort des Updaters # vorhanden sein von calibre und des updaters und fragt nach Installationsort des Updaters
# #
# v0.11 Das Mainscript wurde angepasst so das der Installer die ermittelten Variablen für den
# Installationsort in das Mainscript und die Konfigdatei schreiben kann.
# Es wurden diverse Ausgabentexte sprachlich verbessert und Fehler beseitigt.
# !!! Das ist die erste Version welche eine reibungslose Installation und einen reibungslosen
# betrieb unter allen Linuxvarianten ermöglicht !!!
# TODO auslesen der Download URL von der Download Seite # TODO auslesen der Download URL von der Download Seite
# kontrolle ob alle benötigten programme für das skript vorhanden sind # kontrolle ob alle benötigten programme für das skript vorhanden sind
# #
@ -64,13 +69,13 @@
###################################### ######################################
# Installationsfade in der Verzeichnishierarchie # Installationsfade in der Verzeichnishierarchie
INC=/usr/local/include/ INC=_-INC-_
ETC=/usr/local/etc/ ETC=_-ETC-_
BIN=/usr/local/bin/ BIN=_-BIN-_
# Programmversion # Programmversion
PROGNAME=`basename $0` PROGNAME=`basename $0`
VERSION="0.9" VERSION="_-VERSION-_"
QUIET=0 QUIET=0
################################# #################################
@ -139,7 +144,7 @@ case $? in
func_check_run_calibre # Aufruf der Funktion ob Calibre gestartet ist func_check_run_calibre # Aufruf der Funktion ob Calibre gestartet ist
if [ -w "$CALIBRE_INSTALL_LOCATION" ]; then if [ -w "$CALIBRE_INSTALL_LOCATION" ]; then
$NOTIFY "Du hast Schreibrechte auf $CALIBRE_INSTALL_LOCATION Das Update wird nun installiert..." $NOTIFY "Das Update wird nun installiert..."
echo -e "\033[1;34m" echo -e "\033[1;34m"
wget -nv -O- $DOWNLOAD_URL | python -c "import sys; main=lambda x:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main('$CALIBRE_INSTALL_LOCATION')" wget -nv -O- $DOWNLOAD_URL | python -c "import sys; main=lambda x:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main('$CALIBRE_INSTALL_LOCATION')"
else else
@ -147,7 +152,7 @@ case $? in
echo -e "\033[1;34m" echo -e "\033[1;34m"
sudo -v && wget -nv -O- $DOWNLOAD_URL | sudo python -c "import sys; main=lambda x:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main('$CALIBRE_INSTALL_LOCATION')" sudo -v && wget -nv -O- $DOWNLOAD_URL | sudo python -c "import sys; main=lambda x:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main('$CALIBRE_INSTALL_LOCATION')"
fi fi
$NOTIFY "Calibre wurde upgedatet." $NOTIFY "Calibre wurde auf die neuste Version aktuallisiert."
;; ;;
esac esac
;; ;;

View File

@ -5,7 +5,7 @@
# Calibre Download Seite URL. # Calibre Download Seite URL.
export CALIBRE_DOWNLOAD_PAGE=http://calibre-ebook.com/download_linux export CALIBRE_DOWNLOAD_PAGE=http://calibre-ebook.com/download_linux
# The location of the installed application. # The location of the installed application.
export CALIBRE_INSTALL_LOCATION=/opt export CALIBRE_INSTALL_LOCATION=_-CALIBRE_INSTALL_LOCATION-_
# The download URL # The download URL
DOWNLOAD_URL=https://github.com/kovidgoyal/calibre/raw/master/setup/linux-installer.py DOWNLOAD_URL=https://github.com/kovidgoyal/calibre/raw/master/setup/linux-installer.py

View File

@ -1,33 +1,33 @@
# Calibre Auto Updater Configfile # Calibre Auto Updater Header File
# Copyright (C) 2013-2014 Leon Gaultier # Copyright (C) 2013-2014 Leon Gaultier
# #
func_usage () func_usage ()
{ {
echo "Usage: $PROGNAME [OPTION...]" echo "Verwendung: $PROGNAME [OPTION...]"
echo "Try '$PROGNAME --help' or '$PROGNAME -h' for more information." echo "Verwende '$PROGNAME --help' oder '$PROGNAME -h' für mehr Informationen."
} }
func_help () func_help ()
{ {
func_term_output func_term_output
echo "Usage: $PROGNAME [OPTION...]" echo "Verwende: $PROGNAME [OPTION...]"
echo "$PROGNAME -- the Calibre! Linux Edition calibre-autoupdater (CAU)" echo "$PROGNAME -- Der Calibre! Linux Edition calibre-autoupdater (CAU)"
echo "" echo ""
echo "Options:" echo "Options:"
echo " -q, --quiet ohne Konsolenausgabe" echo " -q, --quiet ohne Konsolenausgabe"
echo " -h, --help zeigt die Hilfe an" echo " -h, --help zeigt die Hilfe an"
echo " -V, --version gibt die Programmversion aus" echo " -V, --version gibt die Programmversion aus"
echo " -c, --check checkt ob benötigte Programme vorhanden sind" echo " -c, --check kontrolliert ob benötigte Programme vorhanden sind"
echo "" echo ""
echo -e "Report bugs to <leongaultier@gmail.com>.\n"; echo -e "Sende Fehler an <leongaultier@gmail.com>.\n";
} }
func_version () func_version ()
{ {
echo "$PROGNAME: the Calibre! autoupdater v$VERSION" echo "$PROGNAME: Der Calibre! autoupdater v$VERSION"
echo "Copyright (C) Leon Gaultier 2013-2014. This program is distributed" echo "Leon Gaultier 2013-2014. Das Programm darf verteilt werden,"
echo "in the hope that it will be useful, but WITHOUT ANY WARRANTY" echo "in der Hoffnung das es hilfreich ist, aber OHNR IRGENDEINE GARANTIE"
} }

View File

@ -1,4 +1,4 @@
# Calibre Auto Updater Configfile # Calibre Auto Updater Header File
# Copyright (C) 2013-2014 Leon Gaultier # Copyright (C) 2013-2014 Leon Gaultier
# #
@ -23,7 +23,7 @@ if [ $ONLINE ]; then
return 3 return 3
fi fi
else else
echo -e "\033[31m Fehler!!! Sieh Dir die verdammte Desktop Benachrichtigung an!"; echo -e "\033[31m Fehler!!! Bitte schau Dir die Desktop Benachrichtigung an!";
return 4 return 4
fi fi
} }
@ -70,7 +70,7 @@ func_check_prog () {
if test ! -f $NOTIFY ; then if test ! -f $NOTIFY ; then
echo -e "\e[0;33mDu hast Notify-Send nich installiert, das Programm ist optional und wird"; >&2 echo -e "\e[0;33mDu hast Notify-Send nich installiert, das Programm ist optional und wird"; >&2
echo -e "für die Upatefunktion nicht unbedingt benötigt\n"; >&2 echo -e "für die Upatefunktion nicht unbedingt benötigt. Ist aber ne Coole Sache ;-)\n"; >&2
sleep 10 sleep 10
fi fi