Détails du package

smp-audacity

retour Revenir à la liste des packages

smp-audacity


Version officielle sur le site de l'editeur : 3.1.3


Fichier control :

package           : smp-audacity
version           : 2.4.2-1
architecture      : all
section           : base
priority          : optional
name              : Audacity
categories        : Media
maintainer        : Tranquil IT,Jimmy PELÉ
description       : Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems.
depends           : 
conflicts         : 
maturity          : 
locale            : all
target_os         : windows
min_os_version    : 6.1
max_os_version    : 
min_wapt_version  : 1.5
sources           : https://www.audacityteam.org/download/
installed_size    : 75657216
impacted_process  : audacity.exe
description_fr    : Audacity est un logiciel d'enregistrement de son numérique et d'édition de sources audionumériques sous différents formats (mp3, Wave, AIFF, Flac, Ogg...).
description_pl    : 
description_de    : 
description_es    : Audacity es una aplicación informática multiplataforma libre, que se puede usar para grabación y edición de audio, distribuido bajo la licencia GPLv2+.
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Audacity Team
keywords          : audio,editor,recorder,multi-track,multi,track
licence           : GPLv2
homepage          : https://www.audacityteam.org
package_uuid      : e0d34f9c-94da-4ba7-a2cb-c97748356993
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 1e54425be03a2a3ea1a264b40d984c31f17a6a489a3b722acb993cbf6561e903
signature         : DEZ04KCjYCkFN9kSPp5bo12X4BOO1eDM+YxGDPU33fdwxq0GAl6c5m/uZmPnKO9OhI9bVuFp9V9OFpfjA0d580rOXXDc/9KgdxgQuP2imxNKmuC3lnlckchmCb9+QzzOgcqIJKMISji6gY+4dLgdQ6A/ekcnG7FPb3Sub9clNhRVitoiv4EiU9XSa09TWi+tsG0Eb/X6mwD2qHzehpj1aqWD+7OXB4++eqBuEuzZJpaSgIiMQSsOfZbDZ1qk0vppkmOZw8/8uZk//NdCxm5U6qikk3nbKLhcF36wQoVzsidV8BFJhYCDPIEVYk5vH4idE/XD7UKC6lvLRW0Ym1QJOg==
signature_date    : 2020-07-04T01:18:15.653870
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 -*-
from setuphelpers import *

uninstallkey = ['Audacity_is1']

# Audacity_is1  Audacity 2.3.2      2.3.2   "C:\Program Files (x86)\Audacity\unins000.exe"

def install():
    print('installing tis-audacity')

    versionpaquet = control['version'].split('-',1)[0]

    # LAME is now built in
    install_exe_if_needed("audacity-win-%s.exe" % versionpaquet,silentflags='/VERYSILENT',key='Audacity_is1',min_version=versionpaquet,killbefore="audacity.exe")

    remove_desktop_shortcut('Audacity')


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

    from waptpackage import PackageEntry

    appname = control['name']

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

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

    # Get latest version number from official website
    url = "https://www.fosshub.com/Audacity.html"
    r = requests.get(url)

    soup = BeautifulSoup.BeautifulSoup(r.text)
    version = soup.find("dd", {"itemprop" : 'softwareVersion' }).text

    # Downloading files at Fosshub with JS translation

    #https://www.fosshub.com/Audacity.html?dwl=audacity-win-2.3.2.exe
    #https://download.fosshub.com/Protected/expiretime=1562302511;badurl=aHR0cHM6Ly93d3cuZm9zc2h1Yi5jb20vQXVkYWNpdHkuaHRtbA==/9602c61a2ba412005d94d735d1c98cb318a6fddab6b4c2ea45307e098437f3c1/5b7eee97e8058c20a7bbfcf4/5cd977044525770a47e45e5d/audacity-win-2.3.2.exe

    motif = "(\.exe|\.msi)$" # $ signifie fin de chaine en regex
    mc = re.compile(motif)

    soup = BeautifulSoup.BeautifulSoup(r.text)
    for link in soup.findAll("a", {"href" : mc }):
        dl_url = link['href']

    for s in soup.findAll('script'):
        if "var settings" in s.text:
            #print("Trouvé la variable settings")
            value = s.text.replace("var settings =", "")
            break

    import json
    settings = json.loads(value)
    settings

    apiUrl = 'https://api.' + settings['domain']
    domainUrl = 'https://www.' + settings['domain']
    downloadUrl = apiUrl + '/download/'

    def downloadFile(a, b, c, d, e):
        params = {  "projectId": a,
                    "releaseId": b,
                    "projectUri": c,
                    "fileName": d,
                    "source": e}
        r = requests.post(downloadUrl, data=params)
        return r

    pool = settings['pool']
    f = pool['f']

    for c in f:
        r = downloadFile(pool['p'], c['r'], pool['u'], c['n'], pool['c'] )
        break # on s'arrête au premier
    # break

    rj = r.json()
    url_final = rj['data']['url']
    url_final

    r = requests.get(url_final)

    print('Latest ' + appname + ' version is: ' + version)

    print('Download url is: ' + url_final)

    filelatest = "audacity-win-%s.exe" % version

    # Deleting outdated binaries
    for fileactual in glob.glob('audacity-win-*.exe'):
        if fileactual != filelatest :
            print(fileactual + ' Deleted')
            remove_file(fileactual)


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

		# Change version of the package
        pe = PackageEntry()
        pe.load_control_from_wapt(os.getcwd())
        pe.version = version + '-0'
        pe.save_control_to_wapt(os.getcwd())
        print ('Update package done. You can now build-upload your package')
    else:
        print ('This package is already up-to-date')


if __name__ == '__main__':
    update_package()