~dricottone/huttese-apk

5e79884b224753bf65577dcb9ad6c040cab11a1e — Drew DeVault 3 years ago e1c3b4a
pages.sr.ht: new package
A sr.ht/pages.sr.ht/APKBUILD => sr.ht/pages.sr.ht/APKBUILD +34 -0
@@ 0,0 1,34 @@
# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=pages.sr.ht
pkgver=0.1.1
pkgrel=0
pkgdesc="sr.ht web hosting service"
url="https://git.sr.ht/~sircmpwn/pages.sr.ht"
arch="all"
license="AGPLv3"
makedepends="go"
subpackages="$pkgname-openrc"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/$pkgname/archive/$pkgver.tar.gz
	pages.sr.ht.initd
	pages.sr.ht.confd
"
export PKGVER=$pkgver
options="$options !check"
install="$pkgname.post-install"

build() {
	go build -o pages.sr.ht
}

package() {
	install -Dm755 pages.sr.ht "$pkgdir"/usr/bin/pages.sr.ht
	install -Dm755 "$srcdir"/pages.sr.ht.initd \
		"$pkgdir"/etc/init.d/pages.sr.ht
	install -Dm644 "$srcdir"/pages.sr.ht.confd \
		"$pkgdir"/etc/conf.d/pages.sr.ht
}

sha512sums="196e9a8033e5bb51f0b5b20435079310f1ba18a2d7b4299221c2d715eaee401a96031a5f94c6160016b3f58e374e69029405e23618c863e2c0b873cadd7cb60f  pages.sr.ht-0.1.1.tar.gz
8f9b081409ac62996efea682da585a07fdc9390f6dc94cc567d80499a151793f46c7772cd8949eb5f7de30b4edda3a8e1f5e32bd9d64b29b972b92c37d397096  pages.sr.ht.initd
fe18b2df0f90104f2978b037992214746352ff97f680bc32b2c2c5dc5e0b63ad61b94f221d33fbb28a5fb6a76f3280436bfd6df0beb1792f98cec2406a878050  pages.sr.ht.confd"

A sr.ht/pages.sr.ht/pages.sr.ht.confd => sr.ht/pages.sr.ht/pages.sr.ht.confd +5 -0
@@ 0,0 1,5 @@
# Run the daemon as this user:
# PAGES_USER=pages

# Bind the API service to this address:
# PAGES_BIND=:5112

A sr.ht/pages.sr.ht/pages.sr.ht.initd => sr.ht/pages.sr.ht/pages.sr.ht.initd +23 -0
@@ 0,0 1,23 @@
#!/sbin/openrc-run
name="pages.sr.ht"
description="pages.sr.ht API service"
supervisor=supervise-daemon
PAGES_USER=${PAGES_USER:-pages}
PAGES_BIND=${PAGES_BIND:-:5112}
LOGS=/var/log/pages.sr.ht.log
supervise_daemon_args="-1 $LOGS -2 $LOGS"
command="/usr/bin/pages.sr.ht"
command_args="-b $PAGES_BIND"
command_user="$PAGES_USER:$PAGES_USER"
pidfile="/run/${RC_SVCNAME}.pid"

depend() {
	need net
	use redis
	use postgresql
	use pgbouncer
}

start_pre() {
	checkpath -f "$LOGS" -m 644 -o "$PAGES_USER:$PAGES_USER"
}

A sr.ht/pages.sr.ht/pages.sr.ht.post-install => sr.ht/pages.sr.ht/pages.sr.ht.post-install +3 -0
@@ 0,0 1,3 @@
#!/bin/sh
addgroup -S pages || true
adduser -SD -h /var/empty -s /bin/sh -G pages -g pages pages || true