tis-wapt-python311-relocatable
Silent install package for tis-wapt-python311-relocatable
3.11.18-47
- package: tis-wapt-python311-relocatable
- version: 3.11.18-47
- maintainer: sfonteneau
- locale: all
- target_os: macos
- architecture: arm
- signature_date:
- size: 54.75 Mo
package : tis-wapt-python311-relocatable
version : 3.11.18-47
architecture : arm
section : base
priority : optional
name :
categories :
maintainer : sfonteneau
description : Package for tis-wapt-python311-relocatable
depends :
conflicts :
maturity : PROD
locale : all
target_os : macos
min_wapt_version : 2.0
sources :
installed_size :
impacted_process :
description_fr : Paquet pour tis-wapt-python311-relocatable
description_pl : Pakiet dla tis-wapt-python311-relocatable
description_de : Paket für tis-wapt-python311-relocatable
description_es : Paquete para tis-wapt-python311-relocatable
description_pt : Pacote para tis-wapt-python311-relocatable
description_it : Pacchetto per tis-wapt-python311-relocatable
description_nl : Pakket voor tis-wapt-python311-relocatable
description_ru : Пакет для tis-wapt-python311-relocatable
audit_schedule :
editor :
keywords :
licence :
homepage :
package_uuid : 2e7f8bde-69e2-4524-b748-aa511fea7455
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version :
max_os_version :
icon_sha256sum : b55b23fa81945c6cd4c2f4f114188aa9f8f3d0c3cbb9fb353b2803ffbb67b43b
signer : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date : 2026-11-23T01:22:10.000000
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
signature : ZjMMKET1EcTIIByYeLrbraTxD9Jme/L4qiHz5AcF2AqP0g0AvOk5iICNeem4RPGJMGj9K4mTJVmwdM8mZBqkr3OPxxx7Ohc/qMY3uJcwTJHcGbcR5Z0ReDbbi8DSfBVz6pWIpGdmUw5RIoaRiFYSLORgxLeXIE9JA9gFOsyDK3xEb5r7qxRUz7r/fXIF7GhzQKD7UwZ7rD9zr+ZzSzYWuAn4Bk++AWvF8a+OzmojzI2k1iZ090gwrZzERK/J0O8M5uqnfkHRc0gyum25LPLPhyGxmHEWHS8J9XLjCIHQVWcKzpCUW+kKIjque9/iodu20SRZg2a0mLFzgPEKxrNRtg==
# -*- coding: utf-8 -*-
from setuphelpers import *
import glob
def install():
mkdirs('/opt/wapt/')
f= glob.glob('*.tar.gz')[0]
python_version = control.get_software_version()
run('cd /opt/wapt/ ; tar -xzf %s' % makepath(basedir,f))
def audit():
python_version = run('/opt/wapt/bin/python3 -V').split(' ')[1].strip()
if Version(python_version) != control.get_software_version():
print('version install : %s' % python_version)
return "ERROR"
else:
return "OK"
# -*- coding: utf-8 -*-
from setupdevhelpers import *
from waptutils import CustomZipFile
from waptutils import create_recursive_zip
import distro
import platform
import tarfile
import json
import subprocess
import datetime
import sys
sys.path.append('.')
from get_cots import download_cots, get_cots_version, get_cots_filename
python_name_file = str(platform.system().lower() + '_' + platform.machine().lower() + '_' .strip('_'))
download_directory = r'c:\tranquilit'
def update_package():
if platform.system() =='Linux':
update_package_linux()
return
elif platform.system() =='Windows':
update_package_windows()
return
elif platform.system() == 'Darwin':
update_package_macos()
else:
print('non supported os')
raise()
def update_package_linux():
#Download and extract python source
python_version_from_control = control.version.split('-')[0]
python_version_from_sbom = get_cots_version('Python')
if python_version_from_control !=python_version_from_sbom:
raise Exception('Different version in sbom and in control file, please check')
python_version = python_version_from_sbom
unix_python_dir='/opt/wapt'
print("[UTC %s] start building chroot env" % datetime.datetime.utcnow())
if type_debian():
subprocess.run('bash step1_prepare_debian_chroot.sh %s' % unix_python_dir, shell=True, stderr=sys.stdout, stdout=open('/root/compile_python.log','w'), check=True)
elif type_redhat():
subprocess.run('bash step1_prepare_redhat_chroot.sh %s' % unix_python_dir, shell=True, stderr=sys.stdout, stdout=open('/root/compile_python.log','w'), check=True)
print("[UTC %s] start downloading cots" % datetime.datetime.utcnow())
download_cots(download_directory=r'/root/python_build_chroot/root/')
print("[UTC %s] start compiling python" % datetime.datetime.utcnow())
filecopyto('step2_compile_python_in_chroot.sh','/root/python_build_chroot/root/')
subprocess.run('chroot /root/python_build_chroot /bin/bash /root/step2_compile_python_in_chroot.sh %s' % unix_python_dir, shell=True, stderr=sys.stdout, stdout=open('/root/compile_python.log','a'), check=True)
print("[UTC %s] targzipping python distrib" % datetime.datetime.utcnow())
run('tar -zcf %s/python-%s.tar.gz -C /root/python_build_chroot/%s .' % (basedir, python_name_file, unix_python_dir))
if params:
commit_count = params.get("commit_count",0)
else:
val = subprocess.check_output('git rev-list --count HEAD', shell=True)
commit_count = int(val)
control.version = "%s-%s" % (Version(python_version), commit_count)
control.save_control_to_wapt()
def print_utc(message):
print("[UTC %s] %s" % (datetime.datetime.utcnow(), message))
def update_package_windows():
if control.architecture not in ('x86','x64'):
error('only x86 and x64 supported arch')
#Download and extract python source
python_version_from_control = control.version.split('-')[0]
python_version_from_sbom = get_cots_version('Python')
if python_version_from_control !=python_version_from_sbom:
raise Exception('Different version in sbom and in control file, please check')
python_version = python_version_from_sbom
print_utc("start building")
#remove linux specific files from include dir
remove_file('*.sh')
print_utc("start downloading cots")
download_cots(download_directory=basedir)
unzip_with_7zip(f'Python-{python_version}.tgz',f'Python-{python_version}-tar')
unzip_with_7zip(rf'Python-{python_version}-tar\Python-{python_version}.tar','.')
remove_tree(f'Python-{python_version}-tar')
remove_file(f'Python-{python_version}.tgz')
#Download and extract openssl source
openssl_version =get_cots_version('openssl')
unzip_with_7zip(rf'openssl-{openssl_version}.tar.gz',rf'openssl-{openssl_version}-tar')
unzip_with_7zip(rf'openssl-{openssl_version}-tar\openssl-{openssl_version}.tar','.')
remove_tree(rf'openssl-{openssl_version}-tar')
remove_file(rf'openssl-{openssl_version}.tar.gz')
if not isfile(r'C:\Program Files\NASM\nasm.exe'):
error(r'C:\Program Files\NASM\nasm.exe not found')
print_utc("running get_external.bat")
filecopyto('get_externals.bat',rf'Python-{python_version}\PCbuild\get_externals.bat')
run(rf'Python-{python_version}\PCbuild\get_externals.bat',timeout=5000)
data_custom = r"""## -*- mode: perl; -*-
## Personal configuration targets
my %targets = (
"VC-WIN32-rtt" => {
inherit_from => [ "VC-WIN32" ],
cflags => sub{my $v=pop; $v=~ s/\/MD/\/MT/ig; return $v},
lflags => "/nologo /release",
},
"VC-WIN64A-rtt" => {
inherit_from => [ "VC-WIN64A" ],
cflags => sub{my $v=pop; $v=~ s/\/MD/\/MT/ig; return $v},
lflags => "/nologo /release",
},
);"""
with open(rf'openssl-{openssl_version}\Configurations\60-custom.conf','w') as f:
f.write(data_custom)
add_to_system_path(r'C:\Program Files\NASM')
add_to_system_path(r'C:\Program Files\git\bin')
print_utc("compiling openssl")
if control.architecture=='x86':
cmd = rf'cd openssl-{openssl_version} & set path=C:\Program Files\NASM;%path% &"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars32.bat" &"C:\Strawberry\perl\bin\perl.exe" configure --banner=Configured no-makedepend -DOSSL_WINCTX=openssl no-tests VC-WIN32-rtt /FS'
elif control.architecture=='x64':
cmd = rf'cd openssl-{openssl_version} & set path=C:\Program Files\NASM;%path% &"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" &"C:\Strawberry\perl\bin\perl.exe" configure --banner=Configured no-makedepend -DOSSL_WINCTX=openssl no-tests VC-WIN64A-rtt /FS'
print("running : %s " % cmd)
run(cmd)
if control.architecture=='x86':
cmd = rf'cd openssl-{openssl_version} & set path=C:\Program Files\NASM;%path% &"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars32.bat" &"c:\program files\jom\jom.exe" -j8 -S'
elif control.architecture=='x64':
cmd = rf'cd openssl-{openssl_version} & set path=C:\Program Files\NASM;%path% &"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" &"c:\program files\jom\jom.exe" -j8 -S'
print("running : %s " % cmd)
run(cmd)
name_openssl_folder = glob.glob(rf'Python-{python_version}\externals\openssl-bin-*')[0].split('\\')[-1]
if control.architecture=='x86':
shutil.move(rf'Python-{python_version}\externals\{name_openssl_folder}\win32',rf'Python-{python_version}\externals\{name_openssl_folder}\win32old')
shutil.move(rf'openssl-{openssl_version}',rf'Python-{python_version}\externals\{name_openssl_folder}\win32')
filecopyto(rf'Python-{python_version}\externals\{name_openssl_folder}\win32old\include\applink.c',rf'Python-{python_version}\externals\{name_openssl_folder}\win32\include\applink.c')
elif control.architecture=='x64':
shutil.move(rf'Python-{python_version}\externals\{name_openssl_folder}\amd64',rf'Python-{python_version}\externals\{name_openssl_folder}\amd64old')
shutil.move(rf'openssl-{openssl_version}',rf'Python-{python_version}\externals\{name_openssl_folder}\amd64')
filecopyto(rf'Python-{python_version}\externals\{name_openssl_folder}\amd64old\include\applink.c',rf'Python-{python_version}\externals\{name_openssl_folder}\amd64\include\applink.c')
# only for x64
if control.architecture=='x64':
with open(makepath(f'Python-{python_version}','PCbuild','openssl.props'), 'r') as f:
data=f.read()
data = data.replace(r"<_DLLSuffix>-3</_DLLSuffix>",r"<_DLLSuffix>-3-x64</_DLLSuffix>")
with open(makepath(f'Python-{python_version}','PCbuild','openssl.props'), 'w') as f:
f.write(data)
#Disable VENV_REDIRECT, only for x86
if control.architecture=='x86':
for vcxproj in ['venvlauncher.vcxproj','venvwlauncher.vcxproj']:
with open(makepath(f'Python-{python_version}','PCbuild',vcxproj), 'r') as f:
data=f.read()
data = data.replace(r";VENV_REDIRECT;",r";")
with open(makepath(f'Python-{python_version}','PCbuild',vcxproj), 'w') as f:
f.write(data)
print_utc("compiling python")
if control.architecture=='x86':
run(rf'Python-{python_version}\PCbuild\build.bat -p Win32 -t Rebuild',timeout=5000)
run(rf'"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" "%s\Python-{python_version}\Tools\msi\make_zip.proj" /t:Build /p:OutputPath="%s"' % (basedir,basedir))
elif control.architecture=='x64':
run(rf'Python-{python_version}\PCbuild\build.bat -p x64 -t Rebuild',timeout=5000)
run(rf'"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" "%s\Python-{python_version}\Tools\msi\make_zip.proj" /t:Build /p:OutputPath="%s" /p:platform=x64' % (basedir,basedir))
print_utc("packaging python")
name_generate = glob.glob('*.zip')[0]
if control.architecture=='x86':
os.rename(name_generate,f'python311-windows_amd64-x86.zip')
elif control.architecture=='x64':
os.rename(name_generate,f'python311-windows_amd64-x64.zip')
remove_tree(f'Python-{python_version}')
#remove_tree(f'openssl-{openssl_version}')
remove_file('*.tar.gz')
remove_file('*.tar.xz')
remove_file('*.tar.bz2')
commit_count = params.get("commit_count",0)
control.version = "%s-%s" % (Version(python_version), commit_count)
control.save_control_to_wapt()
def update_package_macos():
unix_python_dir = '/opt/python311'
#Download and extract python source
python_version_from_control = control.version.split('-')[0]
python_version_from_sbom = get_cots_version('Python')
if python_version_from_control !=python_version_from_sbom:
raise Exception('Different version in sbom and in control file, please check')
python_version = python_version_from_sbom
print("[UTC %s] start downloading cots" % datetime.datetime.utcnow())
download_cots(download_directory=r'/var/root/')
print("[UTC %s] start compiling python" % datetime.datetime.utcnow())
filecopyto('step2_compile_python_macos.sh','/var/root/')
subprocess.run('/bin/bash step2_compile_python_macos.sh %s' % unix_python_dir, shell=True, stderr=sys.stdout, stdout=open('/var/root/compile_python.log','a'), check=True)
# should it be done for *.dylib also?
# should add more glob.glob for lib version evolution
for filename in glob.glob(os.path.join('opt','python311','lib') + "/**/*.so",recursive=True):
cmd = '/usr/bin/install_name_tool -rpath /opt/python311/lib/ /opt/wapt/lib/ %s' % filename
print("Updating rpath : %s " % cmd)
try:
run(cmd)
except:
print('error while changing rpath on %s ' % filename)
print(subprocess.check_output('/opt/wapt/bin/python3 %s ' % os.path.join(basedir,'fix_dylib_macos.py'),shell=True))
print("[UTC %s] targzipping python distrib" % datetime.datetime.utcnow())
run('tar -zcf %s/python-%s.tar.gz -C /opt/python311 .' % (basedir, python_name_file))
if params:
commit_count = params.get("commit_count",0)
else:
val = subprocess.check_output('git rev-list --count HEAD', shell=True)
commit_count = int(val)
control.version = "%s-%s" % (Version(python_version), commit_count)
control.save_control_to_wapt()
38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
6fd1ab197cb02a4d7e7bfd2da63f16f6d4092d9338e4e6df0fd7fe940aa2a98f : WAPT/control
b55b23fa81945c6cd4c2f4f114188aa9f8f3d0c3cbb9fb353b2803ffbb67b43b : WAPT/icon.png
4553c4e5f199da0db4dd2b41fc932b36b1d3e59bcc6bb958b41940f63c3d4627 : fix_dylib_macos.py
f8b1554394dcefc950d8fc3411b0da482008abc897f98447464f4042022c18de : get_cots.py
24573dfa9f5a6719374a95d7d7a8bb817d74df21b14288e752cbe63a34da9f98 : gpatch
54a96be7a421739436cf7ad9dbd21a591312fdf78a8707c024c6f4a93f763b9a : luti.json
95c8be4081e83454c3eb59b403e911c429590edb2f8322f968153101fddecbc6 : python-darwin_arm64.tar.gz
bdf0b7e0580e90c55f7778237169dc6a405468b2a7395ab542e29de0b74212eb : python_sbom.cdx.json
cd0d759357de9fd771e9b0d7c2b6a253cc0487d36c77a191b140a5f6c272124a : setup.py
3d568ba9f54ba6713727065c2bc63e4e15cdb5134f0cdda8df93a1139d6405e6 : step1_prepare_debian_chroot.sh
81de376778c27bf89795c9aa6dd51e506f1a75883343b6fa51f4cc58ba2fba26 : step1_prepare_redhat_chroot.sh
977dda40efde0b8f6d2316d1a0a8a3672147333bce0c550adac6f446d1b739bc : step2_compile_python_in_chroot.sh
377e21a88ee5af0bb5263e68d48970f563bae26324f0d17064b9390d124fc647 : step2_compile_python_macos.sh
f5a38e8f54b35c009b4247ee18fe43131346dcee5b0ba475ab6ccf9d9876e966 : update_package.py