aboutsummaryrefslogtreecommitdiffstats
path: root/testing/prosody-filer
diff options
context:
space:
mode:
authorGalen Abell <galen@galenabell.com>2020-01-10 08:39:19 -0500
committerKevin Daudt <kdaudt@alpinelinux.org>2020-02-02 18:17:24 +0000
commitd31b35f825ab6a5c3e78ec175691c38d32c3c8fa (patch)
tree07c7b31c996a3a965b3526fac4069d555e2479fa /testing/prosody-filer
parent772d23fc5fc883c9fb91f40bb315e4d9835eff8b (diff)
downloadaports-d31b35f825ab6a5c3e78ec175691c38d32c3c8fa.tar.bz2
aports-d31b35f825ab6a5c3e78ec175691c38d32c3c8fa.tar.xz
testing/prosody-filer: new aport
https://github.com/ThomasLeister/prosody-filer Golang mod_http_upload_external server for Prosody and Ejabberd testing/
Diffstat (limited to 'testing/prosody-filer')
-rw-r--r--testing/prosody-filer/APKBUILD48
-rw-r--r--testing/prosody-filer/prosody-filer.confd19
-rw-r--r--testing/prosody-filer/prosody-filer.initd19
-rw-r--r--testing/prosody-filer/prosody-filer.pre-install11
4 files changed, 97 insertions, 0 deletions
diff --git a/testing/prosody-filer/APKBUILD b/testing/prosody-filer/APKBUILD
new file mode 100644
index 0000000000..a0f9570536
--- /dev/null
+++ b/testing/prosody-filer/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor: Galen Abell <galen@galenabell.com>
+# Maintainer: Galen Abell <galen@galenabell.com>
+pkgname="prosody-filer"
+pkgver="1.0.1"
+pkgrel=0
+pkgdesc="Golang mod_http_upload_external server for Prosody and Ejabberd"
+url="https://github.com/ThomasLeister/prosody-filer"
+arch="all"
+license="MIT"
+makedepends="go"
+options="!check" # tests are broken
+install="$pkgname.pre-install"
+subpackages="$pkgname-openrc"
+source="
+ $pkgname-$pkgver.tar.gz::https://github.com/ThomasLeister/prosody-filer/archive/v$pkgver.tar.gz
+ $pkgname.initd
+ $pkgname.confd
+"
+builddir="$srcdir/src/github.com/ThomasLeister/$pkgname"
+
+prepare() {
+ mkdir -p ${builddir%/*}
+ mv $srcdir/$pkgname-$pkgver "$builddir"/
+
+ # fetch dependencies
+ GOPATH="$srcdir" go get github.com/BurntSushi/toml
+
+ default_prepare
+}
+
+build() {
+ GO111MODULE=off GOPATH="$srcdir" go build -v -o $pkgname main.go
+}
+
+package() {
+ install -Dm755 "$builddir"/$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
+}
+
+cleanup_srcdir() {
+ go clean -modcache
+ default_cleanup_srcdir
+}
+
+sha512sums="91231c1e42d9d79a3bfa57d74ee507e9cc803640c9ebeade0049be3d89cc150089ce616cc5d26b40530230db472895646f74a680be11c36dd9c255d8390948a6 prosody-filer-1.0.1.tar.gz
+1460dd00df99fe8dc04f42c65731c6b002ac5a2c5dcd73af598f2a3c6d8befa5ff1d910b5417477a3c79efc5065e609621eab6919f93c3bef34169264939929f prosody-filer.initd
+d2ca3f7801bbf6252b3ee739aff79460ec76dbc0798ea8995d0f2b684d85347685ae3b7f2cc4cf186ad1c889fd79bc267f57f9c6c120f491afe943bf725e4abd prosody-filer.confd"
diff --git a/testing/prosody-filer/prosody-filer.confd b/testing/prosody-filer/prosody-filer.confd
new file mode 100644
index 0000000000..1bc0331074
--- /dev/null
+++ b/testing/prosody-filer/prosody-filer.confd
@@ -0,0 +1,19 @@
+# conf.d file for prosody-filer
+
+#
+# Specify the path to the configuration file.
+#
+
+PROSODY_FILER_CONF="/etc/prosody-filer/config.toml"
+
+#
+# Specify the user the daemon should run under.
+#
+
+PROSODY_FILER_USER="prosody-filer"
+
+#
+# Specify the group the daemon should run under.
+#
+
+PROSODY_FILER_GROUP="prosody-filer"
diff --git a/testing/prosody-filer/prosody-filer.initd b/testing/prosody-filer/prosody-filer.initd
new file mode 100644
index 0000000000..5da0208f3b
--- /dev/null
+++ b/testing/prosody-filer/prosody-filer.initd
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+
+name=$RC_SVCNAME
+command="/usr/bin/prosody-filer"
+command_args="-config ${PROSODY_FILER_CONF}"
+command_user="${PROSODY_FILER_USER}:${PROSODY_FILER_GROUP}"
+pidfile="/run/$RC_SVCNAME.pid"
+command_background=yes
+
+depend() {
+ need net
+}
+
+start_pre() {
+ if [ ! -e "${PROSODY_FILER_CONF}" ]; then
+ eerror "You must create a config file to run prosody-filer"
+ return 1
+ fi
+}
diff --git a/testing/prosody-filer/prosody-filer.pre-install b/testing/prosody-filer/prosody-filer.pre-install
new file mode 100644
index 0000000000..4d969c56c5
--- /dev/null
+++ b/testing/prosody-filer/prosody-filer.pre-install
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+addgroup -S prosody-filer 2>/dev/null
+adduser -S -D \
+ -h /var/lib/prosody-filer \
+ -s /sbin/nologin \
+ -G prosody-filer \
+ -g "Prosody Filer Server" \
+ prosody-filer 2>/dev/null
+
+exit 0