diff --git a/INSTALL.es.txt b/INSTALL.es.txt index 4aebb8d..8b4d477 100644 --- a/INSTALL.es.txt +++ b/INSTALL.es.txt @@ -10,6 +10,7 @@ Sisitema operativo GNU/Linux con los siguientes paquetes instalados: - 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) Crear instaladores de OGAgent @@ -29,6 +30,11 @@ Crear instaladores de OGAgent ./build-windows.sh cd .. +- Crear paquetes Deb y RPM para distribuciones GNU/Linux (requiere permisos de "root"): + cd macos + ./build-pkg.sh + cd .. + - Subir los nuevos ficheros .deb, .rpm y .exe generados en el directorio /opt/opengnsys/www/descargas del servidor OpenGnsys. @@ -69,6 +75,9 @@ Instalar OGAgent en cliente modelo - Iniciar el servicio (se iniciará automáticamente en el proceso de arranque): NET START OGAgent +- macOS: + (en preparación) + Postconfiguración para clientes clonados ---------------------------------------- diff --git a/macos/Makefile b/macos/Makefile deleted file mode 100644 index 3ef254d..0000000 --- a/macos/Makefile +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- - -# Directories -SOURCEDIR := ../src -DESTDIR := /usr/local -LIBDIR := $(DESTDIR)/share/OGAgent -BINDIR := $(DESTDIR)/bin -SBINDIR = $(DESTDIR)/sbin -#APPSDIR := $(DESTDIR)/usr/share/applications -CFGDIR := $(DESTDIR)/etc/ogagent -INITDIR := /Library/LaunchDaemons -#XDGAUTOSTARTDIR := $(DESTDIR)/etc/xdg/autostart -#KDEAUTOSTARTDIR := $(DESTDIR)/usr/share/autostart - -PYC := $(shell find $(SOURCEDIR) -name '*.py[co]') -CACHES := $(shell find $(SOURCEDIR) -name '__pycache__') - -clean: - rm -rf $(PYC) $(CACHES) - -install: - dependencies - install-ogagent - -dependencies: - easy_install pip # Si no existe pip. - # comprobar versión de six, descargar e instalar con easy_install. - easy_install netifaces - -install-ogagent: - mkdir -p $(LIBDIR) - mkdir -p $(BINDIR) - mkdir -p $(SBINDIR) - mkdir -p $(CFGDIR) - - mkdir -p $(LIBDIR)/img - - # Cleans up .pyc and cache folders - rm -f $(PYC) $(CACHES) - - cp -r $(SOURCEDIR)/opengnsys $(LIBDIR)/opengnsys - cp -r $(SOURCEDIR)/cfg $(LIBDIR)/cfg - cp $(SOURCEDIR)/img/oga.png $(LIBDIR)/img - - cp $(SOURCEDIR)/OGAgentUser.py $(LIBDIR) - # QT Dialogs & resources - #cp $(SOURCEDIR)/*_ui.py $(LIBDIR) - #cp $(SOURCEDIR)/OGAgent_rc.py $(LIBDIR) - - # Autostart elements for gnome/kde - #cp desktop/OGAgentTool.desktop $(XDGAUTOSTARTDIR) - #cp desktop/OGAgentTool.desktop $(KDEAUTOSTARTDIR) - - # scripts - cp scripts/ogagent $(BINDIR) - cp scripts/OGAgentTool-startup $(BINDIR) - cp scripts/OGAgentTool $(BINDIR) - cp scripts/es.opengnsys.ogagent.plist $(INITDIR) - - # Fix permissions - chmod 755 $(BINDIR)/ogagent - chmod 755 $(BINDIR)/OGAgentTool-startup - chmod 755 $(LIBDIR)/OGAgentUser.py - chmod 600 $(LIBDIR)/cfg/ogagent.cfg - - ln -fs $(LIBDIR)/cfg/ogagent.cfg $(CFGDIR) - ln -fs $(LIBDIR)/cfg/ogclient.cfg $(CFGDIR) - -uninstall: - rm -rf $(LIBDIR) - rm -f $(BINDIR)/ogagent $(BINDIR)/OGAgent-Tool* - rm -rf $(CFGDIR) diff --git a/macos/build-pkg.sh b/macos/build-pkg.sh new file mode 100755 index 0000000..9338bd2 --- /dev/null +++ b/macos/build-pkg.sh @@ -0,0 +1,84 @@ +#!/bin/bash +# Create macOS installation packages. +# Based on bomutils tutorail: http://bomutils.dyndns.org/tutorial.html + +VERSION=1.1.0 +AUTHOR="OpenGnsys Project" + +# Create directories. +mkdir build && cd build +mkdir -p flat/base.pkg flat/Resources/en.lproj +mkdir -p root/Applications + +# Copy application and script files. +cp -r ../../src root/Applications/OGAgent.app +cp -r ../scripts . + +# Create plist file. +cat << EOT > root/Applications/OGAgent.app/OGAgent.plist + + + + + BuildAliasOf + OGAgent + BuildVersion + $VERSION + $AUTHOR + + +EOT + +# Add files in the base package. +( cd root && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > flat/base.pkg/Payload + +# Create PackageInfo file. +cat << EOT > flat/base.pkg/PackageInfo + + + + + + + + + +EOT + +# Compress the scripts folder. +( cd scripts && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > flat/base.pkg/Scripts + +# Create BOM file. +mkbom -u 0 -g 80 root flat/base.pkg/Bom + +# Create Distribution file. +cat << EOT > flat/Distribution + + + OGAgent 1.1.0 + + + + + + + + + + + #base.pkg + +EOT + +# Create Xar application archive. +( cd flat && xar --compression none -cf "../../../OGAgent-$VERSION Installer.pkg" * ) + diff --git a/macos/scripts/OGAgentTool b/macos/scripts/OGAgentTool deleted file mode 100644 index a285f33..0000000 --- a/macos/scripts/OGAgentTool +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -FOLDER=/usr/local/share/OGAgent - -cd $FOLDER -python OGAgentUser.py $@ diff --git a/macos/scripts/OGAgentTool-startup b/macos/scripts/OGAgentTool-startup deleted file mode 100644 index db00092..0000000 --- a/macos/scripts/OGAgentTool-startup +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -# Simple hack to wait for systray to be present -# Exec tool if not already runned by session manager -ps -ef | grep "$USER" | grep -v grep | grep -v OGAgentTool-startup | grep 'OGAgentTool' -q -# If not already running -if [ $? -eq 1 ]; then - sleep 5 - exec /usr/local/bin/OGAgentTool -fi diff --git a/macos/scripts/ogagent b/macos/scripts/ogagent old mode 100644 new mode 100755 index 5804a4b..b139d7f --- a/macos/scripts/ogagent +++ b/macos/scripts/ogagent @@ -1,6 +1,6 @@ #!/bin/sh -FOLDER=/usr/local/share/OGAgent +FOLDER=/Applications/OGAgent.app cd $FOLDER python -m opengnsys.linux.OGAgentService $@ diff --git a/macos/scripts/postinstall b/macos/scripts/postinstall new file mode 100755 index 0000000..8d80e70 --- /dev/null +++ b/macos/scripts/postinstall @@ -0,0 +1,19 @@ +#!/usr/bin/env sh + +# Directories +SRCDIR=$(dirname "$0") +BINDIR=/usr/local/bin +INITDIR=/Library/LaunchDaemons + +# Dependencies: +#easy_install pip # Si no existe pip. +# comprobar versión de six, descargar e instalar con easy_install. +#easy_install netifaces + +# Copi files. +cp $SRCDIR/ogagent $BINDIR +cp $SRCDIR/es.opengnsys.ogagent.plist $INITDIR + +# Show post-install message. +osascript -e 'display notification "You must update Python Six from sourece and install netifaces module." with title "OGAgent Installer' +