#!/usr/bin/env python3 """ Generate PyInstaller spec file for Knoe 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'), ('knoe-db', 'knoe-db'), ('knoe-app/dist/Knoe Tools.app', 'knoe-app/dist/Knoe Tools.app'), ] # Binaries to include (with execute permissions) binaries = [ ('scan/network-agent', 'scan'), ] # Hidden imports hiddenimports = [ 'installer', 'knoe.config', 'knoe.build', 'knoe.deploy', 'knoe.screen', 'knoe.main', 'knoe.ncurses_ui', 'knoe.ncurses_installer', 'curses', '_curses', ] a = Analysis( ['knoe/ui/screens/__main__.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='knoe-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/knoe.icns', ) # Create macOS app bundle app = BUNDLE( exe, name='Knoe Installer.app', icon='build/knoe.icns', bundle_identifier='com.knoe.installer', info_plist={ 'CFBundleName': 'Knoe.DB Installer', 'CFBundleDisplayName': 'Knoe.DB Installer', 'CFBundleVersion': '1.0.0', 'CFBundleShortVersionString': '1.0.0', 'NSHighResolutionCapable': 'True', 'LSMinimumSystemVersion': '10.13.0', }, ) """ if __name__ == "__main__": with open("knoe.spec", "w") as f: f.write(SPEC_CONTENT) print("Generated knoe.spec")