Adapt for TB x64

master
Daniel Berteaud 6 years ago
parent ca0daec60d
commit 9af684495e
  1. 16
      WAPT/control
  2. 27
      setup.py

@ -1,11 +1,11 @@
package : fws-thunderbird-sogo-addons package : fws-thunderbird-sogo-addons
version : 1 version : 2
architecture : all architecture : all
section : base section : base
priority : optional priority : optional
maintainer : Daniel Berteaud <daniel@firewall-services.com> maintainer : Daniel Berteaud <daniel@firewall-services.com>
description : SOGo addons for Thunderbird description : SOGo addons for Thunderbird
depends : fws-thunderbird,fws-7zip depends : fws-thunderbird,fws-7zip,fws-thunderbird-config
conflicts : conflicts :
maturity : DEV maturity : DEV
locale : locale :
@ -15,18 +15,18 @@ max_os_version :
min_wapt_version : min_wapt_version :
sources : sources :
installed_size : installed_size :
impacted_process : impacted_process : thunderbird.exe
description_fr : description_fr : Plugins SOGo pour le client Mozilla Thunderbird
description_pl : description_pl :
description_de : description_de :
description_es : description_es :
audit_schedule : 2d audit_schedule : 2d
editor : editor : Inverse
keywords : keywords : caldav,carddav,sogo
licence : licence :
homepage : homepage : https://sogo.nu
package_uuid : package_uuid :
signer : signer : Daniel Berteaud
signer_fingerprint: signer_fingerprint:
signature_date : signature_date :
signed_attributes : signed_attributes :

@ -17,50 +17,47 @@ if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(m
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read())
variables.update(json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read()))) variables.update(json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())))
install_dir = programfiles connector_version = control.version.split('-',1)[0]
if iswin64(): integrator_version = connector_version
install_dir = programfiles32
connector_version = '60.0.0'
integrator_version = '60.0.0'
def install(): def install():
for extension in ['connector','integrator']: for extension in ['connector','integrator']:
if isdir(makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension)): if isdir(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension)):
remove_tree(makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension)) remove_tree(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension))
mkdirs(makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension)) mkdirs(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension))
# connector can be extracted as is # connector can be extracted as is
run('"%s" x -y -o"%s" sogo-connector-%s.xpi' % (makepath(programfiles,'7-Zip','7z.exe'), makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-connector@inverse.ca'), connector_version)) run('"%s" x -y -o"%s" sogo-connector-%s.xpi' % (makepath(programfiles,'7-Zip','7z.exe'), makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-connector@inverse.ca'), connector_version))
# Integrator must be customized, so first extract it # Integrator must be customized, so first extract it
run('"%s" x -y -o"%s" sogo-integrator-%s-sogo-demo.xpi' % (makepath(programfiles,'7-Zip','7z.exe'), makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca'), integrator_version)) run('"%s" x -y -o"%s" sogo-integrator-%s-sogo-demo.xpi' % (makepath(programfiles,'7-Zip','7z.exe'), makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca'), integrator_version))
# And replace the extensions.rdf content # And replace the extensions.rdf content
jinja2 = Environment( jinja2 = Environment(
loader=FileSystemLoader(os.path.dirname(os.path.abspath(__file__))), loader=FileSystemLoader(os.path.dirname(os.path.abspath(__file__))),
trim_blocks=True trim_blocks=True
) )
open(makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','chrome','content','extensions.rdf'),'w').write( open(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','chrome','content','extensions.rdf'),'w').write(
jinja2.get_template('extensions.rdf.j2').render( jinja2.get_template('extensions.rdf.j2').render(
sogo_server = variables['sogo_server'] sogo_server = variables['sogo_server']
) )
) )
# Also remove custom settings # Also remove custom settings
os.unlink(makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','defaults','preferences','site.js')) os.unlink(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','defaults','preferences','site.js'))
def uninstall(): def uninstall():
print('Removing SOGo extensions for Thunderbird') print('Removing SOGo extensions for Thunderbird')
for extension in ['connector','integrator']: for extension in ['connector','integrator']:
remove_tree(makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension)) remove_tree(makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-%s@inverse.ca' % extension))
def audit(): def audit():
try: try:
run('type "%s" | find /I "em:version=" | find "%s"' % (makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-connector@inverse.ca','install.rdf'), connector_version)) run('type "%s" | find /I "em:version=" | find "%s"' % (makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-connector@inverse.ca','install.rdf'), connector_version))
except: except:
print('SOGO connector version check failed') print('SOGO connector version check failed')
return "ERROR" return "ERROR"
try: try:
run('type "%s" | find /I "em:version=" | find "%s"' % (makepath(install_dir,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','install.rdf'), integrator_version)) run('type "%s" | find /I "em:version=" | find "%s"' % (makepath(programfiles,'Mozilla Thunderbird','distribution','extensions','sogo-integrator@inverse.ca','install.rdf'), integrator_version))
except: except:
print('SOGO integrator version check failed') print('SOGO integrator version check failed')
return "ERROR" return "ERROR"

Loading…
Cancel
Save