Add Homebrew service metadata

This commit is contained in:
m1ngsama 2026-05-28 09:11:25 +08:00
parent 51f264bca2
commit 57d0f931b5
4 changed files with 21 additions and 0 deletions

View file

@ -111,6 +111,8 @@
locale selection, matching the server CLI's i18n behavior.
- Arch and Debian packaging drafts now create the `tnt` system user used by
the packaged systemd unit, and release preflight checks that metadata.
- The Homebrew formula draft now defines a `brew services` entry that runs the
installed `tnt` binary with state under `var/tnt`.
- Split UI-language parsing from localized text lookup: `src/i18n.c` now owns
locale/code parsing, while `src/i18n_text.c` owns the table-driven text
catalog with coverage checks for every message ID.

View file

@ -6,6 +6,7 @@ project tap first, not Homebrew core:
```sh
brew tap m1ngsama/tnt
brew install tnt-chat
brew services start tnt-chat
```
Homebrew core should wait until TNT has stable releases and broader usage.
@ -18,6 +19,7 @@ From a tap repository:
brew audit --strict --online tnt-chat
brew install --build-from-source ./Formula/tnt-chat.rb
brew test tnt-chat
brew services run tnt-chat
```
For local syntax-only validation from this repository:

View file

@ -15,6 +15,17 @@ class TntChat < Formula
bin.install "#{buildpath}/stage#{prefix}/bin/tntctl"
man1.install "#{buildpath}/stage#{prefix}/share/man/man1/tnt.1"
man1.install "#{buildpath}/stage#{prefix}/share/man/man1/tntctl.1"
(var/"tnt").mkpath
(var/"log").mkpath
end
service do
run [opt_bin/"tnt", "-d", var/"tnt"]
keep_alive true
working_dir var/"tnt"
log_path var/"log/tnt.log"
error_log_path var/"log/tnt.log"
end
test do

View file

@ -179,6 +179,12 @@ grep -q '^u tnt ' packaging/arch/tnt-chat.sysusers ||
grep -q 'usr/lib/sysusers.d' packaging/arch/PKGBUILD ||
fail "PKGBUILD must install the sysusers.d file"
step "checking Homebrew service metadata"
grep -q "service do" packaging/homebrew/tnt-chat.rb ||
fail "Homebrew formula must define a brew services entry"
grep -q 'opt_bin/"tnt"' packaging/homebrew/tnt-chat.rb ||
fail "Homebrew service must run the installed tnt binary"
step "checking packaging syntax"
if command -v bash >/dev/null 2>&1; then
bash -n packaging/arch/PKGBUILD