pacotes.eletrotupi.com

commit d471662a02ece1f9d0283e126f9a1481a5c443f1

Author: Pedro Lucas Porcellis <porcellis@eletrotupi.com>

smithy: new package

 pkgs/smithy/APKBUILD | 34 ++++++++++++++++++++++++++++++++++
 pkgs/smithy/smithy.confd | 2 ++
 pkgs/smithy/smithy.initd | 18 ++++++++++++++++++
 pkgs/smithy/smithy.pre-install | 3 +++


diff --git a/pkgs/smithy/APKBUILD b/pkgs/smithy/APKBUILD
new file mode 100644
index 0000000000000000000000000000000000000000..1e2488f81a04dd3995d61783d0d1c70d404dc7fe
--- /dev/null
+++ b/pkgs/smithy/APKBUILD
@@ -0,0 +1,34 @@
+# Maintainer: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
+pkgname=smithy
+pkgver=0.2.1
+pkgrel=1
+pkgdesc="A tiny git forge written in Go"
+url="https://github.com/honza/smithy"
+arch="all"
+license="GPLv3"
+subpackages="$pkgname-openrc"
+makedepends="git go"
+install="$pkgname.pre-install"
+options="!check" # no test suite
+source="
+	$pkgname-$pkgver.tar.gz::https://github.com/honza/smithy/archive/v$pkgver.tar.gz
+	$pkgname.initd
+	$pkgname.confd
+"
+pkggroups="smithy"
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+	make smithy
+	make smithy.yml
+}
+
+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
+}
+sha512sums="89c4242ea3bbdbcd8ee9f035bbb0665d2197f11282cd2b8c963759edad5c7c703d772ea1f6f10283040a3b7dd8495aa78b862b7e8409dd1f7d5dfa0eec09ef68  smithy-0.2.1.tar.gz
+a7c415023ad45be5c7badb50f97275f46b38a19399f229b3408875ebd5811293b4efec5766716fa8dc0447be0995a3f6964b1b851c6d71960a3ab3e3d0b2f588  smithy.initd
+f78e8fd5e8de95313df23ee2b292dabd7645d9bfbbbce5fcecdd3961bd8cf5e06c3a6e7294a04061b3c46ece29465a911fb313810e55acaf5fa67adda04020e3  smithy.confd"




diff --git a/pkgs/smithy/smithy.confd b/pkgs/smithy/smithy.confd
new file mode 100644
index 0000000000000000000000000000000000000000..aa0800c7deb1f4e1d279efb09af8b48e87dcddc6
--- /dev/null
+++ b/pkgs/smithy/smithy.confd
@@ -0,0 +1,2 @@
+smithy_opts="--config /etc/smithy.yml"
+smithy_log_file="/var/log/smithy.log"




diff --git a/pkgs/smithy/smithy.initd b/pkgs/smithy/smithy.initd
new file mode 100644
index 0000000000000000000000000000000000000000..5b0547ec9ce30d1e1a9d2aa52992a777afa8bc73
--- /dev/null
+++ b/pkgs/smithy/smithy.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+name="smithy"
+description="smithy forge service"
+supervisor=supervise-daemon
+command="/usr/bin/$name"
+command_args="$smithy_opts"
+command_user="smithy:smithy"
+pidfile="/run/$name.pid"
+start_stop_daemon_args="--stdout $smithy_log_file --stderr $smithy_log_file"
+
+depend() {
+	need net
+	after firewall
+}
+
+start_pre() {
+	checkpath -f -m 0644 -o ${SVCNAME}:${SVCNAME} "$smithy_log_file"
+}




diff --git a/pkgs/smithy/smithy.pre-install b/pkgs/smithy/smithy.pre-install
new file mode 100644
index 0000000000000000000000000000000000000000..923546e8163714deaba773533a01d92226d75fd3
--- /dev/null
+++ b/pkgs/smithy/smithy.pre-install
@@ -0,0 +1,3 @@
+#!/bin/sh
+addgroup -S smithy || true
+adduser -HSD -h / -s /sbin/nologin -G smithy -g smithy smithy || true