prole/scripts/generate_spec.py

108 lines
2.2 KiB
Python
Executable File

#!/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'),
('knoe-db', 'knoe-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',
'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='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("knoe.spec", "w") as f:
f.write(SPEC_CONTENT)
print("Generated knoe.spec")