From 4c7b72e7a06b2384976649d467fbd177748930aa Mon Sep 17 00:00:00 2001 From: m1ngsama Date: Sat, 23 May 2026 17:55:21 +0800 Subject: [PATCH] packaging: add debian package draft --- docs/CHANGELOG.md | 2 ++ packaging/README.md | 3 ++- packaging/debian/README.md | 21 ++++++++++++++++++--- packaging/debian/debian/changelog | 5 +++++ packaging/debian/debian/control | 22 ++++++++++++++++++++++ packaging/debian/debian/copyright | 26 ++++++++++++++++++++++++++ packaging/debian/debian/rules | 11 +++++++++++ packaging/debian/debian/source/format | 1 + scripts/release_check.sh | 11 +++++++++++ 9 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 packaging/debian/debian/changelog create mode 100644 packaging/debian/debian/control create mode 100644 packaging/debian/debian/copyright create mode 100755 packaging/debian/debian/rules create mode 100644 packaging/debian/debian/source/format diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 41b9f98..72de4b8 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -39,6 +39,8 @@ release for manual review instead of publishing immediately. - The one-line installer now downloads `checksums.txt`, verifies the selected binary before installation, and fails fast on missing release assets. +- Added a Debian packaging metadata draft for the future Ubuntu PPA path, with + lightweight validation in `make release-check`. ## 2026-05-18 - Interactive input polish diff --git a/packaging/README.md b/packaging/README.md index 63e7a83..f64981c 100644 --- a/packaging/README.md +++ b/packaging/README.md @@ -8,11 +8,12 @@ any public registry. - `arch/PKGBUILD` - AUR-ready draft for `tnt-chat`. - `homebrew/tnt-chat.rb` - Homebrew tap formula draft. -- `debian/README.md` - Ubuntu PPA / Debian packaging notes. +- `debian/` - Ubuntu PPA / Debian packaging notes and draft metadata. ## Release checklist 1. Confirm `TNT_VERSION` in `include/common.h` and the manpage version match. + Also update package versions in Arch, Homebrew, and Debian drafts. 2. Create a GitHub release tag such as `v1.0.0`. 3. Build and upload release tarballs or rely on GitHub source archives. 4. Replace placeholder checksums in package drafts. diff --git a/packaging/debian/README.md b/packaging/debian/README.md index 36f7910..5fb8fc5 100644 --- a/packaging/debian/README.md +++ b/packaging/debian/README.md @@ -4,6 +4,22 @@ Ubuntu distribution should start with a Launchpad PPA. Direct inclusion in Debian or Ubuntu archives is a separate, slower process and should wait until the project has a stable release cadence. +## Draft metadata + +The `debian/` directory in this folder is a packaging draft. To test it against +an upstream release tree, copy it to the root of a clean source checkout: + +```sh +cp -a packaging/debian/debian ./debian +dpkg-buildpackage -us -uc +``` + +For PPA uploads, build a signed source package instead: + +```sh +debuild -S +``` + ## Recommended path 1. Keep the upstream project installable with: @@ -12,14 +28,13 @@ the project has a stable release cadence. make DESTDIR="$pkgdir" PREFIX=/usr install ``` -2. Create Debian packaging metadata from a release tarball: +2. Review Debian packaging metadata from a release tarball: - `debian/control` - `debian/rules` - `debian/changelog` - `debian/copyright` - - `debian/install` - - optional `debian/tnt.service` + - `debian/source/format` 3. Build locally with `debuild` or `dpkg-buildpackage`. 4. Upload the signed source package to a Launchpad PPA. diff --git a/packaging/debian/debian/changelog b/packaging/debian/debian/changelog new file mode 100644 index 0000000..b029414 --- /dev/null +++ b/packaging/debian/debian/changelog @@ -0,0 +1,5 @@ +tnt-chat (1.0.0-1) unstable; urgency=medium + + * Initial package draft. + + -- M1ng Thu, 21 May 2026 00:00:00 +0800 diff --git a/packaging/debian/debian/control b/packaging/debian/debian/control new file mode 100644 index 0000000..d1c28fb --- /dev/null +++ b/packaging/debian/debian/control @@ -0,0 +1,22 @@ +Source: tnt-chat +Section: net +Priority: optional +Maintainer: M1ng +Build-Depends: + debhelper-compat (= 13), + libssh-dev, + make, + gcc +Standards-Version: 4.7.0 +Homepage: https://github.com/m1ngsama/TNT +Rules-Requires-Root: no + +Package: tnt-chat +Architecture: any +Depends: + ${misc:Depends}, + ${shlibs:Depends} +Description: SSH-native terminal chat server + TNT is a minimalist terminal chat server accessed over SSH. It provides a + Vim-style terminal interface, anonymous access by default, persistent message + history, and a small non-interactive SSH exec surface for scripts. diff --git a/packaging/debian/debian/copyright b/packaging/debian/debian/copyright new file mode 100644 index 0000000..4e67526 --- /dev/null +++ b/packaging/debian/debian/copyright @@ -0,0 +1,26 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: TNT +Source: https://github.com/m1ngsama/TNT + +Files: * +Copyright: 2026 M1ng +License: MIT + +License: MIT + 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 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. diff --git a/packaging/debian/debian/rules b/packaging/debian/debian/rules new file mode 100755 index 0000000..5a44a4f --- /dev/null +++ b/packaging/debian/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f + +%: + dh $@ + +override_dh_auto_build: + $(MAKE) + +override_dh_auto_install: + $(MAKE) DESTDIR=$(CURDIR)/debian/tnt-chat PREFIX=/usr install + $(MAKE) DESTDIR=$(CURDIR)/debian/tnt-chat PREFIX=/usr install-systemd diff --git a/packaging/debian/debian/source/format b/packaging/debian/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/packaging/debian/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/scripts/release_check.sh b/scripts/release_check.sh index 06eec2c..c3b3697 100755 --- a/scripts/release_check.sh +++ b/scripts/release_check.sh @@ -15,6 +15,7 @@ Default checks: - unit tests - staged install layout with PREFIX=/usr and DESTDIR - installer shell syntax + - Debian packaging metadata - Arch/Homebrew packaging syntax Environment: @@ -65,6 +66,10 @@ grep -q "^pkgver=$version$" packaging/arch/PKGBUILD || fail "packaging/arch/PKGBUILD pkgver does not match $version" grep -q "v${version}.tar.gz" packaging/homebrew/tnt-chat.rb || fail "packaging/homebrew/tnt-chat.rb URL does not match v$version" +grep -q "^tnt-chat (${version}-1)" packaging/debian/debian/changelog || + fail "packaging/debian/debian/changelog version does not match $version" +grep -q "^Source: tnt-chat$" packaging/debian/debian/control || + fail "packaging/debian/debian/control Source is not tnt-chat" step "building" make clean @@ -101,6 +106,12 @@ make DESTDIR="$tmpdir" PREFIX=/usr install-systemd step "checking installer syntax" sh -n install.sh +step "checking Debian packaging metadata" +[ -x packaging/debian/debian/rules ] || + fail "packaging/debian/debian/rules must be executable" +grep -q "^3.0 (quilt)$" packaging/debian/debian/source/format || + fail "unsupported Debian source format" + step "checking packaging syntax" if command -v bash >/dev/null 2>&1; then bash -n packaging/arch/PKGBUILD