~alpine/aports

testing/satellite: new aport v1 NEEDS REVISION

Pedro Lucas Porcellis <porcellis@eletrotupi.com>
Pedro Lucas Porcellis: 1
 testing/satellite: new aport

 4 files changed, 66 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/aports/patches/3474/mbox | git am -3
Learn more about email & git

[PATCH] testing/satellite: new aport Export this patch

Pedro Lucas Porcellis <porcellis@eletrotupi.com>
url: https://git.sr.ht/~gsthnz/satellite
pkgdesc: Satellite is a small Gemini server for serving static files
---
 testing/satellite/APKBUILD              | 41 +++++++++++++++++++++++++
 testing/satellite/satellite.confd       |  1 +
 testing/satellite/satellite.initd       | 17 ++++++++++
 testing/satellite/satellite.pre-install |  7 +++++
 4 files changed, 66 insertions(+)
 create mode 100644 testing/satellite/APKBUILD
 create mode 100644 testing/satellite/satellite.confd
 create mode 100644 testing/satellite/satellite.initd
 create mode 100644 testing/satellite/satellite.pre-install

diff --git a/testing/satellite/APKBUILD b/testing/satellite/APKBUILD
new file mode 100644
index 0000000000..e78f602503
--- /dev/null
+++ b/testing/satellite/APKBUILD
@@ -0,0 +1,41 @@
# Maintainer: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
pkgname=satellite
pkgver=1.0.0
pkgrel=1
pkgdesc="Satellite is a small Gemini server for serving static files"
url="https://git.sr.ht/~gsthnz/satellite"
arch="all"
license="AGPLv3"
subpackages="$pkgname-openrc"
makedepends="go scdoc"
install="$pkgname.pre-install"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~gsthnz/$pkgname/archive/v$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
"
pkggroups="satellite"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	make
}

check() {
	go test ./...
}

package() {
	install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname

	install -Dm640 -o root -g satellite "$builddir"/$pkgname.toml \
		"$pkgdir"/etc/$pkgname.toml

	install -Dm644 doc/satellite.1 "$builddir"/usr/share/man/man1/satellite.1
	install -Dm644 doc/satellite.toml.5 "$builddir"/usr/share/man/man5/satellite.toml.5
}
sha512sums="2b14e6bd7a1b33a0b4cf402e64585f9f87d2491709bd2f383ec0777b24a372fa7360ca7da96d21e61790095554c8029b07cdddc7a23688465ee77f7854beea48  satellite-1.0.0.tar.gz
dcf84f7f09651426189280df73ce683b5a88bc40764e1ae5e0993fe2d9a796e36437c5f064fae120d749f8fd0151ef11296210556408a04441fc01e571f8f6cb  satellite.initd
f20f287640743ede9139a12fb7cbbcc9f2f51bc179322e04253e236daf55090aa043e9e01ec7f29cadc965cdb73bbaa86080072840913c88503138df8a04e443  satellite.confd"
diff --git a/testing/satellite/satellite.confd b/testing/satellite/satellite.confd
new file mode 100644
index 0000000000..4a0e714c53
--- /dev/null
+++ b/testing/satellite/satellite.confd
@@ -0,0 +1 @@
satellite_log_file="/var/log/satellite.log"
diff --git a/testing/satellite/satellite.initd b/testing/satellite/satellite.initd
new file mode 100644
index 0000000000..431408940a
--- /dev/null
+++ b/testing/satellite/satellite.initd
@@ -0,0 +1,17 @@
#!/sbin/openrc-run
name="satellite"
description="satellite gemini service"
supervisor=supervise-daemon
command="/usr/bin/$name"
command_user="satellite:satellite"
pidfile="/run/$name.pid"
start_stop_daemon_args="--stdout $satellite_log_file --stderr $satellite_log_file"

depend() {
	need net
	after firewall
}

start_pre() {
	checkpath -f -m 0644 -o ${SVCNAME}:${SVCNAME} "$satellite_log_file"
}
diff --git a/testing/satellite/satellite.pre-install b/testing/satellite/satellite.pre-install
new file mode 100644
index 0000000000..1fd6912d5a
--- /dev/null
+++ b/testing/satellite/satellite.pre-install
@@ -0,0 +1,7 @@
#!/bin/sh

addgroup -S satellite 2>/dev/null
adduser -S -D -H -h /var/empty -s /sbin/nologin -G satellite -g satellite satellite 2>/dev/null

exit 0

-- 
2.30.2