Received: from out.migadu.com (out.migadu.com [91.121.223.63]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 29345781D6E for ; Sat, 7 Dec 2019 11:37:03 +0000 (UTC) Received: (Migadu outbound); Sat, 07 Dec 2019 11:35:54 +0000 Authentication-Results: out.migadu.com; auth=pass (plain) Received: from loki.galenabell.com (24-181-218-135.dhcp.hckr.nc.charter.com [24.181.218.135]) by out.migadu.com (Haraka/2.8.16) with ESMTPSA id 07A77AA0-85AA-4E28-A321-568CF992E44F.1 envelope-from (authenticated bits=0) (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 verify=FAIL); Sat, 07 Dec 2019 11:35:53 +0000 From: Galen Abell To: alpine-aports@lists.alpinelinux.org Cc: Galen Abell Subject: [PATCH v2] testing/prosody-filer: new aport Date: Sat, 7 Dec 2019 12:35:47 +0100 Message-Id: <20191207113547.3258-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=6G6+PyE5gCkXeDb+/Ts6b143/IjspZpgtCNd8QHTe+k=;c=relaxed/simple;d=galenabell.com;h=from:subject:date:to;s=default;b=c7OkiFdNtKvmsjhD98P8F6Wk3UpPj1wBJS238fu7uCBbQ3Wh5UeRN1J+NBrkpRzeB0ocOW9vl/va4sH9zrra5kxna4ogDUZGhbT/EzPDm/yWvPCSuAT3vMys5X4/dyACbV2T2rpLVQxcrh6wJEGK4V9QLVpQNMcSKhw9Smqp9VQ= https://github.com/ThomasLeister/prosody-filer Golang mod_http_upload_external server for Prosody and Ejabberd testing/ --- v2 fixes building on systems without GOPATH already set up testing/prosody-filer/APKBUILD | 48 +++++++++++++++++++ testing/prosody-filer/prosody-filer.confd | 19 ++++++++ testing/prosody-filer/prosody-filer.initd | 19 ++++++++ .../prosody-filer/prosody-filer.pre-install | 11 +++++ 4 files changed, 97 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..f027e350fd --- /dev/null +++ b/testing/prosody-filer/APKBUILD @@ -0,0 +1,48 @@ +# 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 +" +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="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