tis-python311-tranquilit icon

tis-python311-tranquilit

Paquet d’installation silencieuse pour tis-python311-tranquilit

3.11.14-10

  • package: tis-python311-tranquilit
  • version: 3.11.14-10
  • maintainer: sfonteneau
  • locale: all
  • target_os: macos
  • architecture: arm
  • signature_date:
  • size: 52.76 Mo

package           : tis-python311-tranquilit
version           : 3.11.14-10
architecture      : arm
section           : base
priority          : optional
name              : 
categories        : 
maintainer        : sfonteneau
description       : Package for tis-python-3.11-tranquilit
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : macos
min_wapt_version  : 2.0
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Paquet pour tis-python-3.11-tranquilit
description_pl    : Pakiet dla tis-python-3.11-tranquilit
description_de    : Paket für tis-python-3.11-tranquilit
description_es    : Paquete para tis-python-3.11-tranquilit
description_pt    : Pacote para tis-python-3.11-tranquilit
description_it    : Pacchetto per tis-python-3.11-tranquilit
description_nl    : Pakket voor tis-python-3.11-tranquilit
description_ru    : Пакет для tis-python-3.11-tranquilit
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : cba847e0-ec4b-4340-9681-2103cd4ffa6d
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    : 2025-12-03T16:01:18.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         : Nv5A/AP2lfTymS6/lPsSm1ARoSbp0Bsslgk64Q0l1xITVCAxo8iLhP2ifk8DRZdYi7AfRs7qHSan5U93hBW0K23WiQ4rjreRUVlEaFO03LyDD+RE3kD+K0sfHHwpooyVMxEo5AHXfw6Vbf+ng5Ou/chkQ498X/1ROomOQ/vIGM00ISSBPT9VCHPj6o7oeSrdBIXale7UOHYpTGLfLhww/y3WSnTPUxA6a6a4mmxRwGa+BxR2LkWzH0IE/OBjoXmqHZWYrvXp07srDxSI28/ms7j+TAT8O3xkcMYwNYKeG6Yvs6zIFxy+0YK97Lo1cYetK64gnRezH4mixYrY1TUzcg==

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

def install():
    mkdirs('/opt/python311/')
    f= glob.glob('*.tar.gz')[0]
    python_version = control.get_software_version()
    run('cd /opt/python311/ ; tar -xzf %s' % makepath(basedir,f))

def audit():
    python_version = run('/opt/python311/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'


unix_python_dir='/opt/python311'

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():
    print("[UTC %s] start building chroot env" % datetime.datetime.utcnow())
    if type_debian():
        subprocess.run('bash step1_prepare_debian_chroot.sh', shell=True, stderr=sys.stdout, stdout=open('/root/compile_python.log','w'))
    elif type_redhat():
        subprocess.run('bash step1_prepare_redhat_chroot.sh', shell=True, stderr=sys.stdout, stdout=open('/root/compile_python.log','w'))

    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'))

    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" % (control.version.split('-')[0], commit_count)
    control.save_control_to_wapt()


def update_package_windows():

    print("[UTC %s] start building " % datetime.datetime.utcnow())

    print("[UTC %s] start downloading cots" % datetime.datetime.utcnow())
    download_cots(download_directory=basedir)

    #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

    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')

    run(rf'Python-{python_version}\PCbuild\get_externals.bat',timeout=5000)

    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')
    run(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 VC-WIN32-rtt & nmake',timeout=7200)

    name_openssl_folder = glob.glob(rf'Python-{python_version}\externals\openssl-bin-*')[0].split('\\')[-1]

    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')

    with open(makepath(f'Python-{python_version}','PCbuild','openssl.props'), 'r') as f:
        data=f.read()
    data = data.replace(r"<_DLLSuffix>-1_1</_DLLSuffix>",r"<_DLLSuffix>-3</_DLLSuffix>")
    with open(makepath(f'Python-{python_version}','PCbuild','openssl.props'), 'w') as f:
        f.write(data)

    #Disable VENV_REDIRECT
    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)

    run(rf'Python-{python_version}\PCbuild\build.bat -p Win32 -t Rebuild',timeout=5000)

    pathnug = makepath(basedir,'Python-%s' % python_version,'externals','windows-installer','nuget')
    mkdirs(pathnug)
    filecopyto(makepath(basedir,'Python-%s' % python_version,'externals','nuget.exe'),pathnug)

    run(rf'"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" "%s\Python-{python_version}\Tools\nuget\make_pkg.proj" /t:Build  /p:Configuration=Release /p:OutputPath="%s"' % (basedir,basedir))


    unzip('pythonx86.%s.nupkg' % python_version,makepath(basedir,'tmppython'))

    copytree2(makepath('Python-%s' % python_version,'externals',name_openssl_folder,'win32','include','openssl'),makepath(basedir,'tmppython','tools','Include','openssl'))

    for p in glob.glob(makepath('Python-%s' % python_version,'externals',name_openssl_folder,'win32','*.lib')):
        filecopyto(p,makepath(basedir,'tmppython','tools','libs'))

    copytree2(makepath(basedir,'tmppython','tools'),'Python-%s' % python_version)

    remove_tree(makepath(basedir,'tmppython'))

    remove_file('Python-%s.tgz' % python_version)
    remove_file('pythonx86.%s.nupkg' % python_version)

    if params:
        commit_count = params.get("commit_count",0)
    else:
        commit_count = 0
    control.version = "%s-%s" % (control.version.split('-')[0], commit_count)
    control.save_control_to_wapt()




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",
    },
);"""


def update_package_macos():


    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'))

    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" % (control.version.split('-')[0], commit_count)
    control.save_control_to_wapt()



38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
93120f655a5caf3999c9199c4f0bc2ac5382e155397451157c7406c8ff4d805d : WAPT/control
b55b23fa81945c6cd4c2f4f114188aa9f8f3d0c3cbb9fb353b2803ffbb67b43b : WAPT/icon.png
f8b1554394dcefc950d8fc3411b0da482008abc897f98447464f4042022c18de : get_cots.py
db5d08ea137e4835afcf866907107a68852b7065a1b34b2d251512dd4a09d46e : luti.json
16665067dbf23b6532d5044fb7d12df4784a33321de8b1225e81a0ed2ee1aa97 : python-darwin_arm64.tar.gz
c6533183fa6ae1a41d1566da6fee3b76c522db4db8d1e0b0d976d877508155ff : python_sbom.cdx.json
f0d4cd5e0858d272b4e0e5b9905ccb33a3e150552a501f9a3a3325aeb9666ed0 : setup.py
1f4430bec03de17c8f0c0350397f778ce4f1682d832e6e6c6487b6747c528fb3 : step1_prepare_debian_chroot.sh
9379ac2dc56c4f9320d34c0ba409e5ca3eb2a70b404a8c45eec5a730689f3813 : step1_prepare_redhat_chroot.sh
f09b000679ee95825102c69efb9e77fd30e9ec2005e184bc371e8746caa84432 : step2_compile_python_in_chroot.sh
6ec5322edb9615cc4f44f7aae0c2c436102f12c1d905e9559f38790cbe500dd7 : step2_compile_python_macos.sh
e30dd0a3063d552559cba042ac720b164ff2fefd5778f61cabd7da03d949bef5 : update_package.py