Détails du package

smp-libreoffice-still-lang

retour Revenir à la liste des packages

smp-libreoffice-still-lang

Fichier control :

package           : smp-libreoffice-still-lang
version           : 6.4.6-15
architecture      : x64
section           : base
priority          : optional
name              : LibreOffice Still
categories        : Office
maintainer        : Tranquil IT Systems,Jimmy PELÉ,Kevin Guerineau
description       : LibreOffice (Still Branch) is a free and open-source office suite
depends           : 
conflicts         : 
maturity          : 
locale            : fr
target_os         : linux
min_os_version    : 
max_os_version    : 
min_wapt_version  : 
sources           : https://download.documentfoundation.org/libreoffice
installed_size    : 980246528
impacted_process  : soffice,sbase,scalc,sdraw,simpress,smath,swriter
description_fr    : LibreOffice (Branche Stable) est une suite bureautique libre et gratuite
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : The Document Foundation
keywords          : bureautique,office,suite
licence           : MPLv2.0 (secondary license GPL, LGPLv3+ or Apache License 2.0)
homepage          : https://www.libreoffice.org/
package_uuid      : 2094eb5d-811f-4abf-9c21-9fa124f538b8
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 1e54425be03a2a3ea1a264b40d984c31f17a6a489a3b722acb993cbf6561e903
signature         : qWH+RZFvywP6o/u8KDGEr7XK6uXEmF//yXptCIQoZyyu6juqqXd+gxoBLJGFWtYsTOkK43ypUj7toazEnE7HDdQ7lQwxPnBFuM5Dq+4s4YA1UBKGpRaX66ojUtLQHbG2VJpoKxk8UhZ5YvKOfJd8PLKFp1ZmeARRnD7PyuPyp4wlEkxEQ1eg1FWMCUw068MR0n1j9vzFcVDIIBRJd8CphVer09hxrNZLINPFVDs6R8nY/VVq/OH3UvTmRzn2hUl8NeR83HNF2TWk1tu22ig71qE8PDZgQaP0mo1XoS4+T53X1UYCO2WxjLrJU/2eSPZr9Zkcg3RX944r81+VIQY3AA==
signature_date    : 2020-08-13T23:24:50.727200
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,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,signer,signer_fingerprint,signature_date,signed_attributes



Fichier setup.py :

# -*- coding: utf-8 -*-
import platform
from setuphelpers import *

uninstallkey = []


def install():

    isapt = True
    try:
        run('apt-get --version')
    except:
        isapt = False

    version_soft = control.version.split('-')[0]

    if isapt :
        run("tar -xf LibreOffice_%s_Linux_x86-64_deb_langpack_%s.tar.gz" % (version_soft,control.locale))
        run('dpkg -i */DEBS/*.deb')
    else:
        run("tar -xf LibreOffice_%s_Linux_x86-64_rpm_langpack_%s.tar.gz" % (version_soft,control.locale))
        run('yum install RPMS/*.rpm -y')

def uninstall():
    sversion = control.version.split('.')[0] + '.' + control.version.split('.')[1]
    run_notfatal('LANG=C DEBIAN_FRONTEND=noninteractive apt-get remove -y libreoffice%s-%s' % (sversion,control.locale))



def update_package():
      # Update transition from BeautifulSoup 3 to 4
    try:
        import bs4 as BeautifulSoup
    except:
        import BeautifulSoup
    import requests,re
    from waptpackage import PackageEntry

    # Get Proxy informations from WAPT settings
    proxies = {}
    if isfile(makepath(user_local_appdata(),'waptconsole','waptconsole.ini')):
        proxywapt = inifile_readstring(makepath(user_local_appdata(),'waptconsole','waptconsole.ini'),'global','http_proxy')
        if proxywapt :
            proxies = {'http':proxywapt,'https':proxywapt}

    verify=True
    pe = PackageEntry()
    pe.load_control_from_wapt(os.getcwd())
    current_version = pe['version'].split('-',1)[0]
    verify=True

    url = "https://www.libreoffice.org/download/download"

    # Get latest version number from official website
    page = requests.get(url,headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},verify=verify,proxies=proxies).text
    bs = BeautifulSoup.BeautifulSoup(page)
    bs_raw_string = str(bs.findAll('span',{'class':'dl_version_number'}))
    version1 = bs_raw_string
    version0 = version1.split('>',3)[3]
    version = version0.split('<',1)[0]
    print('Latest LibreOffice stable version is: '+ version)

    #https://download.documentfoundation.org/libreoffice/stable/
    #https://par.mirror.cyberbits.eu/tdf/libreoffice/stable/

    urldl = "http://download.documentfoundation.org/libreoffice/stable/%s/deb/x86_64/LibreOffice_%s_Linux_x86-64_deb_langpack_%s.tar.gz" % (version,version,control.locale)
    print('Download url is: ' + urldl)
    filelatest = "LibreOffice_%s_Linux_x86-64_deb_langpack_%s.tar.gz" % (version,control.locale)

    # Deleting outdated binaries
    for fileactual in glob.glob('*deb*.tar.gz'):
        if fileactual != filelatest :
            print(fileactual + ' Deleted')
            remove_file(fileactual)

    # Downloading latest binaires
    if not isfile(filelatest):
        print('Download ' + urldl)
        wget(urldl,filelatest,proxies=proxies)

        control.version = version + '-14'
        control.save_control_to_wapt()
        print ('Update package done. You can now build-upload your package')
    else:
        print ('This package is already up-to-date')



    urldl = "http://download.documentfoundation.org/libreoffice/stable/%s/rpm/x86_64/LibreOffice_%s_Linux_x86-64_rpm_langpack_%s.tar.gz" % (version,version,control.locale)
    print('Download url is: ' + urldl)
    filelatest ="LibreOffice_%s_Linux_x86-64_rpm_langpack_%s.tar.gz" % (version,control.locale)

    # Deleting outdated binaries
    for fileactual in glob.glob('*rpm*.tar.gz'):
        if fileactual != filelatest :
            print(fileactual + ' Deleted')
            remove_file(fileactual)

    # Downloading latest binaires
    if not isfile(filelatest):
        print('Download ' + urldl)
        wget(urldl,filelatest,proxies=proxies)
        print ('Update package done. You can now build-upload your package')
    else:
        print ('This package is already up-to-date')