Received: from out.migadu.com (out.migadu.com [91.121.223.63]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 327D4781B61 for ; Fri, 6 Dec 2019 22:18:20 +0000 (UTC) Received: (Migadu outbound); Fri, 06 Dec 2019 22:10:48 +0000 Authentication-Results: out.migadu.com; auth=pass (plain) Received: from loki.fritz.box (pD9FD6660.dip0.t-ipconnect.de [217.253.102.96]) by out.migadu.com (Haraka/2.8.16) with ESMTPSA id A463293B-9D3C-4501-81ED-F73EC17071B9.1 envelope-from (authenticated bits=0) (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 verify=FAIL); Fri, 06 Dec 2019 22:10:48 +0000 From: Galen Abell To: alpine-aports@lists.alpinelinux.org Cc: Galen Abell Subject: [PATCH] testing/prosody-filer: new aport Date: Fri, 6 Dec 2019 23:10:46 +0100 Message-Id: <20191206221046.8094-1-galen@galenabell.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1;a=rsa-sha256;bh=9s2mLgI1k+1cxGaOnEQDhHjdrQsxYVxEqUNIr5pKR34=;c=relaxed/simple;d=galenabell.com;h=from:subject:date:to;s=default;b=XvZPuoNPni1p7y5wu868ohX9yV1FbZwQlHyvz5nvzo/DNzosBCwl+hUiGa3fLtoTRAg3pdgWz2Vpdhofn8ztHWn1LDOMIzgPKpMn8xwb9Z3KkzWp6hKuk50ToztYki9XCWQ1QEM95uiQuctnhVp2yvFPfUcn3tmdM0EjyWdMXnk= https://github.com/ThomasLeister/prosody-filer Golang mod_http_upload_external server for Prosody and Ejabberd testing/ --- testing/prosody-filer/APKBUILD | 31 +++++++++++++++++++ testing/prosody-filer/prosody-filer.confd | 19 ++++++++++++ testing/prosody-filer/prosody-filer.initd | 19 ++++++++++++ .../prosody-filer/prosody-filer.pre-install | 11 +++++++ 4 files changed, 80 insertions(+) create mode 100644 testing/prosody-filer/APKBUILD create mode 100644 testing/prosody-filer/prosody-filer.confd create mode 100644 testing/prosody-filer/prosody-filer.initd create mode 100644 testing/prosody-filer/prosody-filer.pre-install diff --git a/testing/prosody-filer/APKBUILD b/testing/prosody-filer/APKBUILD new file mode 100644 index 0000000000..78b36ed4d1 --- /dev/null +++ b/testing/prosody-filer/APKBUILD @@ -0,0 +1,31 @@ +# Contributor: Galen Abell +# Maintainer: Galen Abell +pkgname="prosody-filer" +pkgver="1.0.0" +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 +" + +build() { + go build -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 +} +sha512sums="2e05af781c2876ad61db0822290459de234fcbaa33885f573c5059c8493361ffa35c5291df9dd363cfad6bffafa98966ec53b49d7db70b75e19a7828742a9d75 prosody-filer-1.0.0.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 -- 2.24.0