#!/usr/bin/env python3 """ Generate PyInstaller spec file for Prole Database Installer. """ SPEC_CONTENT = """# -*- mode: python ; coding: utf-8 -*- import sys from pathlib import Path block_cipher = None # Get project root project_root = Path('.').absolute() # Data files to include datas = [ ('installer', 'installer'), ('conf', 'conf'), ('etc', 'etc'), ('img', 'img'), ('docs', 'docs'), ('k8s', 'k8s'), ('prole-db', 'prole-db'), ('prole-app/dist/Prole Tools.app', 'prole-app/dist/Prole Tools.app'), ] # Binaries to include (with execute permissions) binaries = [ ('prole-net/prole-agent', 'prole-net'), ] # Hidden imports hiddenimports = [ 'installer', 'installer.config', 'installer.build', 'installer.deploy', 'installer.screen', 'installer.main', 'installer.ncurses_ui', 'installer.ncurses_installer', 'curses', '_curses', ] a = Analysis( ['install.py'], pathex=[], binaries=binaries, datas=datas, hiddenimports=hiddenimports, hookspath=[], hooksconfig={}, runtime_hooks=[], excludes=[], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, noarchive=False, ) pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) exe = EXE( pyz, a.scripts, a.binaries, a.zipfiles, a.datas, [], name='prole-installer', debug=False, bootloader_ignore_signals=False, strip=False, upx=True, upx_exclude=[], runtime_tmpdir=None, console=True, # Enable console for --no-gui mode disable_windowed_traceback=False, target_arch=None, codesign_identity=None, entitlements_file=None, icon='build/prole.icns', ) # Create macOS app bundle app = BUNDLE( exe, name='Prole Installer.app', icon='build/prole.icns', bundle_identifier='com.prole.installer', info_plist={ 'CFBundleName': 'Prole Installer', 'CFBundleDisplayName': 'Prole Database Installer', 'CFBundleVersion': '1.0.0', 'CFBundleShortVersionString': '1.0.0', 'NSHighResolutionCapable': 'True', 'LSMinimumSystemVersion': '10.13.0', }, ) """ if __name__ == "__main__": with open("installer.spec", "w") as f: f.write(SPEC_CONTENT) print("Generated installer.spec")