tis-opale icon

opale

Paquet d’installation silencieuse pour opale

24.0.0-1

  • package: tis-opale
  • name: opale
  • version: 24.0.0-1
  • maintainer: Jordan ARNAUD
  • licence: MPL-2.0, GPL-3.0-only, LGPL-3.0-only, CECILL-2.1
  • locale: fr
  • target_os: linux
  • architecture: x64
  • signature_date:
  • size: 233.21 Mo
  • homepage : https://download.scenari.software/

package           : tis-opale
version           : 24.0.0-1
architecture      : x64
section           : base
priority          : optional
name              : opale
categories        : 
maintainer        : Jordan ARNAUD
description       : Opale enables you to create pedagogical documents for classroom, distance or blended training
depends           : 
conflicts         : 
maturity          : PROD
locale            : fr
target_os         : linux
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Opale permet de créer des documents pédagogiques pour la formation présentielle, à distance ou mixte
description_pl    : Opale może być używany do tworzenia dokumentów dydaktycznych do nauczania w klasie, na odległość lub w trybie mieszanym
description_de    : Opale ermöglicht die Erstellung von Unterrichtsmaterialien für Präsenz-, Fern- und Blended-Learning-Kurse
description_es    : Opale permite crear documentos didácticos para la enseñanza presencial, a distancia o semipresencial
description_pt    : O Opale pode ser utilizado para criar documentos pedagógicos para o ensino presencial, à distância ou misto
description_it    : Opale può essere utilizzato per creare documenti didattici per l'apprendimento in aula, a distanza o misto
description_nl    : Opale kan worden gebruikt om lesdocumenten te maken voor klassikaal leren, leren op afstand of blended learning
description_ru    : Opale можно использовать для создания учебных документов для аудиторного, дистанционного или смешанного обучения
audit_schedule    : 
editor            : 
keywords          : 
licence           : MPL-2.0, GPL-3.0-only, LGPL-3.0-only, CECILL-2.1
homepage          : https://download.scenari.software/
package_uuid      : 313a0935-1235-4ce7-bee9-1695e9d5a0cd
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 8af7c92e52b3d762613fd95757228df955329f7c9f34b5ca767e5ae791d950b2
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : cyVNUimf+gi+CgvRE2s2S3UcpL205gBrFOgCZLdL/Eulifm0BD5sSKg1Lom1zin/DDdiS8Bjb6TEgEhlSkLCQNgDj3doWSQXFZICUc7CEuXMLtXO2QrIKZcU+5o08t9ppm5mtPj/O0sSTsaK50ICaQHyoSxkhXpOkUt1pMHMTpTg5FZcWWDe0Ul3sgbQrUbtKI6oW9eiKT87yAn9s1KqAewLIe1sIOuXXmEYKZn7FUu8ry9dZA2B6b2Wa++VT5k132Lz3/feRFlv7jc7CLNI26i4IGKo0s9C4vFUs/bQoyi+94V8AgnciNOtihqVyhOrjQD9mD2two46S7P3jdB1ug==
signature_date    : 2024-08-31T13:01:14.900190
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes

# -*- coding: utf-8 -*-
##################################################
# This file is part of WAPT Enterprise
# All right reserved, (c) Tranquil IT Systems 2024
# For more information please refer to
# https://wapt.tranquil.it/store/licences.html
##################################################
from setuphelpers import *
from iniparse import ConfigParser
import os


def install():
    install_dir = makepath('/','opt',control.package.split('-',1)[1])
    appimage = glob.glob("*.AppImage")[0]
    install_appimage(appimage,install_dir)

def uninstall():
    install_dir = makepath('/','opt',control.package.split('-',1)[1])
    uninstall_appimage(install_dir)

def install_appimage(appimage,install_dir,binaliasname=None):
    run('chmod a+x ./' + appimage)

    if isdir(install_dir):
        uninstall_appimage(install_dir)

    mkdirs(install_dir)

    name_appimage = appimage.split('/')[-1]
    filecopyto(appimage, makepath(install_dir, name_appimage))
    run('"./%s" --appimage-extract' % appimage)
    

    for desktop in glob.glob(makepath('squashfs-root','*.desktop')):
 
        desktop_cp = ConfigParser()
        desktop_cp.optionxform = str
        desktop_file = open(desktop, encoding="utf-8")
        desktop_cp.readfp(desktop_file)
        bin_path = desktop_cp.get('Desktop Entry',"Exec")

        newbin_path = install_dir + '/' + name_appimage
        if ' %' in bin_path:
            newbin_path = newbin_path + ' %' + bin_path.split(' %',1)[1]

        icon_path = desktop_cp.get('Desktop Entry',"Icon")

        srcicon = makepath('squashfs-root',icon_path +'.svg')
        if not isfile(srcicon):
            srcicon = makepath('squashfs-root',icon_path +'.png')
        new_icon = install_dir + '/' + srcicon.split('/')[-1]
        filecopyto(srcicon,new_icon)

        desktop_cp.set('Desktop Entry',"Exec",newbin_path)
        desktop_cp.set('Desktop Entry',"Icon",new_icon)        
        with open(desktop, 'w', encoding="utf-8") as f:
            desktop_cp.write(f)

        pathdesk = makepath(install_dir,desktop.split('/')[-1])
        filecopyto(desktop, pathdesk)
        run('chown root:root "%s" ' % pathdesk)

    for f in glob.glob(makepath(install_dir,'*.desktop')):
        run('ln -sf "%s" "/usr/share/applications/%s"' % (f,f.split('/')[-1]))

    if binaliasname :
        run(f"ln -sf {install_dir}/{name_appimage} /usr/bin/{binaliasname}")

    remove_tree('squashfs-root')

def uninstall_appimage(install_dir):

    if not glob.glob(makepath(install_dir,'*.desktop')):
        error('.desktop not found')

    for f in glob.glob(makepath(install_dir,'*.desktop')):
        deskfile = f.split('/')[-1]
        system_desktop = makepath("/","usr","share","applications",deskfile)
        if isfile(system_desktop):
            remove_file(system_desktop)
    remove_tree(install_dir)

import urllib.parse
import os
from setuphelpers import *
from setupdevhelpers import *
import glob
import requests

def update_package():
    # Declare local variables
    package_updated = False
    proxies = get_proxies_from_wapt_console()
    if not proxies:
        proxies = get_proxies()

    lang_dict = {'en': 'en-US', 'fr': 'fr-FR'}

    lang = control.locale
    url_base = "https://download.scenari.software/Opale/?productInfos"
    response = requests.get(url_base, proxies=proxies, allow_redirects=True)
    response.raise_for_status()

    # Assuming the response is a JSON containing product information
    product_info = response.json()
    version = response.json()['v']

    # Compose the dynamic URL with the latest version
    url_version = f"https://download.scenari.software/Opale@{version}/?productInfos"
    response = requests.get(url_version, proxies=proxies, allow_redirects=True)
    response.raise_for_status()

    # Assuming the response is a JSON containing file information
    product_files_info = response.json()
    
    # Search for the .exe file for Windows corresponding to the language of control.locale
    exe_file = None
    if 'ch' in product_files_info:
        for file in product_files_info['ch']:
            if isinstance(file, dict) and file['n'].endswith('.AppImage') and file['metas']['os'] == 'linux' and file['metas']['lang'] == lang_dict[control.locale]:
                exe_file = file['metas']['path']
                break
    else:
        raise ValueError("The format of the file information is incorrect. Expected: key 'ch' in the dictionary.")

    if not exe_file:
        raise ValueError(f"Unable to find the .exe file for Windows corresponding to the language {control.locale}.")

    url_download = f"https://download.scenari.software{exe_file}"
    filename = exe_file.split('/')[-1]
    if not isfile(filename):
        package_updated = True
        wget(url_download, filename, proxies=proxies)
        print("download:", filename)

    for f in glob.glob("*.AppImage"):
        if f != filename:
            remove_file(f)
 
    control.set_software_version(version)
    control.save_control_to_wapt()

    return package_updated

6b085809251e32996c6e09a3155a9e77c74032428c54945f2b94f1b6c02f45f8 : setup.py
e9fb4c8fa23755320049dbead57dceeeb09fe8a56771f213bd321612d7ec5f4e : update_package.py
8af7c92e52b3d762613fd95757228df955329f7c9f34b5ca767e5ae791d950b2 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
3780583982e860f1e7e28de7cb80cfd809b7ce0a2920089aa4c3a4beba655408 : luti.json
5079cda204d4b06fb458483b279764a65fbaca812d629392da7fc32d2a6a1c24 : Opale24_fr-FR.AppImage
f500f6810e1c603cdb2593c1593b87ff13345a558b58b5c876d7d8c871fcf5f2 : WAPT/control