Received: from out.migadu.com (out.migadu.com [91.121.223.63]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id 9C61A781A67 for ; Fri, 10 Jan 2020 13:46:58 +0000 (UTC) Received: (Migadu outbound); Fri, 10 Jan 2020 13:39:26 +0000 Authentication-Results: out.migadu.com; auth=pass (plain) Received: from loki.galenabell.com ([24.181.218.135]) by out.migadu.com (Haraka/2.8.16) with ESMTPSA id 1CBC3E16-1AA3-4957-81F4-134D77413DAB.1 envelope-from (authenticated bits=0) (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 verify=FAIL); Fri, 10 Jan 2020 13:39:25 +0000 From: Galen Abell To: alpine-aports@lists.alpinelinux.org Cc: Galen Abell Subject: [PATCH v3] testing/prosody-filer: new aport Date: Fri, 10 Jan 2020 08:39:19 -0500 Message-Id: <20200110133919.4927-1-galen@galenabell.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191207113547.3258-1-galen@galenabell.com> References: <20191207113547.3258-1-galen@galenabell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1;a=rsa-sha256;bh=jJnvYeXvuW7pr62qYneHqsfkzAjfphfkGL2Me4Q+wSs=;c=relaxed/simple;d=galenabell.com;h=from:subject:date:to;s=default;b=qxqrDjW+yUl1AtVDIqLVQ3aWx0ySX4khRAE2DnxEijef5IQrdVFb+6+sr1nqWz/vB0vEA44akqcCYBcWzXJ9gFdSMkZtuHPkB8ZdzvMvuoEuiMyUuPfLGx3Exe81/rHGBqLkuu8TZeSy2jwMWcQ7yei/iHdezGV0n0PPXCv+A2s= https://github.com/ThomasLeister/prosody-filer Golang mod_http_upload_external server for Prosody and Ejabberd testing/ --- v3 upgrades to 1.0.1 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..a0f9570536 --- /dev/null +++ b/testing/prosody-filer/APKBUILD @@ -0,0 +1,48 @@ +# Contributor: Galen Abell +# Maintainer: Galen Abell +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 -- 2.24.1