Use standard lower-case deb

This commit is contained in:
Aoran Zeng 2025-06-16 16:45:32 +08:00
parent 02c3a815de
commit 975b2391cb
No known key found for this signature in database
GPG Key ID: 8F8BA8488E10ED98
16 changed files with 61 additions and 61 deletions

View File

@ -1,12 +1,12 @@
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Workflow File : pkg-DEB.yml # Workflow File : pkg-deb.yml
# File Authors : sanchuanhehe <wyihe5520@gmail.com> # File Authors : sanchuanhehe <wyihe5520@gmail.com>
# Contributors : Aoran Zeng <ccmywish@qq.com> # Contributors : Aoran Zeng <ccmywish@qq.com>
# | # |
# Created On : <2025-06-10> # Created On : <2025-06-10>
# Last Modified : <2025-06-16> # Last Modified : <2025-06-16>
# #
# Build and publish DEB packages # Build and publish deb packages
# --------------------------------------------------------------- # ---------------------------------------------------------------
name: 构建发布deb包 name: 构建发布deb包
@ -66,7 +66,7 @@ jobs:
run: | run: |
version="${{ steps.get_version.outputs.version }}" version="${{ steps.get_version.outputs.version }}"
cd ./pkg/DEB cd ./pkg/deb
(cat << EOF; cat ./debian/changelog) > new_changelog (cat << EOF; cat ./debian/changelog) > new_changelog
chsrc ($version-1) unstable; urgency=medium chsrc ($version-1) unstable; urgency=medium
@ -118,7 +118,7 @@ jobs:
sudo dpkg -i dist/chsrc_${version}-1_amd64.deb || true sudo dpkg -i dist/chsrc_${version}-1_amd64.deb || true
sudo apt-get install -f -y || true sudo apt-get install -f -y || true
bash pkg/DEB/deb-installation-test.sh bash pkg/deb/deb-installation-test.sh
- name: 上传deb包到artifacts - name: 上传deb包到artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

18
.gitignore vendored
View File

@ -36,20 +36,20 @@ chsrc.toc
############################## ##############################
# DEB package # deb package
############################## ##############################
# DEB package 未归档的目录 # deb package 未归档的目录
pkg/DEB/debian/chsrc/ pkg/deb/debian/chsrc/
# 下面这个目录包含创建出 $HOME 的虚拟环境 # 下面这个目录包含创建出 $HOME 的虚拟环境
pkg/DEB/debian/.debhelper/ pkg/deb/debian/.debhelper/
pkg/DEB/debian/debhelper-build-stamp pkg/deb/debian/debhelper-build-stamp
pkg/DEB/debian/files pkg/deb/debian/files
pkg/DEB/debian/chsrc.debhelper.log pkg/deb/debian/chsrc.debhelper.log
pkg/DEB/debian/chsrc.substvars pkg/deb/debian/chsrc.substvars
# 以下为 DEB package 构建的直接产物 # 以下为 deb package 构建的直接产物
chsrc_*.deb chsrc_*.deb
chsrc-dbgsym_*.ddeb chsrc-dbgsym_*.ddeb
chsrc_*.build chsrc_*.build

View File

@ -120,10 +120,10 @@ clean:
-@rm chsrc 2>/dev/null -@rm chsrc 2>/dev/null
-@rm README.md.bak* 2>/dev/null -@rm README.md.bak* 2>/dev/null
# -include pkg/DEB/deb.makefile # 不这么做,因为 pkg/DEB/deb.makefile 需要在 pkg/DEB 目录下执行 # -include pkg/deb/deb.makefile # 不这么做,因为 pkg/deb/deb.makefile 需要在 pkg/deb 目录下执行
# 保持动词在前的任务名风格 # 保持动词在前的任务名风格
build-deb: build-deb:
@$(MAKE) -C pkg/DEB -f deb.makefile deb-build @$(MAKE) -C pkg/deb -f deb.makefile deb-build
install: $(Target-Name) install: $(Target-Name)
install -D -m 755 $(Target-Name) $(DESTDIR)/usr/bin/$(Target-Name) install -D -m 755 $(Target-Name) $(DESTDIR)/usr/bin/$(Target-Name)

View File

@ -155,7 +155,7 @@ curl -L https://gitee.com/RubyMetric/chsrc/releases/download/pre/chsrc-x86-windo
<details> <details>
<summary>Linux</summary> <summary>Linux</summary>
- 支持 `DEB`可通过 `apt`/`dpkg` 安装,感谢 [@sanchuanhehe] - 可通过 `apt`/`dpkg` 安装,感谢 [@sanchuanhehe]
```bash ```bash
$ sudo apt install ./chsrc_<ver>_<arch>.deb $ sudo apt install ./chsrc_<ver>_<arch>.deb

View File

@ -51,6 +51,6 @@ yay -S chsrc-git # Build from the latest main branch (stable)
## 打包情况 ## 打包情况
- [x] `DEB` - [x] `deb`
<br> <br>

View File

@ -7,10 +7,10 @@
! Contributors : Aoran Zeng <ccmywish@qq.com> ! Contributors : Aoran Zeng <ccmywish@qq.com>
! | ! |
! Created On : <2025-06-14> ! Created On : <2025-06-14>
! Last Modified : <2025-06-15> ! Last Modified : <2025-06-16>
! ---------------------------------------------------------- --> ! ---------------------------------------------------------- -->
# 构建 DEB package # 构建 deb package
## 准备 ## 准备
@ -29,8 +29,8 @@ sudo apt-get install build-essential debhelper devscripts fakeroot
git clone https://github.com/RubyMetric/chsrc.git git clone https://github.com/RubyMetric/chsrc.git
cd chsrc cd chsrc
# 进入 DEB 目录 # 进入 deb 目录
cd pkg/DEB cd pkg/deb
# 执行构建命令 # 执行构建命令
./deb.makefile deb-make ./deb.makefile deb-make
@ -83,10 +83,10 @@ bash ./deb-installation-test.sh
# 查看文档安装情况 # 查看文档安装情况
man chsrc man chsrc
# 查看 DEB 包的 copyright # 查看 deb 包的 copyright
cat /usr/share/doc/chsrc/copyright cat /usr/share/doc/chsrc/copyright
# 查看 DEB 包 changelog # 查看 deb 包 changelog
zless /usr/share/doc/chsrc/changelog.Debian.gz zless /usr/share/doc/chsrc/changelog.Debian.gz
``` ```

View File

@ -10,21 +10,21 @@
! Last Modified : <2025-06-16> ! Last Modified : <2025-06-16>
! ---------------------------------------------------------- --> ! ---------------------------------------------------------- -->
# DEB package CI/CD # deb package CI/CD
本文档说明了 chsrc 项目的 DEB 包自动构建和发布流程。 本文档说明了 chsrc 项目的 deb 包自动构建和发布流程。
## CI 文件 ## CI 文件
CI 维护者 [@sanchuanhehe](https://github.com/sanchuanhehe) CI 维护者 [@sanchuanhehe](https://github.com/sanchuanhehe)
- [.github/workflows/pkg-DEB.yml](../../.github/workflows/pkg-DEB.yml) - [.github/workflows/pkg-deb.yml](../../.github/workflows/pkg-deb.yml)
<br> <br>
## 支持的架构 ## 支持的架构
当前支持以下架构的 DEB 包构建: 当前支持以下架构的 deb 包构建:
- `amd64` (x86_64) - `amd64` (x86_64)
@ -34,7 +34,7 @@ CI 维护者 [@sanchuanhehe](https://github.com/sanchuanhehe)
每次 CI 构建会生成: 每次 CI 构建会生成:
1. **DEB 包文件**: `chsrc_<version>-1_<arch>.deb` 1. **deb 包文件**: `chsrc_<version>-1_<arch>.deb`
2. **仓库元数据**: `Packages``Packages.gz` 文件用于创建 APT 仓库 2. **仓库元数据**: `Packages``Packages.gz` 文件用于创建 APT 仓库
<br> <br>
@ -42,10 +42,10 @@ CI 维护者 [@sanchuanhehe](https://github.com/sanchuanhehe)
## 自动触发 ## 自动触发
DEB 包构建 CI 会在以下情况下自动触发: deb 包构建 CI 会在以下情况下自动触发:
1. **Push 事件**:当 push 到 `gh-build` 分支时自动构建,并上传 DEB 包 到 `pre` 这个特定的 release 中 1. **Push 事件**:当 push 到 `gh-build` 分支时自动构建,并上传 deb 包 到 `pre` 这个特定的 release 中
2. **Release 事件**: 当创建新的 release 时自动构建,并上传 DEB 包到最新的这个 release 中 2. **Release 事件**: 当创建新的 release 时自动构建,并上传 deb 包到最新的这个 release 中
2. **手动触发**: 可以在 GitHub Actions 页面手动触发构建 2. **手动触发**: 可以在 GitHub Actions 页面手动触发构建
<br> <br>
@ -56,6 +56,6 @@ DEB 包构建 CI 会在以下情况下自动触发:
2. 更新版本号和 changelog 2. 更新版本号和 changelog
3. 创建并推送 git tag: `git tag v1.2.3 && git push origin v1.2.3` 3. 创建并推送 git tag: `git tag v1.2.3 && git push origin v1.2.3`
4. 在 GitHub 上创建 release 4. 在 GitHub 上创建 release
5. CI 将自动构建并上传 DEB 5. CI 将自动构建并上传 deb
<br> <br>

View File

@ -8,12 +8,12 @@
! Contributors : Nil Null <nil@null.org> ! Contributors : Nil Null <nil@null.org>
! | ! |
! Created On : <2025-06-14> ! Created On : <2025-06-14>
! Last Modified : <2025-06-15> ! Last Modified : <2025-06-16>
! ---------------------------------------------------------- --> ! ---------------------------------------------------------- -->
# DEB package # deb package
本文档说明了 `chsrc` 项目的 DEB 包的相关情况 本文档说明了 `chsrc` 项目的 deb 包的相关情况
<br> <br>
@ -24,24 +24,24 @@
<wbr> <wbr>
- `debian/` - DEB 包构建配置目录 - `debian/` - deb 包构建配置目录
- `BUILD.md` - 如何手动构建 - `BUILD.md` - 如何手动构建
- `deb.makefile` - DEB 包构建 Makefile - `deb.makefile` - deb 包构建 Makefile
- `deb-installation-test.sh` - DEB**已正确安装** 测试脚本 - `deb-installation-test.sh` - deb**已正确安装** 测试脚本
<br> <br>
## 安装 ## 安装
如果你是普通用户,你应该从 [GitHub Releases](https://github.com/RubyMetric/chsrc/releases) 下载合适的 DEB package,然后运行以下命令安装: 如果你是普通用户,你应该从 [GitHub Releases](https://github.com/RubyMetric/chsrc/releases) 下载合适的 deb 包,然后运行以下命令安装:
```bash ```bash
sudo dpkg -i chsrc_*.deb sudo dpkg -i chsrc_*.deb
sudo apt-get install -f # Fix any dependency issues sudo apt-get install -f # Fix any dependency issues
``` ```
如果你是高级用户,你可以自己阅读本目录下的 [./BUILD.md](./BUILD.md) 来自己构建 DEB 包并按照上述同样的方式安装。 如果你是高级用户,你可以自己阅读本目录下的 [./BUILD.md](./BUILD.md) 来自己构建 deb 包并按照上述同样的方式安装。
<br> <br>

View File

@ -7,14 +7,14 @@
# Contributors : Aoran Zeng <ccmywish@qq.com> # Contributors : Aoran Zeng <ccmywish@qq.com>
# | # |
# Created On : <2025-06-14> # Created On : <2025-06-14>
# Last Modified : <2025-06-15> # Last Modified : <2025-06-16>
# #
# Test script for DEB package installation # Test script for deb package installation
# -------------------------------------------------------------- # --------------------------------------------------------------
set -e set -e
echo "Testing installation of DEB package 'chsrc' ..." echo "Testing installation of deb package 'chsrc' ..."
# Test 1: Check if chsrc binary exists and is executable # Test 1: Check if chsrc binary exists and is executable
if [ ! -f "/usr/bin/chsrc" ]; then if [ ! -f "/usr/bin/chsrc" ]; then
@ -52,4 +52,4 @@ else
exit 1 exit 1
fi fi
echo "All installation tests of DEB package 'chsrc' passed!" echo "All installation tests of deb package 'chsrc' passed!"

View File

@ -7,9 +7,9 @@
# Contributors : Aoran Zeng <ccmywish@qq.com> # Contributors : Aoran Zeng <ccmywish@qq.com>
# | # |
# Created On : <2025-06-14> # Created On : <2025-06-14>
# Last Modified : <2025-06-15> # Last Modified : <2025-06-16>
# #
# DEB package targets # deb package targets
# #
# @issue https://github.com/RubyMetric/chsrc/pull/206 # @issue https://github.com/RubyMetric/chsrc/pull/206
# 这些本是 debhelper 兼容性版本 (debian/compat) 为 9 时所需要定义的 targets # 这些本是 debhelper 兼容性版本 (debian/compat) 为 9 时所需要定义的 targets
@ -20,18 +20,18 @@
all: deb-build all: deb-build
deb-prepare: deb-prepare:
@echo "Starting: Prepare for building DEB package" @echo "Starting: Prepare for building deb package"
@echo "Finished: Prepare for building DEB package" @echo "Finished: Prepare for building deb package"
deb-build: deb-prepare deb-build: deb-prepare
@echo "Starting: Build DEB package" @echo "Starting: Build deb package"
@debuild -us -uc -b @debuild -us -uc -b
@echo "Finished: Build DEB package" @echo "Finished: Build deb package"
deb-clean: deb-clean:
@echo "Starting: Clean DEB build artifacts" @echo "Starting: Clean deb build artifacts"
-@rm -rf debian/chsrc/ -@rm -rf debian/chsrc/
-@rm -f ../chsrc_*.deb ../chsrc-dbgsym_*.ddeb ../chsrc_*.changes ../chsrc_*.buildinfo ../chsrc_*.build -@rm -f ../chsrc_*.deb ../chsrc-dbgsym_*.ddeb ../chsrc_*.changes ../chsrc_*.buildinfo ../chsrc_*.build
@echo "Finished: Clean DEB build artifacts" @echo "Finished: Clean deb build artifacts"
.PHONY: deb-prepare deb-build deb-clean .PHONY: deb-prepare deb-build deb-clean

View File

@ -1,11 +1,11 @@
chsrc (0.2.1-1) unstable; urgency=medium chsrc (0.2.0-1) unstable; urgency=medium
* v0.2.1 已发布 * v0.2.0 已发布
-- Aoran Zeng <ccmywish@qq.com> Sun, 15 Jun 2025 13:32:50 +0800 -- Aoran Zeng <ccmywish@qq.com> Sun, 15 Jun 2025 13:32:50 +0800
chsrc (0.0.1-1) unstable; urgency=medium chsrc (0.0.1-1) unstable; urgency=medium
* Initial DEB package get packaged! * Initial deb package get packaged!
-- sanchuanhehe <wyihe5520@gmail.com> Mon, 10 Jun 2025 00:00:00 +0000 -- sanchuanhehe <wyihe5520@gmail.com> Mon, 10 Jun 2025 00:00:00 +0000

View File

@ -14,7 +14,7 @@ Copyright: 2023-2025 Aoran Zeng <ccmywish@qq.com>
2023-2025 Heng Guo <2085471348@qq.com> 2023-2025 Heng Guo <2085471348@qq.com>
License: MIT License: MIT
Files: pkg/DEB/debian/* Files: pkg/deb/debian/*
Copyright: 2025 sanchuanhehe <wyihe5520@gmail.com> Copyright: 2025 sanchuanhehe <wyihe5520@gmail.com>
License: GPL-3+ License: GPL-3+

View File

@ -2,12 +2,12 @@
# -------------------------------------------------------------- # --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# -------------------------------------------------------------- # --------------------------------------------------------------
# DEB File : postinst # deb File : postinst
# File Authors : sanchuanhehe <wyihe5520@gmail.com> # File Authors : sanchuanhehe <wyihe5520@gmail.com>
# Contributors : Nil Null <nil@null.org> # Contributors : Nil Null <nil@null.org>
# | # |
# Created On : <2025-06-14> # Created On : <2025-06-14>
# Last Modified : <2025-06-15> # Last Modified : <2025-06-16>
# #
# postinst script for chsrc # postinst script for chsrc
# -------------------------------------------------------------- # --------------------------------------------------------------

View File

@ -2,12 +2,12 @@
# -------------------------------------------------------------- # --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# -------------------------------------------------------------- # --------------------------------------------------------------
# DEB File : prerm # deb File : prerm
# File Authors : sanchuanhehe <wyihe5520@gmail.com> # File Authors : sanchuanhehe <wyihe5520@gmail.com>
# Contributors : Nil Null <nil@null.org> # Contributors : Nil Null <nil@null.org>
# | # |
# Created On : <2025-06-14> # Created On : <2025-06-14>
# Last Modified : <2025-06-15> # Last Modified : <2025-06-16>
# #
# prerm script for chsrc # prerm script for chsrc
# -------------------------------------------------------------- # --------------------------------------------------------------

View File

@ -35,7 +35,7 @@
# 3. dh binary (debian/rules override_dh_auto_install) # 3. dh binary (debian/rules override_dh_auto_install)
# -------------------------------------------------------------- # --------------------------------------------------------------
# 由于 debuild 要寻找 debian/ 目录,因此当前工作目录一定在 pkg/DEB # 由于 debuild 要寻找 debian/ 目录,因此当前工作目录一定在 pkg/deb
Chsrc-Root-Dir = $(CURDIR)/../../ Chsrc-Root-Dir = $(CURDIR)/../../
%: %: