- Bundle the server into dist/rotrouter.cjs with esbuild (npm run build), so the package needs only nodejs at runtime and is arch=any. - Read the config and static file paths from ROTROUTER_CONFIG and ROTROUTER_PUBLIC (defaults unchanged for npm start). - PKGBUILD for rotrouter-git and a hardened systemd unit running as a DynamicUser without capabilities. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
46 lines
1.1 KiB
Bash
46 lines
1.1 KiB
Bash
# Maintainer: ericek111
|
|
|
|
pkgname=rotrouter-git
|
|
_pkgname=RotRouter
|
|
pkgver=r0
|
|
pkgrel=1
|
|
pkgdesc='Routes N1MM Logger+ antenna rotator commands to the right rotator controller by band'
|
|
arch=('any')
|
|
url='https://git.lixko.eu/ericek111/RotRouter'
|
|
license=('ISC')
|
|
depends=('nodejs')
|
|
makedepends=('git' 'npm')
|
|
provides=('rotrouter')
|
|
conflicts=('rotrouter')
|
|
backup=('etc/rotrouter/config.json')
|
|
source=("$_pkgname::git+ssh://git@git.lixko.eu/ericek111/RotRouter.git")
|
|
sha256sums=('SKIP')
|
|
|
|
pkgver() {
|
|
cd "$_pkgname"
|
|
printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
|
|
}
|
|
|
|
prepare() {
|
|
cd "$_pkgname"
|
|
npm ci --cache "$srcdir/npm-cache" --no-audit --no-fund
|
|
}
|
|
|
|
build() {
|
|
cd "$_pkgname"
|
|
npm run build
|
|
}
|
|
|
|
check() {
|
|
cd "$_pkgname"
|
|
npm run typecheck
|
|
}
|
|
|
|
package() {
|
|
cd "$_pkgname"
|
|
install -Dm644 dist/rotrouter.cjs "$pkgdir/usr/lib/rotrouter/rotrouter.cjs"
|
|
install -Dm644 public/index.html "$pkgdir/usr/share/rotrouter/public/index.html"
|
|
install -Dm644 config.json "$pkgdir/etc/rotrouter/config.json"
|
|
install -Dm644 packaging/arch/rotrouter.service "$pkgdir/usr/lib/systemd/system/rotrouter.service"
|
|
}
|