mirror of
https://github.com/RubyMetric/chsrc
synced 2025-06-19 02:08:59 +08:00
Update DEB
doc
This commit is contained in:
parent
aa1ab323d9
commit
187f90dca5
@ -12,9 +12,7 @@
|
||||
|
||||
# 构建 DEB package
|
||||
|
||||
## 从源代码构建
|
||||
|
||||
### 准备
|
||||
## 准备
|
||||
|
||||
安装构建所需的依赖:
|
||||
|
||||
@ -23,20 +21,35 @@ sudo apt-get update
|
||||
sudo apt-get install build-essential debhelper devscripts fakeroot
|
||||
```
|
||||
|
||||
### 构建
|
||||
<br>
|
||||
|
||||
## 构建
|
||||
|
||||
```bash
|
||||
git clone https://github.com/RubyMetric/chsrc.git
|
||||
cd chsrc
|
||||
|
||||
# 执行构建命令
|
||||
./deb.makefile deb-build
|
||||
# 进入 DEB 目录
|
||||
cd pkg/DEB
|
||||
|
||||
# 安装生成的 .deb 文件
|
||||
sudo dpkg -i ../chsrc_*.deb
|
||||
# 执行构建命令
|
||||
./deb.makefile deb-make
|
||||
```
|
||||
|
||||
<br>
|
||||
### 调试构建
|
||||
|
||||
```bash
|
||||
# 启用详细输出
|
||||
DEB_BUILD_OPTIONS="nocheck" debuild -us -uc -b
|
||||
|
||||
# 检查构建日志
|
||||
less ../chsrc_*.build
|
||||
|
||||
# 检查包内容
|
||||
dpkg --contents ../chsrc_*.deb
|
||||
# 或
|
||||
dpkg-deb --contents ../chsrc_*.deb
|
||||
```
|
||||
|
||||
### 交叉编译
|
||||
|
||||
@ -52,20 +65,33 @@ CC=arm-linux-gnueabihf-gcc dpkg-buildpackage -us -uc -b -aarmhf
|
||||
|
||||
<br>
|
||||
|
||||
### 安装与测试
|
||||
### 安装
|
||||
|
||||
```bash
|
||||
# 安装生成的包
|
||||
sudo dpkg -i ../chsrc_*.deb
|
||||
sudo apt-get install -f # 修复依赖问题
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### 测试安装情况
|
||||
|
||||
```bash
|
||||
# 运行测试
|
||||
./deb-test.sh
|
||||
|
||||
# 卸载
|
||||
sudo apt-get remove chsrc
|
||||
# 查看文档安装情况
|
||||
man chsrc
|
||||
|
||||
# 查看 DEB 包的 copyright
|
||||
cat /usr/share/doc/chsrc/copyright
|
||||
|
||||
# 查看 DEB 包 changelog
|
||||
zless /usr/share/doc/chsrc/changelog.Debian.gz
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### 清理构建产物
|
||||
|
||||
```bash
|
||||
@ -91,23 +117,10 @@ sudo apt-get purge chsrc
|
||||
|
||||
## 故障排查
|
||||
|
||||
### 常见问题
|
||||
常见问题:
|
||||
|
||||
1. **构建失败**: 检查 debian/control 中的依赖是否正确
|
||||
2. **交叉编译失败**: 确认目标架构的工具链已正确安装
|
||||
3. **安装测试失败**: 检查 postinst 脚本是否有错误
|
||||
|
||||
### 调试构建
|
||||
|
||||
```bash
|
||||
# 启用详细输出
|
||||
DEB_BUILD_OPTIONS="nocheck" debuild -us -uc -b
|
||||
|
||||
# 检查构建日志
|
||||
less ../chsrc_*.build
|
||||
|
||||
# 检查包内容
|
||||
dpkg --contents ../chsrc_*.deb
|
||||
# 或
|
||||
dpkg-deb --contents ../chsrc_*.deb
|
||||
```
|
||||
<br>
|
||||
|
@ -44,7 +44,8 @@ CI 维护者 [@sanchuanhehe](https://github.com/sanchuanhehe)
|
||||
|
||||
DEB 包构建 CI 会在以下情况下自动触发:
|
||||
|
||||
1. **Release 事件**: 当创建新的 release 时自动构建并上传 DEB 包到 release assets
|
||||
1. **Push 事件**:当 push 到 `gh-build` 分支时自动构建,并上传 DEB 包 到 `pre` 这个特定的 release 中
|
||||
2. **Release 事件**: 当创建新的 release 时自动构建,并上传 DEB 包到最新的这个 release 中
|
||||
2. **手动触发**: 可以在 GitHub Actions 页面手动触发构建
|
||||
|
||||
<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user