Use standard lower-case deb

This commit is contained in:
Aoran Zeng
2025-06-16 16:45:32 +08:00
parent 02c3a815de
commit 975b2391cb
16 changed files with 61 additions and 61 deletions

11
pkg/deb/debian/changelog Normal file
View File

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

18
pkg/deb/debian/control Normal file
View File

@@ -0,0 +1,18 @@
Source: chsrc
Section: utils
Priority: optional
Maintainer: sanchuanhehe <wyihe5520@gmail.com>
Build-Depends: debhelper-compat (= 13), build-essential, libc6-dev
Standards-Version: 4.6.0
Homepage: https://chsrc.run/
Vcs-Git: https://github.com/RubyMetric/chsrc.git
Vcs-Browser: https://github.com/RubyMetric/chsrc
Package: chsrc
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Change Source - A tool for changing software sources
chsrc is a command-line tool for changing software sources (mirrors)
for various package managers and programming language ecosystems.
It supports automatic detection and switching of sources for better
download speeds in different regions.

50
pkg/deb/debian/copyright Normal file
View File

@@ -0,0 +1,50 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: chsrc
Upstream-Contact: Aoran Zeng <ccmywish@qq.com>
Source: https://github.com/RubyMetric/chsrc
Files: *
Copyright: 2023-2025 Aoran Zeng <ccmywish@qq.com>
2023-2025 Heng Guo <2085471348@qq.com>
License: GPL-3+
Comment: The authors' names are indicated in each source code file's header.
Files: lib/xy.h
Copyright: 2023-2025 Aoran Zeng <ccmywish@qq.com>
2023-2025 Heng Guo <2085471348@qq.com>
License: MIT
Files: pkg/deb/debian/*
Copyright: 2025 sanchuanhehe <wyihe5520@gmail.com>
License: GPL-3+
License: GPL-3+
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
Comment:
On Debian systems, the full text of the GNU General Public License
version 3 can be found in the file '/usr/share/common-licenses/GPL-3'.
License: MIT
MIT License
Copyright (c) 2023-2025 曾奥然 (Aoran Zeng), 郭恒 (Heng Guo)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

42
pkg/deb/debian/postinst Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/sh
# --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later
# --------------------------------------------------------------
# deb File : postinst
# File Authors : sanchuanhehe <wyihe5520@gmail.com>
# Contributors : Nil Null <nil@null.org>
# |
# Created On : <2025-06-14>
# Last Modified : <2025-06-16>
#
# postinst script for chsrc
# --------------------------------------------------------------
set -e
case "$1" in
configure)
# Update man database
if command -v mandb >/dev/null 2>&1; then
mandb -q /usr/share/man/man1/chsrc.1 2>/dev/null || true
fi
# Make sure chsrc is executable
chmod +x /usr/bin/chsrc
echo "chsrc has been successfully installed!"
echo "Run 'chsrc help' to get started."
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

33
pkg/deb/debian/prerm Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later
# --------------------------------------------------------------
# deb File : prerm
# File Authors : sanchuanhehe <wyihe5520@gmail.com>
# Contributors : Nil Null <nil@null.org>
# |
# Created On : <2025-06-14>
# Last Modified : <2025-06-16>
#
# prerm script for chsrc
# --------------------------------------------------------------
set -e
case "$1" in
remove|upgrade|deconfigure)
# Nothing special to do during removal
;;
failed-upgrade)
;;
*)
echo "prerm called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

49
pkg/deb/debian/rules Executable file
View File

@@ -0,0 +1,49 @@
#!/usr/bin/make -f
# --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later
# --------------------------------------------------------------
# Build File : rules
# File Authors : sanchuanhehe <wyihe5520@gmail.com>
# | Aoran Zeng <ccmywish@qq.com>
# Contributors : Nil Null <nil@null.org>
# |
# Created On : <2025-06-14>
# Last Modified : <2025-06-15>
#
# 该文件是 Makefile 格式
# --------------------------------------------------------------
#
# debuild 调用 dpkg-buildpackage
#
# dpkg-buildpackage 通过调用 fakeroot debian/rules <target> 执行本文件
#
# 由于下面的 %,所有任务都将被传递给 dh
#
# 比如:
#
# debian/rules <target>
#
# 会转换为:
#
# dh <target>
#
# 来执行
#
# 简单理解,将顺序调用:
# 1. dh clean
# 2. dh build (debian/rules override_dh_auto_build)
# 3. dh binary (debian/rules override_dh_auto_install)
# --------------------------------------------------------------
# 由于 debuild 要寻找 debian/ 目录,因此当前工作目录一定在 pkg/deb 下
Chsrc-Root-Dir = $(CURDIR)/../../
%:
dh $@
override_dh_auto_build:
# 切换到 chsrc 根目录
@$(MAKE) -C $(Chsrc-Root-Dir) all
override_dh_auto_install:
@$(MAKE) -C $(Chsrc-Root-Dir) install DESTDIR=$(CURDIR)/debian/chsrc