se adecua el generarDeb
This commit is contained in:
parent
d4c6f60e69
commit
b9e96c5dc0
@ -7,7 +7,7 @@ GenericName=EMA Libre
|
||||
Comment=Estación Meteorológica Automática Libre
|
||||
Categories=Utility;
|
||||
Icon=/usr/share/emalibre/gui_common/iconos/icono_app.png
|
||||
Actions=RootWindow;Window
|
||||
Actions=RootWindow;Window;
|
||||
|
||||
[Desktop Action Window]
|
||||
Name=EmaLibre
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import nwbuild from 'nw-builder';
|
||||
import {readFileSync} from 'node:fs';
|
||||
import {readFileSync, renameSync, writeFileSync} from 'node:fs';
|
||||
const runtime = JSON.parse(readFileSync(new URL('./src/runtime.json', import.meta.url)));
|
||||
await nwbuild({
|
||||
mode: 'build', srcDir: './src', glob: false,
|
||||
@ -7,4 +7,12 @@ await nwbuild({
|
||||
outDir: './build/emalibre', zip: false,
|
||||
app: {name: 'emalibre'}
|
||||
});
|
||||
// Mantener el runtime junto a sus bibliotecas y arrancar desde la raíz de la app.
|
||||
renameSync('./build/emalibre/emalibre', './build/emalibre/nw');
|
||||
writeFileSync('./build/emalibre/emalibre', `#!/bin/sh
|
||||
set -eu
|
||||
APP_DIR=$(dirname "$(readlink -f "$0")")
|
||||
cd "$APP_DIR/package.nw"
|
||||
exec "$APP_DIR/nw" . "$@"
|
||||
`, {mode: 0o755});
|
||||
console.log('Correcto!');
|
||||
|
||||
@ -186,6 +186,9 @@ log_ok " --> OK."
|
||||
|
||||
log_info "2) Copiando los fuentes de EMA Libre para 64 bits."
|
||||
sudo cp -R "$EMALIBRE_DIR/"* "$DEB_DIR/usr/share/emalibre/"
|
||||
# Las plantillas también se usan para web, cuya raíz no contiene package.nw.
|
||||
sudo sed -i 's|^Icon=.*|Icon=/usr/share/emalibre/package.nw/gui_common/iconos/icono_app.png|; s|^Actions=.*|Actions=RootWindow;Window;|' "$DEB_DIR/usr/share/applications/emalibre.desktop"
|
||||
sudo sed -i 's|^icon=.*|icon="/usr/share/emalibre/package.nw/gui_common/iconos/icono_app.png"|' "$DEB_DIR/usr/share/menu/emalibre"
|
||||
log_ok " --> OK."
|
||||
|
||||
log_info "3) Reemplazando el archivo de control DEB."
|
||||
@ -199,9 +202,7 @@ sudo chown -R root:root "$DEB_DIR"
|
||||
log_ok " --> OK."
|
||||
|
||||
log_info "5) Generando enlaces simbólicos del binario."
|
||||
cd "$DEB_DIR/usr/bin/"
|
||||
sudo ln -sf ../share/emalibre/emalibre emalibre
|
||||
cd ../../..
|
||||
sudo ln -sf ../share/emalibre/emalibre "$DEB_DIR/usr/bin/emalibre"
|
||||
log_ok " --> OK."
|
||||
|
||||
log_info "6) Eliminando node/web/express/forever/servicio para modo GUI y la interfaz para el modo web."
|
||||
@ -217,9 +218,7 @@ log_ok " --> OK."
|
||||
|
||||
log_info "7) Generando Paquete DEB para GUI 64 bits Linux."
|
||||
#sudo dpkg -b Deb64 debs/"emalibre-gui-linux_$VERSION.deb"
|
||||
sudo dpkg-deb -Zxz -b Deb64 debs/"emalibre-gui-linux_$VERSION.deb"
|
||||
|
||||
cd ..
|
||||
sudo dpkg-deb -Zxz -b "$DEB_DIR" "$DEBS_OUT/emalibre-gui-linux_$VERSION.deb"
|
||||
mv "$TMP_DIR/init.d" "$DEB_DIR/etc" 2>/dev/null || true
|
||||
mv "$TMP_DIR/emalibre_modo" "$DEB_DIR/etc/emalibre_modo" 2>/dev/null || true
|
||||
log_final " Finalizó con éxito, build/debs/emalibre-gui-linux_$VERSION.deb."
|
||||
@ -258,6 +257,7 @@ log_ok " --> OK."
|
||||
|
||||
log_info "3) Remplazando el archivo de control DEB."
|
||||
sudo cp -f "$CONTROL_DEB/control_linux_web" "$DEB_DIR/DEBIAN/control"
|
||||
sudo sed -i 's|/emalibre/package.nw/gui_common/|/emalibre/gui_common/|' "$DEB_DIR/usr/share/applications/emalibre.desktop" "$DEB_DIR/usr/share/menu/emalibre"
|
||||
log_ok " --> OK."
|
||||
|
||||
log_info "4) Aplicando permisos necesarios."
|
||||
|
||||
Loading…
Reference in New Issue
Block a user