From 8c07fecb8e4eb7c19bd4e3848fee339007b61e96 Mon Sep 17 00:00:00 2001 From: Cowington Post Date: Tue, 2 May 2023 15:07:24 +0000 Subject: [PATCH] testing/agate: new aport --- testing/agate/APKBUILD | 43 +++++++++++++++++++++++++++++++++ testing/agate/agate.confd | 8 ++++++ testing/agate/agate.initd | 21 ++++++++++++++++ testing/agate/agate.pre-install | 6 +++++ 4 files changed, 78 insertions(+) create mode 100644 testing/agate/APKBUILD create mode 100644 testing/agate/agate.confd create mode 100644 testing/agate/agate.initd create mode 100644 testing/agate/agate.pre-install diff --git a/testing/agate/APKBUILD b/testing/agate/APKBUILD new file mode 100644 index 00000000000..e1e3b03af4f --- /dev/null +++ b/testing/agate/APKBUILD @@ -0,0 +1,43 @@ +# Maintainer: Cowington Post +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 +" diff --git a/testing/agate/agate.confd b/testing/agate/agate.confd new file mode 100644 index 00000000000..d2e8d4789b5 --- /dev/null +++ b/testing/agate/agate.confd @@ -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 diff --git a/testing/agate/agate.initd b/testing/agate/agate.initd new file mode 100644 index 00000000000..a26ed87f750 --- /dev/null +++ b/testing/agate/agate.initd @@ -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" +} diff --git a/testing/agate/agate.pre-install b/testing/agate/agate.pre-install new file mode 100644 index 00000000000..8bab2700851 --- /dev/null +++ b/testing/agate/agate.pre-install @@ -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