tis-opensc

0.20.0-5
OpenSC smartcard framework
800 downloads
Download

  Description 

  • package : tis-opensc
  • version : 0.20.0-5
  • architecture : all
  • categories : Drivers
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ
  • description : OpenSC smartcard framework
  • locale :
  • target_os : windows
  • min_wapt_version : 1.5
  • sources : https://github.com/OpenSC/OpenSC/releases
  • installed_size :
  • impacted_process : pkcs11-tool,opensc-notify,opensc-tool
  • description_fr :
  • description_pl :
  • description_de :
  • description_es :
  • description_pt :
  • description_it :
  • description_nl :
  • description_ru :
  • editor :
  • licence : LGPL
  • signature_date : 2020-07-17T14:10:53.986614
  • Homepage : https://github.com/OpenSC/OpenSC/wiki

  Setup.py 

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

uninstallkey = []

# Defining variables
bin_name_string_x64 = 'OpenSC-%s_win64.msi'
bin_name_string_x86 = 'OpenSC-%s_win32.msi'


def install():
    # Initializing variables
    package_version = control.version.split('-',1)[0]
    bin_name_x64 = bin_name_string_x64 % package_version
    bin_name_x86 = bin_name_string_x86 % package_version

    # Installing the package
    install_msi_if_needed(bin_name_x86
        ,min_version=package_version)

    if iswin64():
        install_msi_if_needed(bin_name_x64
            ,min_version=package_version)


def update_package():
    print('Download/Update package content from upstream binary sources')

    # Initializing variables
    app_name = control.name
    url_api = 'https://api.github.com/repos/OpenSC/OpenSC/releases/latest'
    proxy = get_proxies()

    # Getting latest informations from Github API
    json_load = json.loads(wgets(url_api,proxies=proxy))
    for download in json_load:
        version = json_load['tag_name']
        break

    latest_bin_x64 = bin_name_string_x64 % version
    latest_bin_x86 = bin_name_string_x86 % version
    url_dl_x64 = 'https://github.com/OpenSC/OpenSC/releases/download/' + version + '/' + latest_bin_x64
    url_dl_x86 = 'https://github.com/OpenSC/OpenSC/releases/download/' + version + '/' + latest_bin_x86

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

    # Downloading latest binaries
    if not isfile(latest_bin_x64):
        print('Downloading: ' + latest_bin_x64)
        wget(url_dl_x64,latest_bin_x64,proxies=proxy)

    if not isfile(latest_bin_x86):
        print('Downloading: ' + latest_bin_x86)
        wget(url_dl_x86,latest_bin_x86,proxies=proxy)

        # Changing version of the package
        control.version = '%s-%s'%(version,int(control.version.split('-')[-1])+1)
        control.save_control_to_wapt()
        print('Changing version to: %s in WAPT\\control' % control.version)

    # Deleting outdated binaries
    for bin_in_dir in glob.glob('*.msi'):
        if bin_in_dir != latest_bin_x64 and bin_in_dir != latest_bin_x86:
            print('Outdated binary: ' + bin_in_dir + ' Deleted')
            remove_file(bin_in_dir)


def get_proxies():
    import platform
    if platform.python_version_tuple()[0] == '3':
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()




										

  Changelog 



Changelog software url : https://github.com/OpenSC/OpenSC/releases



No changelog.txt.
									
  manifest.sha256