From 75ba20c026a02f9eafaac7adce3c06930901e2e2 Mon Sep 17 00:00:00 2001 From: ramon Date: Tue, 21 Mar 2017 10:23:58 +0000 Subject: [PATCH] =?UTF-8?q?#718:=20Revisar=20documentaci=C3=B3n=20y=20proc?= =?UTF-8?q?eso=20de=20intalaci=C3=B3n=20de=20OGAgent;=20actualizar=20coman?= =?UTF-8?q?dos=20de=20OGAgent=20para=20macOS.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/branches/version1.1@5240 a21b9725-9963-47de-94b9-378ad31fedc9 --- INSTALL.es.txt | 32 ++++++++++++------------------- linux/build-packages.sh | 1 + macos/scripts/postinstall | 13 ++++++------- src/opengnsys/macos/operations.py | 14 +++++++------- src/update.sh | 1 + 5 files changed, 27 insertions(+), 34 deletions(-) diff --git a/INSTALL.es.txt b/INSTALL.es.txt index ff30836..3f43206 100644 --- a/INSTALL.es.txt +++ b/INSTALL.es.txt @@ -6,8 +6,8 @@ Requisitos de creación ---------------------- Sisitema operativo Linux con los siguientes paquetes instalados: - Subversion -- Python, librerías PyQt4 -- Wine (32 bits), Wine Gecko, Wine Mono, Samba Winbind, Cabextrct +- GNU C++, Python, librerías PyQt4 +- Creación de instalador Exe (Wine 32 bits, Wine Gecko, Wine Mono, Samba Winbind, Cabextrct) - Creación de paquetes Deb (debhelper, dpkg-dev) - Creación de paquetes RPM (rpm-build) - Creación de paquetes Pkg (xar, bomutils) @@ -16,26 +16,18 @@ Sisitema operativo Linux con los siguientes paquetes instalados: Crear instaladores de OGAgent ----------------------------- - Paso previo: actaulizar componentes gráficos de PyQt para OGAgnet: - cd src - ./update.sh - cd .. + src/update.sh - Crear paquetes Deb y RPM para distribuciones Linux (requiere permisos de "root"): - cd linux - sudo ./build-packages.sh - cd .. + sudo linux/build-packages.sh + +- Crear paquete Pkg para sistemas operativos macOS X: + sudo macos/build-pkg.sh - Crear el programa instalador para sistemas operativos Windows: - cd windows - ./build-windows.sh - cd .. + windows/build-windows.sh -- Crear paquete Pkg para sistemas operativos macOS: - cd macos - ./build-pkg.sh - cd .. - -- Subir los nuevos ficheros .deb, .rpm y .exe generados en el directorio +- Subir los nuevos ficheros .deb, .rpm, .pkg y .exe generados al directorio /opt/opengnsys/www/descargas del servidor OpenGnsys. @@ -79,8 +71,8 @@ Instalar OGAgent en cliente modelo - Instalar dependencias: sudo easy_install pip sudo pip install netifaces requests six - - Puede ser necesario activar descargas desde cualquier sitio en Menú / -Preferencias del sistema / Seguridad y privacidad / Pestaña General. + - Descargar e instalar el agente: + sudo installer -pkg OGAgentInstaller-Version.pkg -target / - Descargar el paquete y usar Finder pulsando sobre el fichero para instalarlo. - Configurar el agente: sed -i "0,/remote=/ s,remote=.*,remote=https://IPServidorOpenGnsys/opengnsys/rest/," /Applications/OGAgent.app/cfg/ogagent.cfg @@ -92,6 +84,6 @@ Postconfiguración para clientes clonados ---------------------------------------- - Ejecutar manualmente o configurar automáticamente OGAgent en los clientes clonados en el script de postconfiguración tras restuarar imagen: - ogConfigureOsAgent NDisco Npart + ogConfigureOgagent NDisco Npart diff --git a/linux/build-packages.sh b/linux/build-packages.sh index a0c260b..b4f1107 100755 --- a/linux/build-packages.sh +++ b/linux/build-packages.sh @@ -3,6 +3,7 @@ VERSION=1.1.0 RELEASE=1 +cd $(dirname "$0") top=`pwd` # Debian based diff --git a/macos/scripts/postinstall b/macos/scripts/postinstall index 007f77c..ebb2ca4 100755 --- a/macos/scripts/postinstall +++ b/macos/scripts/postinstall @@ -5,14 +5,13 @@ SRCDIR=$(dirname "$0") BINDIR=/usr/bin INITDIR=/Library/LaunchDaemons -# Dependencies: -#easy_install pip -#pip install netifaces requests six +# Check if it needs to install Python dependencies: +if ! which pip &>/dev/null; then + easy_install pip + pip install netifaces requests six +fi -# Copy files. +# Copying files. cp $SRCDIR/ogagent $BINDIR cp $SRCDIR/es.opengnsys.ogagent.plist $INITDIR -# Show post-installation message. -#osascript -e 'display notification "You must install following Python modules: netifaces, requests, six." with title "OGAgent Installer' - diff --git a/src/opengnsys/macos/operations.py b/src/opengnsys/macos/operations.py index 458f5a5..b2a548c 100644 --- a/src/opengnsys/macos/operations.py +++ b/src/opengnsys/macos/operations.py @@ -118,27 +118,28 @@ def getMacosVersion(): def reboot(flags=0): ''' - Simple reboot using AppleScript + Simple reboot command ''' # Workaround for dummy thread if six.PY3 is False: import threading threading._DummyThread._Thread__stop = lambda x: 42 - # Exec reboot using AppleScript. - subprocess.call('/usr/bin/osascript -e \'tell app "System Events" to restart\'', shell=True) + # Exec reboot command + subprocess.call('/sbin/shutdown -r now', shell=True) + def poweroff(flags=0): ''' - Simple poweroff using AppleScript + Simple poweroff command ''' # Workaround for dummy thread if six.PY3 is False: import threading threading._DummyThread._Thread__stop = lambda x: 42 - # Exec shutdown using AppleScript. - subprocess.call('/usr/bin/osascript -e \'tell app "System Events" to shut down\'', shell=True) + # Exec shutdown command + subprocess.call('/sbin/shutdown -h now', shell=True) def logoff(): @@ -154,7 +155,6 @@ def logoff(): subprocess.call('/usr/bin/osascript -e \'tell app "System Events" to «event aevtrlgo»\'', shell=True) - def renameComputer(newName): rename(newName) diff --git a/src/update.sh b/src/update.sh index 78147fa..1019ea8 100755 --- a/src/update.sh +++ b/src/update.sh @@ -32,6 +32,7 @@ function process { pyuic4 message-dialog.ui -o message_dialog_ui.py -x } +cd $(dirname "$0") pyrcc4 -py3 OGAgent.qrc -o OGAgent_rc.py