tis-opensc icon

OpenSC

Silent install package for OpenSC

0.25.0-6

  • package: tis-opensc
  • name: OpenSC
  • version: 0.25.0-6
  • categories: Drivers
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • licence: LGPL
  • locale: all
  • target_os: macos
  • impacted_process: pkcs11-tool,opensc-notify,opensc-tool
  • architecture: all
  • signature_date:
  • size: 166.76 Mo
  • homepage : https://github.com/OpenSC/OpenSC/wiki

package           : tis-opensc
version           : 0.25.0-6
architecture      : all
section           : base
priority          : optional
name              : OpenSC
categories        : Drivers
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : OpenSC smartcard framework
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : macos
min_wapt_version  : 2.2
sources           : https://github.com/OpenSC/OpenSC/releases
installed_size    : 
impacted_process  : pkcs11-tool,opensc-notify,opensc-tool
description_fr    : Cadre de carte à puce OpenSC
description_pl    : OpenSC smartcard framework
description_de    : OpenSC Smartcard-Framework
description_es    : Marco de la tarjeta inteligente OpenSC
description_pt    : Estrutura do OpenSC smartcard
description_it    : Quadro di riferimento per smartcard OpenSC
description_nl    : OpenSC smartcard-kader
description_ru    : Система смарт-карт OpenSC
audit_schedule    : 
editor            : 
keywords          : 
licence           : LGPL
homepage          : https://github.com/OpenSC/OpenSC/wiki
package_uuid      : 59586348-844b-4e72-bda6-50d3c7b5a460
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://github.com/OpenSC/OpenSC/releases
min_os_version    : 
max_os_version    : 
icon_sha256sum    : b80b143a5ab7954131c83e41e21b34607c7ed9a02d307f064c3099ec6a342f62
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : gezNk1Tl+602LXBzRsGiHYNQ0tDabw0bF8vjZwP/teVRIf3///nrr/v4e5guU367xw4A6jpDXTNvJXpP7kpIaaaB8pKeDrnx3yyVNgyonbuUSMB9efLN0tY6dRcyZ+yS1c+NkNQKHqmx4lc7L4uie5A9cygediZ4UiNn2fQ2x7b0lhpnnuZgNeEoMc692lkf6JBwIIxi5mspUNe+ey/7Wb0yrabMFeKsV2N6ZXca0QS02TEc5BBDg0IdQH6aa03ne1EvDbf9/7GTmKTsRT9uxpUG7XOPllHMhPQmbGlwQ/HNotBYfhqI5u/rXZ0u3I+j3CSjPai/nOl33CZ4qpGbLQ==
signature_date    : 2024-03-13T10:06:40.696634
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

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

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    install_dmg('OpenSC-%s.dmg' % control.get_software_version(),key="pkgid:org.opensc-project.mac",min_version=control.get_software_version())


def session_setup():
    pkcs11_modules_path = makepath(user_home_directory(),".pkcs11_modules")
    mkdirs(pkcs11_modules_path)

    run(rf'ln -s /Librairy/OpenSC/lib/opensc-pkcs11.so {pkcs11_modules_path}')

def uninstall():
    uninstall_pkg('org.opensc-project.mac.opensctoken')
    uninstall_pkg('org.opensc-project.mac')
    uninstall_pkg('org.opensc-project.startup')
    uninstall_pkg('org.opensc-project.tokend')

    if isdir('/Applications/Utilities/OpenSC Notify.app'):
        remove_tree('/Applications/Utilities/OpenSC Notify.app')

    if isdir('/Applications/Utilities/OpenSCTokenApp.app'):
        remove_tree('/Applications/Utilities/OpenSCTokenApp.app')
        
    if isdir('/Applications/OpenSC Uninstaller.app'):
        remove_tree('/Applications/OpenSC Uninstaller.app')

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


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()
    dmg_name_string = "OpenSC-%s.dmg"
    # 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_dmg = dmg_name_string % version
    url_dl = "https://github.com/OpenSC/OpenSC/releases/download/" + version + "/" + latest_dmg

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

    # Downloading latest binaries
    if not isfile(latest_dmg):
        print("Downloading: " + latest_dmg)
        wget(url_dl, latest_dmg, 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("*.dmg"):
        if bin_in_dir != latest_dmg:
            print("Outdated binary: " + bin_in_dir + " Deleted")
            remove_file(bin_in_dir)

96276292abca0c4e498d5b0a3b89a14d03cbc8b05ffdafb17014f066c252a0f5 : setup.py
5417186cf88a50931b6186f2c3ade95525b683e55b418eae9d56d728c76d2e51 : OpenSC-0.25.0.dmg
b361046791ce5e39dbf115fcbd9e7b510e9b1ec5f34787949d72bf5a31761675 : update_package.py
b80b143a5ab7954131c83e41e21b34607c7ed9a02d307f064c3099ec6a342f62 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
f718dbdc54ab829644a79071bf050dd4f1b9c59344af364615041a86d9d613e9 : luti.json
2ab441d35b9e1b6c9d3d575144f31bbbf0992dbbf0b6dbe68093b08223d5353d : WAPT/control