tis-scribus icon

Scribus

Silent install package for Scribus

1.6.4-20

  • package: tis-scribus
  • name: Scribus
  • version: 1.6.4-20
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Simon Fonteneau,Jordan Arnaud
  • editor: The Scribus Team
  • licence: GPLv2
  • locale: all
  • target_os: linux
  • impacted_process: Scribus
  • architecture: x64
  • signature_date:
  • size: 140.36 Mo
  • installed_size: 227.02 Mo
  • homepage : https://www.scribus.net/

package           : tis-scribus
version           : 1.6.4-20
architecture      : x64
section           : base
priority          : optional
name              : Scribus
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Simon Fonteneau,Jordan Arnaud
description       : Scribus allows you to create animated and interactive presentations, PDF forms, flyers, brochures, books and magazines, and any type of document intended to be printed or viewed in digital form.
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : linux
min_wapt_version  : 2.3
sources           : https://www.scribus.net/downloads/stable-branch/
installed_size    : 227024896
impacted_process  : Scribus
description_fr    : Scribus permet de créer des présentations animées et interactives, des formulaires PDF, des dépliants, des plaquettes, des livres et des magazines, et tout type de document destiné à être imprimé ou à être visualisé sous forme numérique.
description_pl    : Scribus pozwala na tworzenie animowanych i interaktywnych prezentacji, formularzy PDF, ulotek, broszur, książek i czasopism oraz wszelkiego rodzaju dokumentów przeznaczonych do druku lub oglądania w formie cyfrowej
description_de    : Mit Scribus können Sie animierte und interaktive Präsentationen, PDF-Formulare, Flyer, Broschüren, Bücher und Zeitschriften sowie alle Arten von Dokumenten erstellen, die gedruckt oder in digitaler Form angezeigt werden sollen
description_es    : Scribus le permite crear presentaciones animadas e interactivas, formularios PDF, folletos, libros y revistas, y cualquier tipo de documento destinado a ser impreso o visto en formato digital
description_pt    : Scribus permite-lhe criar apresentações animadas e interactivas, formulários PDF, folhetos, brochuras, livros e revistas, e qualquer tipo de documento destinado a ser impresso ou visto em formato digital
description_it    : Scribus consente di creare presentazioni animate e interattive, moduli PDF, volantini, brochure, libri e riviste e qualsiasi tipo di documento destinato a essere stampato o visualizzato in formato digitale
description_nl    : Met Scribus kunt u geanimeerde en interactieve presentaties, PDF-formulieren, flyers, brochures, boeken en tijdschriften maken, en elk type document dat bedoeld is om te worden afgedrukt of in digitale vorm te worden bekeken
description_ru    : Scribus позволяет создавать анимированные и интерактивные презентации, PDF-формы, листовки, брошюры, книги и журналы, а также любые типы документов, предназначенные для печати или просмотра в цифровом виде
audit_schedule    : 
editor            : The Scribus Team
keywords          : 
licence           : GPLv2
homepage          : https://www.scribus.net/
package_uuid      : 007eb5d1-885b-4d98-8991-d1eebf9d0b5b
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://www.scribus.net/category/news/
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 72dd6053cefb8595dab8a67874385ab751896243b6954c0beae83c72a1217be2
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-04-25T23:03:50.000000
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
signature         : T/rzSZGFVGRL75/WlCD9xhPpwvg5JSJ2B761GQCF/CQ+ZUeLhlqw8xRwfmX39gAdBgcAK29Lq351WEQjYLCK/Zr7cMuvJVx8o9NpQDCIEBkqYU4P/nNMC+kxqf+IEVDqhNCyGb3MWJhZacRMLlsBEj8awxIcT96wKVOVQB3NBpuFARvaiYGbwsKAMSsrHz9R7y0QvmNLa7SqC2ubiexr2B4Eyfiidd2RC9KT/qrdxF17aKi5dbaBZxmiqas4ymrDvMRPyqoptuUGrk+pMq8nRXWTfK5MtS+5agzYYaHUB3OoLxavhUr6BAnR4H3pgYyn2iwxIqKubsJ1Uxqa87iaTQ==

# -*- 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')

        if not isfile(srcicon):
            lstglob = glob.glob(makepath('squashfs-root','*.svg'))
            if lstglob :
                srcicon=lstglob[0]

        if not isfile(srcicon):
            lstglob = glob.glob(makepath('squashfs-root','*.png'))
            if lstglob :
                srcicon=lstglob[0]
            else:
                srcicon = None

        if srcicon:            
            new_icon = install_dir + '/' + srcicon.split('/')[-1]
            filecopyto(srcicon,new_icon)
            desktop_cp.set('Desktop Entry',"Icon",new_icon) 

        desktop_cp.set('Desktop Entry',"Exec",newbin_path)
       
        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)

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
import requests


def update_package():
    # Déclaration des variables locales
    package_updated = False
    proxies = get_proxies_from_wapt_console()
    if not proxies:
        proxies = get_proxies()
    arch_dict = {
        "x64":"-linux-x86_64.AppImage",
        
    }    

    url = "https://sourceforge.net/projects/scribus/files/scribus/"
    response = requests.get(url)
    headers = bs_find_all(url,"th","headers")

    if headers:
        first_header = headers[0]
        a_tag = first_header.find("a")
        if a_tag:
            first_link = a_tag['href']
            version = first_link.split('/')[-2]
            print(f"First version found: {version}")

     # Trouver tous les éléments <tr> avec la classe file et le titre correspondant à la version
    requet = requests.get(url + version).text
    rows = bs_find_all(requet, "tr",  class_name="file")
    target_title = f"scribus-{version}{arch_dict[control.architecture]}"
    download_link = None
    for row in rows:
        if row.get('title') == target_title:
            a_tag = row.find("a", title=f"Click to download {target_title}")
            if a_tag:
                download_link = a_tag['href']
                break
    if download_link:
        print(f"Download link found: {download_link}")
   
   
    latest_bin = target_title
    download_url = download_link


     # Downloading latest binaries
    print("Latest %s version is: %s" % (control.name, version))
    print("Download URL is: %s" % download_url)
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies)
    else:
        print("Binary is present: %s" % latest_bin)

    # Deleting outdated binaries
    remove_outdated_binaries(latest_bin)

    control.set_software_version(version)
    control.save_control_to_wapt()

    # Validating update-package-sources
    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
218a276e49d5ade77225ddde60827f34b44d70d69fff8533d3c01490a992a6e8 : WAPT/control
72dd6053cefb8595dab8a67874385ab751896243b6954c0beae83c72a1217be2 : WAPT/icon.png
09a8356585cb6858a4bed6230a156c9e87f75cebe9b49cadf62936a72733b2e3 : luti.json
9c32cc94242f83914a83fb004aaf23b44625b3b94d82e0543f51ce7ebce10e3c : scribus-1.6.4-linux-x86_64.AppImage
223fa6ca0b4ed15f7d1a2e29893619511e043c7907d145e8c8991405677bb4e1 : setup.py
fc28aeff6a0cc689d4246f7732b92af8ec81ee27c315eb6267a4fd065e228e4c : update_package.py