tis-kate icon

Kate

Silent install package for Kate

26.8-3

  • package: tis-kate
  • name: Kate
  • version: 26.8-3
  • maintainer: Jordan Arnaud
  • licence: GNU LIBRARY GENERAL PUBLIC LICENSE
  • target_os: linux
  • impacted_process: kate
  • architecture: x64
  • signature_date:
  • size: 226.94 Mo
  • homepage : https://kate-editor.org/

package           : tis-kate
version           : 26.8-3
architecture      : x64
section           : base
priority          : optional
name              : Kate
categories        : 
maintainer        : Jordan Arnaud
description       : Kate is a programmer's text editor by KDE. It features stuff like codefolding, syntaxhighlighting, dynamic word wrap, an embedded console, an extensive plugin interface and some prelimentary scripting support
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : linux
min_wapt_version  : 2.5
sources           : https://cdn.kde.org/ci-builds/utilities/kate/
installed_size    : 
impacted_process  : kate
description_fr    : Kate est un éditeur de texte pour programmeurs créé par KDE. Il propose des fonctionnalités telles que le pliage de code, la mise en évidence de la syntaxe, l'habillage dynamique des mots, une console intégrée, une interface de plugin étendue et un support de script prélimentaire
description_pl    : Kate to edytor tekstu dla programistów stworzony przez KDE. Oferuje takie funkcje jak składanie kodu, podświetlanie składni, dynamiczne zawijanie słów, wbudowaną konsolę, rozbudowany interfejs wtyczek i wstępną obsługę skryptów
description_de    : Kate ist ein Texteditor für Programmierer von KDE. Er bietet Funktionen wie Codefolding, Syntaxhighlighting, dynamischen Zeilenumbruch, eine eingebettete Konsole, eine umfangreiche Plugin-Schnittstelle und einige zusätzliche Skriptunterstützung
description_es    : Kate es un editor de texto para programadores de KDE. Cuenta con cosas como codefolding, syntaxhighlighting, dynamic word wrap, una consola incrustada, una extensa interfaz de plugins y algún soporte de scripting preliminar
description_pt    : Kate é um editor de texto para programadores do KDE. Possui funcionalidades como codefolding, syntaxhighlighting, word wrap dinâmico, uma consola incorporada, uma extensa interface de plugins e algum suporte de scripting preliminar
description_it    : Kate è un editor di testo per programmatori di KDE. Presenta elementi come il codefolding, l'evidenziazione della sintassi, il word wrap dinamico, una console integrata, un'ampia interfaccia di plugin e un supporto prelimentare per lo scripting
description_nl    : Kate is een teksteditor voor programmeurs van KDE. Het heeft dingen zoals codefolding, syntaxishighlighting, dynamische woordomloop, een ingebedde console, een uitgebreide plugin-interface en wat aanvullende ondersteuning voor scripts
description_ru    : Kate - это текстовый редактор для программистов от KDE. В нем есть такие функции, как сворачивание кода, подсветка синтаксиса, динамическое обертывание слов, встроенная консоль, обширный интерфейс плагинов и предварительная поддержка скриптов
audit_schedule    : 
editor            : 
keywords          : 
licence           : GNU LIBRARY GENERAL PUBLIC LICENSE
homepage          : https://kate-editor.org/
package_uuid      : 6a4c25fd-c660-460e-9470-5c0685f467bf
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 0ffe006104cc5ea9983eddbaa1eb6a9c4b0d485fad5de738764cef0624cf767b
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2026-09-06T10:10:47.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         : Y9fWsq/QhHOCD/heV5trPcqEdzWBDrL+XTwme7h7JasDoLrT0qySmipr6zBco2nDfxh4GAHCm6GWKQ0rk1UnSqPVRdQ6JonNgQ2Q12ulBUlFIZuLerFgXwA6Vlf2iT4DzOyOHVwTzDcG+miStgK6kWrIQo27afk0U/K6HdeVOAxIL13Vj92Sj2peAeJMmleT9T9cGMJQm63nRglG/ubvrgmlb7aYXmRcM0CWhw8A0+ROQ4IhOKavtPAxOzzU0zyMXGft+O3PxLIve9czFnB36hEs/tBlkma0XzUE4PqtKPdRvWVGvk+eMS7hfMtjx3XENqyDivd1b8MRj2qprGwe4w==

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

from setuphelpers import *
from setupdevhelpers import *


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name

    base_url = "https://cdn.kde.org/ci-builds/utilities/kate/"
    os_download_dict = { 'linux-x64': 'x86_64.AppImage'}
    os_type = control.target_os + "-" + ensure_list(control.architecture)[0]

    versions = [ i.get_text(strip=True) for i in bs_find_all(base_url, "a", "href", proxies=proxies) if 'release' in i.get_text(strip=True) ]
    sorted_release = sorted(versions, key=lambda x: Version(x.split('-')[-1].strip('/')), reverse=True)

    latest_release_url = None
    for release in sorted_release:
        url = base_url + release + control.target_os
        if requests.head(url).ok:
            latest_release_url = url
            version = release.split('-')[-1].strip('/')
            break

    print(f"Latest {app_name} version is: {version}")

    for i in bs_find_all(latest_release_url, "a", "href", proxies=proxies):
        bin_name = i.get_text(strip=True)
        if bin_name.endswith(os_download_dict[os_type]):
            download_url = f"{latest_release_url}/{bin_name}"

    latest_bin = download_url.rsplit('/', 1)[-1]
    latest_bin_extension = latest_bin.rsplit('.', 1)[-1]

    # Downloading latest binaries
    print(f"Download URL is: {download_url}")
    if isfile(latest_bin):
        remove_file(latest_bin)

    print(f"Downloading: {latest_bin}")
    wget(download_url, latest_bin, proxies=proxies)
    print(f"Binary is present: {latest_bin}")

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print(f"Software version updated (from: {control.get_software_version()} to: {Version(version)})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({Version(version)})")

    for f in glob.glob(f'*.{latest_bin_extension}'):
        if f != latest_bin:
            remove_file(f)

    control.set_software_version(version)
    control.save_control_to_wapt()

    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
8c760a39d77bf5f3b82426ab0a2b88175077ebe07ee167e4d66ed84f3c7cb43c : WAPT/control
0ffe006104cc5ea9983eddbaa1eb6a9c4b0d485fad5de738764cef0624cf767b : WAPT/icon.png
4625483a5f81bab184bf0841e5b652ebd983bb2ebeeebbeb5d5262ee2beac4ed : kate-release_26.08-12232-linux-gcc-x86_64.AppImage
887d1dddb3b99538b0e6b76d5b8b06e6bb32d9bce08cef6e72bee0242bdc5834 : luti.json
223fa6ca0b4ed15f7d1a2e29893619511e043c7907d145e8c8991405677bb4e1 : setup.py
b6fcbebb97d9f828a3c6d3b25c68f726cea50daf1f8242d3c6e159e67f6f2445 : update_package.py