EG/packaging/debian/README.md
2026-04-07 09:57:39 +08:00

76 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# EG `.deb` 打包
这套脚本的目标不是重新编译项目,而是把已经生成好的 PyInstaller 发行目录再封装成 Debian 安装包。
默认输入目录是:
```text
dist/EGEditor
```
默认输出目录是:
```text
dist-deb
```
## 最常用流程
1. 先生成 PyInstaller 发行目录:
```bash
python -m PyInstaller --clean packaging/eg_editor.spec
```
2. 再生成 `.deb`
```bash
bash packaging/debian/build_deb.sh 0.1.0
```
生成结果类似:
```text
dist-deb/eg-editor_0.1.0_amd64.deb
```
## 安装与卸载
安装:
```bash
sudo apt install ./dist-deb/eg-editor_0.1.0_amd64.deb
```
卸载:
```bash
sudo apt remove eg-editor
```
## 安装后路径
- 程序主体:`/opt/eg-editor`
- 命令行启动:`/usr/bin/eg-editor`
- 桌面启动器:`/usr/share/applications/eg-editor.desktop`
- 图标:`/usr/share/pixmaps/eg-editor.png`
## 可选环境变量
- `APP_DIR`:指定要封装的 PyInstaller 目录
- `PACKAGE_NAME`Debian 包名,默认 `eg-editor`
- `DISPLAY_NAME`:桌面显示名称
- `ARCH`:包架构,默认自动读取 `dpkg-architecture`
- `MAINTAINER`:维护者字段
- `OUTPUT_DIR``.deb` 输出目录
- `ICON_SOURCE`:图标文件路径
示例:
```bash
APP_DIR=/path/to/dist/EGEditor \
DISPLAY_NAME="EG Editor" \
MAINTAINER="hello <hello@example.com>" \
bash packaging/debian/build_deb.sh 0.1.0
```