feat(debian): 添加 DEB 包构建和发布工作流及相关文件

This commit is contained in:
sanchuanhehe
2025-06-10 14:33:48 +08:00
parent 463f9092a6
commit 089fc77486
15 changed files with 582 additions and 0 deletions

5
debian/changelog vendored Normal file
View File

@@ -0,0 +1,5 @@
chsrc (1.0.0) unstable; urgency=medium
* Initial debian package release
-- Aoran Zeng <ccmywish@qq.com> Mon, 10 Jun 2025 00:00:00 +0000

22
debian/chsrc.debhelper.log vendored Normal file
View File

@@ -0,0 +1,22 @@
dh_update_autotools_config
dh_auto_configure
dh_auto_build
dh_auto_test
dh_prep
dh_auto_install
dh_installdocs
dh_installchangelogs
dh_installman
dh_perl
dh_link
dh_strip_nondeterminism
dh_compress
dh_fixperms
dh_missing
dh_strip
dh_makeshlibs
dh_shlibdeps
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb

3
debian/chsrc.substvars vendored Normal file
View File

@@ -0,0 +1,3 @@
shlibs:Depends=libc6 (>= 2.34)
misc:Depends=
misc:Pre-Depends=

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
9

18
debian/control vendored Normal file
View File

@@ -0,0 +1,18 @@
Source: chsrc
Section: utils
Priority: optional
Maintainer: Aoran Zeng <ccmywish@qq.com>
Build-Depends: debhelper (>= 9), build-essential, libc6-dev
Standards-Version: 4.1.2
Homepage: https://github.com/RubyMetric/chsrc
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.

29
debian/copyright vendored Normal file
View File

@@ -0,0 +1,29 @@
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>
License: GPL-3.0-or-later
Files: debian/*
Copyright: 2025 Aoran Zeng <ccmywish@qq.com>
License: GPL-3.0-or-later
License: GPL-3.0-or-later
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".

31
debian/postinst vendored Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
# 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

22
debian/prerm vendored Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
# 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

16
debian/rules vendored Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_build:
$(MAKE) all
override_dh_auto_install:
mkdir -p debian/chsrc/usr/bin
mkdir -p debian/chsrc/usr/share/man/man1
cp chsrc debian/chsrc/usr/bin/
cp doc/chsrc.1 debian/chsrc/usr/share/man/man1/
override_dh_auto_clean:
$(MAKE) clean