testing/agate: new aport

This commit is contained in:
Cowington Post 2023-05-02 15:07:24 +00:00 committed by alice
parent 86cbfd95c2
commit 8c07fecb8e
4 changed files with 78 additions and 0 deletions

43
testing/agate/APKBUILD Normal file
View file

@ -0,0 +1,43 @@
# Maintainer: Cowington Post <cowingtonpost@gmail.com>
pkgname=agate
pkgver=3.3.0
pkgrel=0
pkgdesc="Simple Gemini server for static files"
url="https://github.com/mbrubeck/agate"
# rust-ring
arch="all !s390x !ppc64le !riscv64"
license="Apache-2.0"
makedepends="cargo"
install="$pkgname.pre-install"
subpackages="$pkgname-openrc"
source="$pkgname-$pkgver.tar.gz::https://github.com/mbrubeck/agate/archive/refs/tags/v$pkgver.tar.gz
agate.initd
agate.confd
$pkgname.pre-install
"
prepare() {
default_prepare
cargo fetch --target="$CTARGET" --locked
}
build() {
cargo build --release
}
check() {
cargo test
}
package() {
install -Dm755 target/release/agate -t "$pkgdir"/usr/bin
install -Dm755 "$srcdir"/agate.initd "$pkgdir"/etc/init.d/agate
install -Dm644 "$srcdir"/agate.confd "$pkgdir"/etc/conf.d/agate
}
sha512sums="
5f6ae32178b1f0d3e362045611f4cad21ca441610fea9e058384eea3368bf8119837cb5e754a357492111483477791730de0f2fb44ddbf2ca1547fa48a0c7294 agate-3.3.0.tar.gz
711c7687e3e5421d0d625a11aa0067cc5fb4dbe9656e8d9aee2dd1a0fa0befe7a83c705c4875c8f20d3701fa0557c80af4b82373bade7c5be2c4dbd27e9f5141 agate.initd
d8f54616edafaf513c591fc3ab405c65044a8f43cf1e50e43c7cac5ae3fa5c383a267108c10210ea236a5edfa1fcf2014a932e77bc216cc06dce83cab7e32c85 agate.confd
ca3e730be1524f2f020a92b74ba13b3a4efbef2a6ad5b727e7f693d5b06eabcfd7f5952bfb6b5cdafa01dd27e35a8e050b09ff6995f5e840e0bbb000dfd7574d agate.pre-install
"

View file

@ -0,0 +1,8 @@
output_log=/var/log/agate.log
error_log=/var/log/agate.log
content_path=/var/gemini/
certificate_path=/var/gemini/.certificates
hostname=localhost
# comment to run without process supervisor
supervisor=supervise-daemon

21
testing/agate/agate.initd Normal file
View file

@ -0,0 +1,21 @@
#!/sbin/openrc-run
name="agate"
command="/usr/bin/agate"
command_user="agate:agate"
command_background=true
pidfile="/run/$RC_SVCNAME.pid"
command_args="--content '$content_path' --certs '$certificate_path' --hostname '$hostname'"
depend() {
need net localmount
after firewall
}
start_pre() {
checkpath -f "$output_log" -o "$command_user"
checkpath -f "$error_log" -o "$command_user"
checkpath -d "$content_path" -o "$command_user"
checkpath -d "$certificate_path" -o "$command_user"
}

View file

@ -0,0 +1,6 @@
#!/bin/sh
addgroup -S agate 2>/dev/null
adduser -S -D -H -h /var/lib/agate -s /sbin/nologin -G agate -g agate agate 2>/dev/null2
exit 0