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