aboutsummaryrefslogtreecommitdiffhomepage
path: root/dist
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-04-05 20:57:01 +0900
committerOphestra <cat@gensokyo.uk>2026-04-05 23:58:08 +0900
commita69273ab2a7040ba906876e6d7888b4edeb74ebc (patch)
tree0379e49590110d6f4505e0de1671506a46da47b7 /dist
parent4cd0f57e48c94e7f628446d050027165fdd9e315 (diff)
cmd/dist: replace dist/release.sh
This is much more robust than a shell script. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'dist')
-rw-r--r--dist/comp/_hakurei85
-rw-r--r--dist/hsurc.default1
-rwxr-xr-xdist/install.sh12
-rwxr-xr-xdist/release.sh36
4 files changed, 0 insertions, 134 deletions
diff --git a/dist/comp/_hakurei b/dist/comp/_hakurei
deleted file mode 100644
index 11424612..00000000
--- a/dist/comp/_hakurei
+++ /dev/null
@@ -1,85 +0,0 @@
-#compdef hakurei
-
-_hakurei_run() {
- __hakurei_files
- return $?
-}
-
-_hakurei_exec() {
- _arguments \
- '--id[Reverse-DNS style Application identifier, leave empty to inherit instance identifier]:id' \
- '-a[Application identity]: :_numbers' \
- '-g[Groups inherited by all container processes]: :_groups' \
- '-d[Container home directory]: :_files -/' \
- '-u[Passwd user name within sandbox]: :_users' \
- '--private-runtime[Do not share XDG_RUNTIME_DIR between containers under the same identity]' \
- '--private-tmpdir[Do not share TMPDIR between containers under the same identity]' \
- '--wayland[Enable connection to Wayland via security-context-v1]' \
- '-X[Enable direct connection to X11]' \
- '--dbus[Enable proxied connection to D-Bus]' \
- '--pipewire[Enable connection to PipeWire via SecurityContext]' \
- '--pulse[Enable PulseAudio compatibility daemon]' \
- '--dbus-config[Path to session bus proxy config file]: :_files -g "*.json"' \
- '--dbus-system[Path to system bus proxy config file]: :_files -g "*.json"' \
- '--mpris[Allow owning MPRIS D-Bus path]' \
- '--dbus-log[Force buffered logging in the D-Bus proxy]'
-}
-
-_hakurei_ps() {
- _arguments \
- '--short[List instances only]'
-}
-
-_hakurei_show() {
- _alternative \
- 'instances:domains:__hakurei_instances' \
- 'files:files:__hakurei_files'
-}
-
-__hakurei_files() {
- _files -g "*.(json|hakurei)"
- return $?
-}
-
-__hakurei_instances() {
- local -a out
- shift -p
- out=( ${(f)"$(_call_program commands hakurei ps --short 2>&1)"} )
- if (( $#out == 0 )); then
- _message "No active instances"
- else
- _describe "active instances" out
- fi
- return $?
-}
-
-(( $+functions[_hakurei_commands] )) || _hakurei_commands()
-{
- local -a _hakurei_cmds
- _hakurei_cmds=(
- "run:Load and start container from configuration file"
- "exec:Configure and start a permissive container"
- "show:Show live or local instance configuration"
- "ps:List active instances"
- "version:Display version information"
- "license:Show full license text"
- "template:Produce a config template"
- "help:Show help message"
- )
- if (( CURRENT == 1 )); then
- _describe -t commands 'action' _hakurei_cmds || compadd "$@"
- else
- local curcontext="$curcontext"
- cmd="${${_hakurei_cmds[(r)$words[1]:*]%%:*}}"
- if (( $+functions[_hakurei_$cmd] )); then
- _hakurei_$cmd
- else
- _message "no more options"
- fi
- fi
-}
-
-_arguments -C \
- '-v[Increase log verbosity]' \
- '--json[Serialise output in JSON when applicable]' \
- '*::hakurei command:_hakurei_commands' \ No newline at end of file
diff --git a/dist/hsurc.default b/dist/hsurc.default
deleted file mode 100644
index f770d5ef..00000000
--- a/dist/hsurc.default
+++ /dev/null
@@ -1 +0,0 @@
-1000 0 \ No newline at end of file
diff --git a/dist/install.sh b/dist/install.sh
deleted file mode 100755
index a4352288..00000000
--- a/dist/install.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-cd "$(dirname -- "$0")" || exit 1
-
-install -vDm0755 "bin/hakurei" "${DESTDIR}/usr/bin/hakurei"
-install -vDm0755 "bin/sharefs" "${DESTDIR}/usr/bin/sharefs"
-
-install -vDm4511 "bin/hsu" "${DESTDIR}/usr/bin/hsu"
-if [ ! -f "${DESTDIR}/etc/hsurc" ]; then
- install -vDm0400 "hsurc.default" "${DESTDIR}/etc/hsurc"
-fi
-
-install -vDm0644 "comp/_hakurei" "${DESTDIR}/usr/share/zsh/site-functions/_hakurei" \ No newline at end of file
diff --git a/dist/release.sh b/dist/release.sh
deleted file mode 100755
index 1cfcc721..00000000
--- a/dist/release.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh -e
-cd "$(dirname -- "$0")/.."
-VERSION="${HAKUREI_VERSION:-untagged}"
-prefix="${PREFIX:-/usr}"
-pname="hakurei-${VERSION}-$(go env GOARCH)"
-out="${DESTDIR:-dist}/${pname}"
-
-destroy_workdir() {
- rm -rf "${out}"
-}
-trap destroy_workdir EXIT
-
-echo '# Preparing distribution files.'
-mkdir -p "${out}"
-cp -v "README.md" "dist/hsurc.default" "dist/install.sh" "${out}"
-cp -rv "dist/comp" "${out}"
-echo
-
-echo '# Building hakurei.'
-go generate ./...
-go build -trimpath -v -o "${out}/bin/" -ldflags "-s -w
- -buildid= -linkmode external -extldflags=-static
- -X hakurei.app/internal/info.buildVersion=${VERSION}
- -X hakurei.app/internal/info.hakureiPath=${prefix}/bin/hakurei
- -X hakurei.app/internal/info.hsuPath=${prefix}/bin/hsu
- -X main.hakureiPath=${prefix}/bin/hakurei" ./...
-echo
-
-echo '# Testing hakurei.'
-go test -ldflags='-buildid= -linkmode external -extldflags=-static' ./...
-echo
-
-echo '# Creating distribution.'
-rm -f "${out}.tar.gz" && tar -C "${out}/.." -vczf "${out}.tar.gz" "${pname}"
-(cd "${out}/.." && sha512sum "${pname}.tar.gz" > "${pname}.tar.gz.sha512")
-echo