diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..7c9d0f2ebe2b0f9c6cf7986c8a2ec63695701469 --- /dev/null +++ b/.gitignore @@ -0,0 +1,161 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +*.pyc + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ diff --git a/AUTHORS b/AUTHORS index ebd701f99e5591140bf7e4ff46223fc91392bf91..9854fe4f76f457d93bea3a697efe17d1069ff145 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,2 +1,4 @@ +ZhengZhenyu Zhenyu Zheng -Zhipeng Huang +mayazhi <746364661@qq.com> +openeuler-ci-bot diff --git a/ChangeLog b/ChangeLog index b0bce081aba28388c3317572617d9856ef7539d4..b52fb1d63300f836461650ca43ee6e4229f59b05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,27 @@ CHANGES ======= -* fix requirement bugs on urllib3 and libvirt-python -* Make the tool work on Mac -* Initial Commit +* !9 Rename to EulerLauncher +* rename to eulerlauncher +* !7 修改Developer-Manual中的OmniVirt为EulerLauncher +* 修改Developer-Manual中的OmniVirt为EulerLauncher +* !6 修改OmniVirt为EulerLauncher +* 修改omnivirt为EulerLauncher +* !5 Move codes from github to gitee Merge pull request !5 from ZhengZhenyu/master +* add LICENSE +* Move codes from github to gitee +* Change name to EulerLauncher +* Add manual for macos +* !4 Add Information about env Merge pull request !4 from ZhengZhenyu/dev +* Add information about env +* !3 Add info about how to quit with tray icon Merge pull request !3 from ZhengZhenyu/dev +* Add information about quit omnivirtd with tray +* !2 Fix typos Merge pull request !2 from ZhengZhenyu/dev +* Fix typos in logo and readme +* !1 刷新OmniVirt用户指导文档 +* Initialize project readme + +v0.1 +---- + +* Initial commit diff --git a/docs/developer-manual.md b/docs/developer-manual.md index 89e4eea6120754561c40c76713ffeb18506343b7..01ff36e4963a68ca89d89007414817be9ad1fee6 100644 --- a/docs/developer-manual.md +++ b/docs/developer-manual.md @@ -10,7 +10,7 @@ EulerLauncher使用Python语言编写,源代码可以跨平台运行,但需 **安装Python:** -参考[Python社区首页][1]完成Python安装,推荐安装Python 3.10及以上版本 +参考[Python社区首页][1]完成Python安装,推荐安装Python 3.9及以上版本 **安装Homebrew** @@ -57,21 +57,21 @@ EulerLauncher可执行文件包括以下几个部分: 项目源码中已包含用于构建EulerLauncherd的Spec脚本`EulerLauncherd-Mac.spec`, 若非必要,请勿修改该文件,使用一下命令开始构建: ``` Shell - pyinstaller --clean --noconfirm EulerLauncherd-Mac.spec + pyinstaller --clean --noconfirm specs/EulerLauncherd-Mac.spec ``` 2. EulerLauncher.app: 项目源码中已包含用于构建EulerLauncher的Spec脚本`EulerLauncher-MacOS.spec`, 若非必要,请勿修改该文件,使用一下命令开始构建: ``` Shell - pyinstaller --clean --noconfirm EulerLauncher-MacOS.spec + pyinstaller --clean --noconfirm specs/EulerLauncher-MacOS.spec ``` -构建`omnivirt` CLI 及 `install` 脚本, cli与install之间有依赖关系,请严格按照下面的顺序进行构建: +构建`eulerlauncher` CLI 及 `install` 脚本, cli与install之间有依赖关系,请严格按照下面的顺序进行构建: ``` Shell -pyinstaller --clean --noconfirm cli.spec -pyinstaller --clean --noconfirm install.spec +pyinstaller --clean --noconfirm specs/cli-mac.spec +pyinstaller --clean --noconfirm specs/install.spec ``` ### 制作`.dmg`: @@ -89,5 +89,56 @@ create-dmg --volname "EulerLauncher" --volicon "etc/images/favicon.png" --window `EulerLauncher.dmg`中将只包含`EulerLauncher.app`主程序,需要将`install`脚本及`EulerLauncher` CLI工具一并压缩后再进行分发。 + +## 在Windows上构建EulerLauncher + +**安装Python:** + +参考[Python社区首页][1]完成Python安装,推荐安装Python 3.9及以上版本 + +EulerLauncher使用`Pyinstaller`将源码编译为Windows可执行文件(.exe)。 + +使用下面命令安装`Pyinstaller` + +``` Shell +pip3 install pyinstaller +``` + +进入项目目录并准备开始工作 + +``` Shell +cd \\path\\to\\EulerLauncher +``` + +安装项目依赖 + +``` Shell +pip3 install -r requirements-win.txt +``` + +### 构建 + +EulerLauncher可执行文件包括以下几个部分: + +- eulerlauncherd.exe:EulerLauncher的主进程,是运行在后台的守护进程,负责与各类虚拟化后端交互,管理虚拟机、容器以及镜像的生命周期,eulerlauncherd.exe是运行在后台的守护进程。 +- eulerlauncher.exe:EulerLauncher的CLI客户端,用户通过该客户端与eulerlauncherd守护进程交互,对虚拟机、镜像等进行相关操作。 +- config-env.bat: 帮助用户快速配置环境变量 + +1. 构建`eulerlauncherd.exe`: + +项目源码中已包含用于构建EulerLauncherd的Spec脚本`EulerLauncherd-win.spec`, 若非必要,请勿修改该文件,使用一下命令开始构建: + + ``` Shell + pyinstaller --clean --noconfirm specs\\EulerLauncherd-win.spec + ``` + +2. 构建`eulerlauncher.exe`: + +``` Shell +pyinstaller --clean --noconfirm specs\\cli-mac.spec +``` + +3. 将`etc\bin`目录下的`config-env.bat`及`qemu-img`文件夹拷贝到制品目录,并进行压缩。 + [1]: https://www.python.org/ [2]: https://brew.sh/ \ No newline at end of file diff --git a/docs/win-user-manual.md b/docs/win-user-manual.md index 4c11459d22280d4c43b88332285396581e93ce26..9744400b05f9898d900833e127aa5085a29e495e 100644 --- a/docs/win-user-manual.md +++ b/docs/win-user-manual.md @@ -8,7 +8,7 @@ - eulerlauncherd.exe:EulerLauncher的主进程,是运行在后台的守护进程,负责与各类虚拟化后端交互,管理虚拟机、容器以及镜像的生命周期,eulerlauncherd.exe是运行在后台的守护进程。 - eulerlauncher.exe:EulerLauncher的CLI客户端,用户通过该客户端与eulerlauncherd守护进程交互,对虚拟机、镜像等进行相关操作。 -- eulerlauncher-win.conf:OmniVirt配置文件,需与eulerlauncherd.exe放置于同一目录下,参考下面配置进行相应配置: +- eulerlauncher.conf:EulerLauncher配置文件,需与eulerlauncherd.exe放置于同一目录下,参考下面配置进行相应配置: ```Conf [default] @@ -16,11 +16,11 @@ log_dir = D:\eulerlauncher-workdir\logs # 配置日志等级是否开启Debug debug = True -# 配置OmniVirt的工作目录 +# 配置EulerLauncher的工作目录 work_dir = D:\eulerlauncher-workdir -# 配置OmniVirt的镜像目录,镜像目录为对工作目录的相对目录 +# 配置EulerLauncher的镜像目录,镜像目录为对工作目录的相对目录 image_dir = images -# 配置OmniVirt的虚拟机文件目录,虚拟机文件目录为对工作目录的相对目录 +# 配置EulerLauncher的虚拟机文件目录,虚拟机文件目录为对工作目录的相对目录 instance_dir = instances ``` @@ -39,7 +39,7 @@ instance_dir = instances 1. 获取可用镜像列表: ```PowerShell -eulerlauncher.exe images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -55,7 +55,7 @@ eulerlauncher.exe images 2. 下载远端镜像 ```PowerShell -eulerlauncher.exe download-image 22.03-LTS +eulerlauncher download-image 22.03-LTS Downloading: 22.03-LTS, this might take a while, please check image status with "images" command. ``` @@ -63,7 +63,7 @@ Downloading: 22.03-LTS, this might take a while, please check image status with 镜像下载请求是一个异步请求,具体的下载动作将在后台完成,具体耗时与你的网络情况相关,整体的镜像下载流程包括下载、解压缩、格式转换等相关子流程,在下载过程中可以通过 `image` 命令随时查看下载进展与镜像状态: ```PowerShell -eulerlauncher.exe images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -78,7 +78,7 @@ eulerlauncher.exe images 当镜像状态转变为 `Ready` 时,表示镜像下载完成,处于 `Ready` 状态的镜像可被用来创建虚拟机: ```PowerShell -eulerlauncher.exe images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -94,7 +94,7 @@ eulerlauncher.exe images 用户也可以加载自定义镜像或预先下载到本地的镜像到EulerLauncher中用于创建自定义虚拟机: ```PowerShell -eulerlauncher.exe load-image --path {image_file_path} IMAGE_NAME +eulerlauncher load-image --path {image_file_path} IMAGE_NAME ``` 当前支持加载的镜像格式有 `xxx.qcow2.xz`,`xxx.qcow2` @@ -102,7 +102,7 @@ eulerlauncher.exe load-image --path {image_file_path} IMAGE_NAME 例如: ```PowerShell -eulerlauncher.exe load-image --path D:\openEuler-22.03-LTS-x86_64.qcow2.xz 2203-load +eulerlauncher load-image --path D:\openEuler-22.03-LTS-x86_64.qcow2.xz 2203-load Loading: 2203-load, this might take a while, please check image status with "images" command. ``` @@ -110,7 +110,7 @@ Loading: 2203-load, this might take a while, please check image status with "ima 将位于 `D:\` 目录下的 `openEuler-22.03-LTS-x86_64.qcow2.xz` 加载到OmniVirt系统中,并命名为 `2203-load`,与下载命令一样,加载命令也是一个异步命令,用户需要用镜像列表命令查询镜像状态直到显示为 `Ready`, 但相对于直接下载镜像,加载镜像的速度会快很多: ```PowerShell -eulerlauncher.exe images +eulerlauncher images +-----------+----------+--------------+ | Images | Location | Status | @@ -136,7 +136,7 @@ eulerlauncher images 通过下面的命令将镜像从EulerLauncher系统中删除: ```PowerShell -eulerlauncher.exe delete-image 2203-load +eulerlauncher delete-image 2203-load Image: 2203-load has been successfully deleted. ``` @@ -146,7 +146,7 @@ Image: 2203-load has been successfully deleted. 1. 获取虚拟机列表: ```Powershell -eulerlauncher.exe list +eulerlauncher list +----------+-----------+---------+---------------+ | Name | Image | State | IP | @@ -171,14 +171,14 @@ ssh root@{instance_ip} 3. 创建虚拟机 ```PowerShell -eulerlauncher.exe launch --image {image_name} {instance_name} +eulerlauncher launch --image {image_name} {instance_name} ``` -通过 `--image` 指定镜像,同时指定虚拟机名称。 +通过 `--image` 指定镜像,同时指定虚拟机名称,EulerLauncher会根据所指定的镜像默认创建一个规格为`2U4G`的openEuler虚拟机。 4. 删除虚拟机 ```PowerShell -eulerlauncher.exe delete-instance {instance_name} +eulerlauncher delete-instance {instance_name} ``` 根据虚拟机名称删除指定的虚拟机。 diff --git a/etc/bin/config-env.bat b/etc/bin/config-env.bat new file mode 100644 index 0000000000000000000000000000000000000000..b77e085b36775b692013a4e9f0047d10b9db221c --- /dev/null +++ b/etc/bin/config-env.bat @@ -0,0 +1,8 @@ +@ECHO OFF +REM usage: append_system_path "path" +set CURR_DIR=%~dp0 +set QEMU_DIR=%~dp0qemu-img\ +SET Key="HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" +FOR /F "usebackq tokens=2*" %%A IN (`REG QUERY %Key% /v PATH`) DO Set CurrPath=%%B +ECHO %CurrPath% > system_path_bak.txt +SETX PATH "%CurrPath%";%CURR_DIR%;%QEMU_DIR% /m \ No newline at end of file diff --git a/etc/bin/qemu-img/libgcc_s_sjlj-1.dll b/etc/bin/qemu-img/libgcc_s_sjlj-1.dll new file mode 100644 index 0000000000000000000000000000000000000000..5bb91387fcb2e8f2d8ca1f0ace4415da280f48d9 Binary files /dev/null and b/etc/bin/qemu-img/libgcc_s_sjlj-1.dll differ diff --git a/etc/bin/qemu-img/libglib-2.0-0.dll b/etc/bin/qemu-img/libglib-2.0-0.dll new file mode 100644 index 0000000000000000000000000000000000000000..50572a7a768e397b63ff4b81200e7eda42fc8463 Binary files /dev/null and b/etc/bin/qemu-img/libglib-2.0-0.dll differ diff --git a/etc/bin/qemu-img/libgthread-2.0-0.dll b/etc/bin/qemu-img/libgthread-2.0-0.dll new file mode 100644 index 0000000000000000000000000000000000000000..ed3fbc335938f607623a4a63a9ff3733553de3c2 Binary files /dev/null and b/etc/bin/qemu-img/libgthread-2.0-0.dll differ diff --git a/etc/bin/qemu-img/libiconv-2.dll b/etc/bin/qemu-img/libiconv-2.dll new file mode 100644 index 0000000000000000000000000000000000000000..66f8c6085c6f5e6ae55ba207a5ad5a416a9472df Binary files /dev/null and b/etc/bin/qemu-img/libiconv-2.dll differ diff --git a/etc/bin/qemu-img/libintl-8.dll b/etc/bin/qemu-img/libintl-8.dll new file mode 100644 index 0000000000000000000000000000000000000000..0885ff2462f40f88c823c18cab890dc4f84ef6f8 Binary files /dev/null and b/etc/bin/qemu-img/libintl-8.dll differ diff --git a/etc/bin/qemu-img/libssp-0.dll b/etc/bin/qemu-img/libssp-0.dll new file mode 100644 index 0000000000000000000000000000000000000000..c292725d66f7ca90aea6b3cdd675bc908ed2bbb7 Binary files /dev/null and b/etc/bin/qemu-img/libssp-0.dll differ diff --git a/etc/bin/qemu-img/qemu-img.exe b/etc/bin/qemu-img/qemu-img.exe new file mode 100644 index 0000000000000000000000000000000000000000..c25038039c7bf3cb18d921e614175bcd976d2fbe Binary files /dev/null and b/etc/bin/qemu-img/qemu-img.exe differ diff --git a/eulerlauncher/backends/win/vmops.py b/eulerlauncher/backends/win/vmops.py index 69355a3227f8037d0a0ddceb4c6cd321b47e27b7..b8e4c75d4193bf3e7a807104b25b580bf98c27ae 100644 --- a/eulerlauncher/backends/win/vmops.py +++ b/eulerlauncher/backends/win/vmops.py @@ -64,7 +64,7 @@ class VMOps(object): for instance_name in instance_names: vm = objs.Instance(name=instance_name) meta = self.get_meta(instance_name) - if not meta or not meta['creator'] == 'omnivirt': + if not meta or not meta['creator'] == 'eulerlauncher': continue else: vm.metadata = meta @@ -115,7 +115,7 @@ class VMOps(object): meta_data = { 'uuid': uuid, 'image': image_name, - 'creator': 'omnivirt' + 'creator': 'eulerlauncher' } # Create an instance @@ -124,6 +124,8 @@ class VMOps(object): self._vmutils.create_scsi_controller(vm_name) # Attach the root disk to the driver self.attach_disk(vm_name, root_disk_path, constants.DISK) + # Set default flavor + self._vmutils.update_vm(vm_name, 4096, 0, '2', 0, False, 0) # Start the instance self.power_up(vm_name) nic_name = vm_name + '_eth0' diff --git a/eulerlauncher/eulerlauncherd.py b/eulerlauncher/eulerlauncherd.py index fd8e435f216fb986d5c835a9ab725089cc5f4707..4bd0be7542a1457d53209c23dc5428ae0fb9b252 100644 --- a/eulerlauncher/eulerlauncherd.py +++ b/eulerlauncher/eulerlauncherd.py @@ -23,7 +23,9 @@ from eulerlauncher.utils import utils IMG_URL = 'https://gitee.com/openeuler/eulerlauncher/raw/master/etc/supported_images.json' # Avoid create zombie children in MacOS and Linux -signal.signal(signal.SIGCHLD, signal.SIG_IGN) +host_os_raw = platform.uname().system +if host_os_raw != 'Windows': + signal.signal(signal.SIGCHLD, signal.SIG_IGN) parser = argparse.ArgumentParser() parser.add_argument('conf_file', help='Configuration file for the application', type=str) @@ -106,14 +108,17 @@ def serve(arch, host_os, CONF, LOG, base_dir): server.start() LOG.debug('EulerLauncherd Service Started ...') - def term_handler(signum, frame): - pid = os.getpid() - os.killpg(os.getpgid(pid), signal.SIGKILL) + if host_os == 'Win': + return server + else: + def term_handler(signum, frame): + pid = os.getpid() + os.killpg(os.getpgid(pid), signal.SIGKILL) - # Avoid create orphan children in MacOS and Linux - signal.signal(signal.SIGTERM, term_handler) + # Avoid create orphan children in MacOS and Linux + signal.signal(signal.SIGTERM, term_handler) - while True: + while True: time.sleep(1) def init_launcherd(conf, base_dir): @@ -134,15 +139,43 @@ def init_launcherd(conf, base_dir): LOG.debug('Error: ' + str(e)) return str(e) else: - serve(host_arch, host_os, CONF, LOG, base_dir) + return serve(host_arch, host_os, CONF, LOG, base_dir) if __name__ == '__main__': - args = parser.parse_args() - conf_file = args.conf_file + host_os_raw = platform.uname().system + if host_os_raw != 'Windows': + args = parser.parse_args() + conf_file = args.conf_file + base_dir = args.base_dir + else: + conf_file = os.path.join(os.getcwd(), 'etc', 'eulerlauncher.conf') + base_dir = None try: pass except Exception as e: print('Error: ' + str(e)) else: - init_launcherd(conf_file, args.base_dir) + if host_os_raw != 'Windows': + init_launcherd(conf_file, base_dir) + else: + try: + logo = PIL.Image.open(os.path.join(os.getcwd(), 'etc', 'favicon.png')) + + def on_clicked(icon, item): + icon.stop() + + icon = pystray.Icon('EulerLauncher', logo, menu=pystray.Menu( + pystray.MenuItem('Exit EulerLauncher', on_clicked) + )) + + except Exception as e: + print('Error: ' + str(e)) + sys.exit(0) + + server = init_launcherd(conf_file, base_dir) + + icon.run() + server.stop(None) + sys.exit(0) + diff --git a/eulerlauncher/macos-gui.py b/eulerlauncher/macos-gui.py index fc867855b7ee93de4ad60672a0a9187c17f0ba79..3562e4f6db2f6a590aa21af157161104c6efda4d 100644 --- a/eulerlauncher/macos-gui.py +++ b/eulerlauncher/macos-gui.py @@ -52,7 +52,7 @@ if __name__ == '__main__': icon.run() - # Shutdown omnivirtd, we created it with sudo, so kill it with sudo + # Shutdown eulerlauncherd, we created it with sudo, so kill it with sudo subprocess.check_call(['sudo', 'kill', str(launcherd.pid)]) os.waitpid(launcherd.pid, 0) sys.exit(0) \ No newline at end of file diff --git a/requirements-win.txt b/requirements-win.txt new file mode 100644 index 0000000000000000000000000000000000000000..b67b36dc4415cf837515d153a8423b9e6e45fb9a --- /dev/null +++ b/requirements-win.txt @@ -0,0 +1,24 @@ +argparse +click +configparser +dnspython +grpcio +grpcio-tools +lxml +os-win +oslo.concurrency +oslo.config +oslo.context +oslo.i18n +oslo.log +oslo.serialization +oslo.utils +Pillow +prettytable +protobuf +psutil +pystray +PyYAML +six +urllib3 +wget diff --git a/requirements.txt b/requirements.txt index 3f666ec2f136a323097d85cd003ad63286cf2602..db5e0f68c92003b71fc38050787376e243cb4a4a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,6 @@ dnspython grpcio grpcio-tools pkg-config -libvirt-python lxml os-win oslo.concurrency diff --git a/EulerLauncher-MacOS.spec b/specs/EulerLauncher-MacOS.spec similarity index 76% rename from EulerLauncher-MacOS.spec rename to specs/EulerLauncher-MacOS.spec index 758124f0e2169535f8dc32f5f0c8415eb20d7381..ce7c77a57b14fb88d2ce5978341563dd6967a805 100644 --- a/EulerLauncher-MacOS.spec +++ b/specs/EulerLauncher-MacOS.spec @@ -5,10 +5,10 @@ block_cipher = None a = Analysis( - ['eulerlauncher/macos-gui.py'], + ['../eulerlauncher/macos-gui.py'], pathex=[], - binaries=[('dist/EulerLauncherd', './bin')], - datas=[('etc/eulerlauncher.conf', './etc'), ('etc/images/favicon.png', './etc'), ('resources/qemu/edk2-aarch64-code.fd', './etc'), ('resources/qemu/edk2-x86_64-code.fd', './etc')], + binaries=[('../dist/EulerLauncherd', './bin')], + datas=[('../etc/eulerlauncher.conf', './etc'), ('../etc/images/favicon.png', './etc'), ('../resources/qemu/edk2-aarch64-code.fd', './etc'), ('../resources/qemu/edk2-x86_64-code.fd', './etc')], hiddenimports=[], hookspath=[], hooksconfig={}, diff --git a/EulerLauncherd-Mac.spec b/specs/EulerLauncherd-Mac.spec similarity index 94% rename from EulerLauncherd-Mac.spec rename to specs/EulerLauncherd-Mac.spec index f6cc3726b7cdd936cd547671e63d28c04942708b..9dbbc2894fc5bbdf7c38e5c54af73e6436e1242f 100644 --- a/EulerLauncherd-Mac.spec +++ b/specs/EulerLauncherd-Mac.spec @@ -5,7 +5,7 @@ block_cipher = None a = Analysis( - ['eulerlauncher/eulerlauncherd.py'], + ['../eulerlauncher/eulerlauncherd.py'], pathex=[], binaries=[], datas=[], diff --git a/specs/EulerLauncherd-win.spec b/specs/EulerLauncherd-win.spec new file mode 100644 index 0000000000000000000000000000000000000000..4673ad433dc569557d662f22530f8614127c976a --- /dev/null +++ b/specs/EulerLauncherd-win.spec @@ -0,0 +1,97 @@ +# -*- mode: python ; coding: utf-8 -*- +from PyInstaller.utils.hooks import collect_all + +datas = [] +binaries = [] +hiddenimports = [ + 'eventlet.hubs.epolls', + 'eventlet.hubs.kqueue', + 'eventlet.hubs.selects', + 'dns.asyncquery', + 'dns.asyncresolver', + 'dns.dnssec', + 'dns.e164', + 'dns.edns', + 'dns.entropy', + 'dns.exception', + 'dns.flags', + 'dns.grange', + 'dns.hash', + 'dns.inet', + 'dns.ipv4', + 'dns.ipv6', + 'dns.message', + 'dns.name', + 'dns.namedict', + 'dns.node', + 'dns.opcode', + 'dns.query', + 'dns.rcode', + 'dns.rdata', + 'dns.rdataclass', + 'dns.rdataset', + 'dns.rdatatype', + 'dns.renderer', + 'dns.resolver', + 'dns.reversename', + 'dns.rrset', + 'dns.set', + 'dns.tokenizer', + 'dns.tsig', + 'dns.tsigkeyring', + 'dns.ttl', + 'dns.update', + 'dns.version', + 'dns.versioned', + 'dns.wiredata', + 'dns.zone'] +tmp_ret = collect_all('os_win') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] +tmp_ret = collect_all('wmi') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] +tmp_ret = collect_all('PyMI') +datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] + + +block_cipher = None + + +a = Analysis( + ['..\\eulerlauncher\\eulerlauncherd.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='eulerlauncherd', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=False, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['..\\etc\\images\\favicon.ico'], +) diff --git a/cli.spec b/specs/cli-mac.spec similarity index 100% rename from cli.spec rename to specs/cli-mac.spec diff --git a/specs/cli-win.spec b/specs/cli-win.spec new file mode 100644 index 0000000000000000000000000000000000000000..64d361227062174a424e040cd901d37f85dd68ea --- /dev/null +++ b/specs/cli-win.spec @@ -0,0 +1,45 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis( + ['..\\eulerlauncher\\cli.py'], + pathex=[], + binaries=[], + datas=[], + hiddenimports=['eventlet.hubs.epolls', 'eventlet.hubs.kqueue', 'eventlet.hubs.selects'], + 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='eulerlauncher', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + argv_emulation=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None, + icon=['..\\etc\\images\\favicon.ico'], +) diff --git a/install.spec b/specs/install.spec similarity index 79% rename from install.spec rename to specs/install.spec index 865540162d6c0d9702c87439db750868ff0adecf..2a0b158d011c1b722ded9b038cf659d88a645a22 100644 --- a/install.spec +++ b/specs/install.spec @@ -7,8 +7,8 @@ block_cipher = None a = Analysis( ['eulerlauncher/install.py'], pathex=[], - binaries=[('dist/eulerlauncher', './etc')], - datas=[('etc/eulerlauncher.conf', './etc'), ('resources/qemu/edk2-aarch64-code.fd', './etc'), ('resources/qemu/edk2-x86_64-code.fd', './etc')], + binaries=[('../dist/eulerlauncher', './etc')], + datas=[('../etc/eulerlauncher.conf', './etc'), ('../resources/qemu/edk2-aarch64-code.fd', './etc'), ('../resources/qemu/edk2-x86_64-code.fd', './etc')], hiddenimports=[], hookspath=[], hooksconfig={},