Détails du package smp-ldapadmin_1.8.3-11_all.wapt
retour Revenir à la liste des packages

smp-ldapadmin

ATTENTION CE DÉPÔT n'est plus compatible 1.3 vous devez migrer en 1.5.1.21 !

Fichier control :

package           : smp-ldapadmin
version           : 1.8.3-11
architecture      : all
section           : base
priority          : optional
maintainer        : Simon Fonteneau
description       : Ldap Admin is a free Windows LDAP client and administration tool for LDAP directory management.
depends           : 
conflicts         : 
maturity          : 
locale            : 
target_os         : windows
min_os_version    : 
max_os_version    : 
min_wapt_version  : 
sources           : 
installed_size    : 4194304
impacted_process  : LdapAdmin.exe
description_fr    : Ldap Admin est un client LDAP Windows opensource et un outil d’administration pour la gestion des annuaires LDAP.
description_pl    : Ldap Admin to darmowe narzędzie klienckie i administracyjne LDAP dla systemu Windows do zarządzania katalogami LDAP
description_de    : Ldap Admin ist ein kostenloser Windows LDAP Client und Administrationswerkzeug für LDAP Verzeichnisverwaltung
description_es    : Ldap Admin es una herramienta de administración y cliente LDAP de Windows gratuita para la administración de directorios LDAP
audit_schedule    : 
editor            : 
keywords          : ldap
licence           : GNU General Public License
homepage          : http://www.ldapadmin.org/
package_uuid      : f0f9cc03-858f-47b9-9296-0b4f0fa3f6d0
signer            : wapt.lesfourmisduweb.org
signer_fingerprint: 8da83ebdac1a25e820b186510d049f47407b11835b0664fdc5bacd3595b1671d
signature         : QbtaLKrp+gPnNMhT3xdQkiHql7M3bYXhfdtEpWq3wO1RS44N7NPHneKt0x3/GsTsWA/2s98gWG20md/dnitKkXLy8YJYgh8D0FDr6dQLfGvbIOnCex0URfjpTA5rlNRw6Pyov5Q3DktOuhL3CsRtl4jngbLFtBq0K0LzaNM8uIb2lN0C63SKgpM6a2Kl/KLjGuwU2CbFEWKNOEAphIWpADDpQVyCJLKnc6fplCTuiWilf9n2q+BVs+tMtTyyCTSNGMNqq5z6kELP07C1i+Yotg0l7F894YtfXOnhfUliQx1OVARE/hemji/Jmj+hQJUGcJiHUWexH4rpBuvPXcMwhQ==
signature_date    : 20181020-130154
signed_attributes : package,version,architecture,section,priority,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,audit_schedule,editor,keywords,licence,homepage,package_uuid,signer,signer_fingerprint,signature_date,signed_attributes






Fichier setup.py :

# -*- coding: utf-8 -*-
from setuphelpers import *
import re
import glob
import pefile
import os
from waptpackage import PackageEntry

uninstallkey = []

install_dir = 'ldapadmin'
applabel = "LDAPAdmin"


def find_exes(root):
    """ Returns all .exe in root directory and subdirs"""
    result = []
    for entry in os.listdir(root):
        if os.path.isdir(entry):
            result.extend(find_exes(makepath(root,entry)))
        elif glob.fnmatch.fnmatch(entry,'*.exe'):
            result.append(makepath(root,entry))
    return result

def sort_path_length(exes):
    return sorted(exes,key=lambda a:len(os.path.splitext(a)))

def find_app(adir):
    exes = sorted(sort_path_length(find_exes(adir)),key = lambda a: -os.stat(a).st_size)
    return exes[0]

"""
Available template vars:
    packagename
    uninstallkey
    silentflags
    installer
    product
    description
"""

def install():
    global applabel

    app = find_app(install_dir)
    destdir = makepath(programfiles32,install_dir)
    print('Installing ldapadmin into {}'.format(destdir))
    mkdirs(destdir)
    copytree2(install_dir,destdir)
    create_programs_menu_shortcut('{}.lnk'.format(applabel),makepath(destdir,os.path.basename(app)))

    register_uninstall(applabel,'wapt-get uninstall %s' % control.package,display_name=applabel,display_version=control.version.split('-',1)[0])

    if iswin64() :
        root = "Software\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
    else:
        root = "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
    with reg_openkey_noredir(HKEY_LOCAL_MACHINE,"%s\\%s" % (root,applabel),sam=KEY_ALL_ACCESS,create_if_missing=True) as appkey:
        reg_setvalue(appkey,'DisplayIcon',makepath(destdir,os.path.basename(app)))


def uninstall():
    global applabel
    if applabel is not None:
        remove_programs_menu_shortcut(applabel)
    unregister_uninstall(applabel)

def update_package():
    htmlsource = wgets('http://www.ldapadmin.org/download/ldapadmin.html')
    for line in htmlsource.splitlines() :
        if 'LdapAdminExe' in line:
            version = line.split('LdapAdminExe-w32-')[1].split('.zip')[0]
            linkdownload = line.split("href='")[1].split("'>LdapAdminExe")[0]
            break

    for exe in glob.glob(r'ldapadmin\*.exe'):
        if get_file_properties(exe)['ProductVersion'] != version:
            remove_file(exe)

    if not isfile(r'LdapAdmin\LdapAdmin.exe'):
        print('New version : %s' % version)
        wget(linkdownload,'LdapAdminExe-w32-%s.zip' % version)

        unzip('LdapAdminExe-w32-1.8.3.zip')
        remove_file('LdapAdminExe-w32-%s.zip' % version)

        os.rename(r'LdapAdminExe-w32-%s\LdapAdmin.exe' % version,r'ldapadmin\LdapAdmin.exe')
        remove_tree('LdapAdminExe-w32-%s' % version)



        os.chdir(os.path.dirname(__file__))

        from waptpackage import PackageEntry
        pe = PackageEntry()
        pe.load_control_from_wapt(os.getcwd())

        pe.version = version + '-0'
        pe.save_control_to_wapt(os.getcwd())
    else:
        print('Already up to date')





if __name__ == '__main__':
    update_package()