From 3c4b3a32ce6b35f087ae7cb6195b6f6c7e564ea2 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 14 Jul 2022 14:12:26 +0200 Subject: [PATCH] searchhut: new aport --- sr.ht/searchhut/APKBUILD | 58 +++++++++++++++++++++++++++ sr.ht/searchhut/searchhut.pre-install | 6 +++ sr.ht/searchhut/sh-api.confd | 4 ++ sr.ht/searchhut/sh-api.initd | 10 +++++ sr.ht/searchhut/sh-web.confd | 4 ++ sr.ht/searchhut/sh-web.initd | 11 +++++ 6 files changed, 93 insertions(+) create mode 100644 sr.ht/searchhut/APKBUILD create mode 100644 sr.ht/searchhut/searchhut.pre-install create mode 100644 sr.ht/searchhut/sh-api.confd create mode 100644 sr.ht/searchhut/sh-api.initd create mode 100644 sr.ht/searchhut/sh-web.confd create mode 100644 sr.ht/searchhut/sh-web.initd diff --git a/sr.ht/searchhut/APKBUILD b/sr.ht/searchhut/APKBUILD new file mode 100644 index 0000000..56b1dfd --- /dev/null +++ b/sr.ht/searchhut/APKBUILD @@ -0,0 +1,58 @@ +# Maintainer: Drew DeVault +pkgname=searchhut +pkgver=0_git20220714 +_commit=c2c75b565a615031fb5c41c3d259c87313bfc763 +pkgrel=0 +pkgdesc="Search engine" +url="https://searchhut.org" +license="AGPL-3.0" +arch="all" +pkgusers="$pkgname" +pkggroups="$pkgname" +install="$pkgname.pre-install" +makedepends="go" +subpackages="$pkgname-openrc" +source="$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/searchhut/archive/$_commit.tar.gz + sh-api.initd + sh-api.confd + sh-web.initd + sh-web.confd + " +builddir="$srcdir/$pkgname-$_commit" +options="!check" # no upstream tests + +export GOPATH="$srcdir" +export GOFLAGS="$GOFLAGS -trimpath -modcacherw" + +build() { + make +} + +package() { + mkdir -p "$pkgdir"/usr/bin + for bin in sh-admin sh-api sh-index sh-search sh-web + do + cp $bin "$pkgdir"/usr/bin/ + done + + install -Dm755 "$srcdir"/sh-api.initd "$pkgdir"/etc/init.d/sh-api + install -Dm644 "$srcdir"/sh-api.confd "$pkgdir"/etc/conf.d/sh-api + install -Dm755 "$srcdir"/sh-web.initd "$pkgdir"/etc/init.d/sh-web + install -Dm644 "$srcdir"/sh-web.confd "$pkgdir"/etc/conf.d/sh-web + + mkdir -p "$pkgdir"/etc/searchhut + install -Dm644 config.example.ini "$pkgdir"/etc/searchhut/config.ini + + mkdir -p "$pkgdir"/usr/share/searchhut/templates + mkdir -p "$pkgdir"/usr/share/searchhut/static + install -Dm644 templates/* "$pkgdir"/usr/share/searchhut/templates + install -Dm644 static/* "$pkgdir"/usr/share/searchhut/static +} + +sha512sums=" +e6c94455ebd779dd5df5604a498451df91e277353372ffeb7ec0cc4bd367f2c674c453f9711b5d9fb731c95b5b10a01a9cff2487088e1d1aa55b0d086c4021ed searchhut-0_git20220714.tar.gz +682a3eccdc59603392bb29ecdfaef07353dcf03d73be4e4a34f4658fada4849163abac2049d9fc988710e47c03b95db4806c7c6f8e4946c177d998f1a838f11d sh-api.initd +37704c27c178c1e1f7d7475769ec62c5a76cf3acd8e2ab5d981b665d77c21b6135ea73f27b2b79a158fbff814bcdadbc11f31f09c9212064967c712b3bc7907c sh-api.confd +fc7998ef7de051b4288387b5a172293a0fb6402dc6f6facdfa02f8aa628d4d307e0d2e94f40dfbd4a6bab066961d1af6a8c88bb61fe7b589748a6be0a7b0ef37 sh-web.initd +798824b3100e41de019ccd86f565094826b7a33369f97b07ce33da323817f95b401e07fc73c3d9e3302955a1284b086d18e5355182294f07d301dbbc30ffd278 sh-web.confd +" diff --git a/sr.ht/searchhut/searchhut.pre-install b/sr.ht/searchhut/searchhut.pre-install new file mode 100644 index 0000000..1b4e204 --- /dev/null +++ b/sr.ht/searchhut/searchhut.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh +user=searchhut +group=searchhut + +addgroup -S $group 2>/dev/null || true +adduser -S -D -h /var/lib/$user -s /sbin/nologin -G $group -g $user $user 2>/dev/null || true diff --git a/sr.ht/searchhut/sh-api.confd b/sr.ht/searchhut/sh-api.confd new file mode 100644 index 0000000..42d409f --- /dev/null +++ b/sr.ht/searchhut/sh-api.confd @@ -0,0 +1,4 @@ +# Configuration for /etc/init.d/sh-api + +# log destination +error_log=/var/log/sh-api.log diff --git a/sr.ht/searchhut/sh-api.initd b/sr.ht/searchhut/sh-api.initd new file mode 100644 index 0000000..ceea8b1 --- /dev/null +++ b/sr.ht/searchhut/sh-api.initd @@ -0,0 +1,10 @@ +#!/sbin/openrc-run +name="sh-api" +description="Search engine API" +supervisor=supervise-daemon +command=/usr/bin/sh-api +command_user=searchhut:searchhut + +start_pre() { + [ -n "$error_log" ] && checkpath -f -o $command_user "$error_log" +} diff --git a/sr.ht/searchhut/sh-web.confd b/sr.ht/searchhut/sh-web.confd new file mode 100644 index 0000000..a7e1fe8 --- /dev/null +++ b/sr.ht/searchhut/sh-web.confd @@ -0,0 +1,4 @@ +# Configuration for /etc/init.d/sh-web + +# log destination +error_log=/var/log/sh-web.log diff --git a/sr.ht/searchhut/sh-web.initd b/sr.ht/searchhut/sh-web.initd new file mode 100644 index 0000000..be77cf9 --- /dev/null +++ b/sr.ht/searchhut/sh-web.initd @@ -0,0 +1,11 @@ +#!/sbin/openrc-run +name="sh-web" +description="Search engine web frontend" +supervisor=supervise-daemon +command=/usr/bin/sh-web +command_user=searchhut:searchhut +directory="/usr/share/searchhut" + +start_pre() { + [ -n "$error_log" ] && checkpath -f -o $command_user "$error_log" +} -- 2.45.2