mirror of
https://oauth2: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@github.com/m1ngsama/TNT.git
synced 2026-06-26 05:44:38 +08:00
Add package system user metadata
This commit is contained in:
parent
b23b1ba194
commit
51f264bca2
8 changed files with 37 additions and 3 deletions
|
|
@ -109,6 +109,8 @@
|
||||||
instead of being rejected locally.
|
instead of being rejected locally.
|
||||||
- `tntctl` local help and local validation errors now follow `TNT_LANG` and
|
- `tntctl` local help and local validation errors now follow `TNT_LANG` and
|
||||||
locale selection, matching the server CLI's i18n behavior.
|
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.
|
||||||
- Split UI-language parsing from localized text lookup: `src/i18n.c` now owns
|
- 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
|
locale/code parsing, while `src/i18n_text.c` owns the table-driven text
|
||||||
catalog with coverage checks for every message ID.
|
catalog with coverage checks for every message ID.
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ pkgbase = tnt-chat
|
||||||
makedepends = make
|
makedepends = make
|
||||||
depends = libssh
|
depends = libssh
|
||||||
source = tnt-chat-1.0.1.tar.gz::https://github.com/m1ngsama/TNT/archive/refs/tags/v1.0.1.tar.gz
|
source = tnt-chat-1.0.1.tar.gz::https://github.com/m1ngsama/TNT/archive/refs/tags/v1.0.1.tar.gz
|
||||||
|
source = tnt-chat.sysusers
|
||||||
sha256sums = SKIP
|
sha256sums = SKIP
|
||||||
|
sha256sums = 8a1f7dfbdc9f1305c4ed50d80e89f91333ffdf937890c497f93e41abaf76e3ed
|
||||||
|
|
||||||
pkgname = tnt-chat
|
pkgname = tnt-chat
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,10 @@ url='https://github.com/m1ngsama/TNT'
|
||||||
license=('MIT')
|
license=('MIT')
|
||||||
depends=('libssh')
|
depends=('libssh')
|
||||||
makedepends=('gcc' 'make')
|
makedepends=('gcc' 'make')
|
||||||
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
|
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz"
|
||||||
sha256sums=('SKIP')
|
"${pkgname}.sysusers")
|
||||||
|
sha256sums=('SKIP'
|
||||||
|
'8a1f7dfbdc9f1305c4ed50d80e89f91333ffdf937890c497f93e41abaf76e3ed')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
cd "TNT-${pkgver}"
|
cd "TNT-${pkgver}"
|
||||||
|
|
@ -21,5 +23,7 @@ package() {
|
||||||
cd "TNT-${pkgver}"
|
cd "TNT-${pkgver}"
|
||||||
make DESTDIR="${pkgdir}" PREFIX=/usr install
|
make DESTDIR="${pkgdir}" PREFIX=/usr install
|
||||||
make DESTDIR="${pkgdir}" PREFIX=/usr install-systemd
|
make DESTDIR="${pkgdir}" PREFIX=/usr install-systemd
|
||||||
|
install -Dm644 "${srcdir}/${pkgname}.sysusers" \
|
||||||
|
"${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
|
||||||
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
1
packaging/arch/tnt-chat.sysusers
Normal file
1
packaging/arch/tnt-chat.sysusers
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
u tnt - "TNT chat server" /var/lib/tnt -
|
||||||
|
|
@ -47,3 +47,5 @@ debuild -S
|
||||||
- Installed commands: `/usr/bin/tnt`, `/usr/bin/tntctl`
|
- Installed commands: `/usr/bin/tnt`, `/usr/bin/tntctl`
|
||||||
- Runtime dependency: `libssh`
|
- Runtime dependency: `libssh`
|
||||||
- Optional systemd unit: `/usr/lib/systemd/system/tnt.service`
|
- Optional systemd unit: `/usr/lib/systemd/system/tnt.service`
|
||||||
|
- System user: package maintainer scripts create `tnt:tnt`; the systemd unit
|
||||||
|
owns `/var/lib/tnt` through `StateDirectory=tnt`
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ Package: tnt-chat
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends:
|
Depends:
|
||||||
${misc:Depends},
|
${misc:Depends},
|
||||||
${shlibs:Depends}
|
${shlibs:Depends},
|
||||||
|
adduser
|
||||||
Description: SSH-native terminal chat server
|
Description: SSH-native terminal chat server
|
||||||
TNT is a minimalist terminal chat server accessed over SSH. It provides a
|
TNT is a minimalist terminal chat server accessed over SSH. It provides a
|
||||||
Vim-style terminal interface, anonymous access by default, persistent message
|
Vim-style terminal interface, anonymous access by default, persistent message
|
||||||
|
|
|
||||||
10
packaging/debian/debian/postinst
Executable file
10
packaging/debian/debian/postinst
Executable file
|
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ "$1" = "configure" ] && ! getent passwd tnt >/dev/null; then
|
||||||
|
adduser --system --group --home /var/lib/tnt --no-create-home --gecos "TNT chat server" tnt
|
||||||
|
fi
|
||||||
|
|
||||||
|
#DEBHELPER#
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
@ -164,8 +164,20 @@ sh -n install.sh
|
||||||
step "checking Debian packaging metadata"
|
step "checking Debian packaging metadata"
|
||||||
[ -x packaging/debian/debian/rules ] ||
|
[ -x packaging/debian/debian/rules ] ||
|
||||||
fail "packaging/debian/debian/rules must be executable"
|
fail "packaging/debian/debian/rules must be executable"
|
||||||
|
[ -x packaging/debian/debian/postinst ] ||
|
||||||
|
fail "packaging/debian/debian/postinst must be executable"
|
||||||
grep -q "^3.0 (quilt)$" packaging/debian/debian/source/format ||
|
grep -q "^3.0 (quilt)$" packaging/debian/debian/source/format ||
|
||||||
fail "unsupported Debian source format"
|
fail "unsupported Debian source format"
|
||||||
|
grep -q "adduser .* tnt" packaging/debian/debian/postinst ||
|
||||||
|
fail "Debian postinst must create the tnt system user"
|
||||||
|
grep -q " adduser" packaging/debian/debian/control ||
|
||||||
|
fail "Debian package must depend on adduser for postinst user creation"
|
||||||
|
|
||||||
|
step "checking packaged system user metadata"
|
||||||
|
grep -q '^u tnt ' packaging/arch/tnt-chat.sysusers ||
|
||||||
|
fail "Arch sysusers file must create the tnt system user"
|
||||||
|
grep -q 'usr/lib/sysusers.d' packaging/arch/PKGBUILD ||
|
||||||
|
fail "PKGBUILD must install the sysusers.d file"
|
||||||
|
|
||||||
step "checking packaging syntax"
|
step "checking packaging syntax"
|
||||||
if command -v bash >/dev/null 2>&1; then
|
if command -v bash >/dev/null 2>&1; then
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue