aboutsummaryrefslogtreecommitdiffstats
path: root/testing/minio
diff options
context:
space:
mode:
authorChloe Kudryavtsev <toast@toastin.space>2019-03-11 22:26:12 -0400
committerCarlo Landmeter <clandmeter@alpinelinux.org>2019-03-12 02:50:35 +0000
commite7b257acce5eb15e013ebfefd57961aa1ef6d8cf (patch)
tree9dab34fdffde1f335988e72d494c8f6b8a5a991b /testing/minio
parent28518f8c22d6c34d718dcde9355d9bbf841b7fb2 (diff)
downloadaports-e7b257acce5eb15e013ebfefd57961aa1ef6d8cf.tar.bz2
aports-e7b257acce5eb15e013ebfefd57961aa1ef6d8cf.tar.xz
testing/minio: Add openrc, fixup style
Also take ownership.
Diffstat (limited to 'testing/minio')
-rw-r--r--testing/minio/APKBUILD43
-rw-r--r--testing/minio/minio.confd13
-rw-r--r--testing/minio/minio.initd18
-rw-r--r--testing/minio/minio.pre-install6
4 files changed, 69 insertions, 11 deletions
diff --git a/testing/minio/APKBUILD b/testing/minio/APKBUILD
index ed90ecaa3a..6259fdcbbe 100644
--- a/testing/minio/APKBUILD
+++ b/testing/minio/APKBUILD
@@ -1,37 +1,58 @@
# Contributor: Carlo Landmeter <clandmeter@alpinelinux.org>
-# Maintainer:
+# Maintainer: Chloe Kudryavtsev <toast@toastin.space>
pkgname=minio
_pkgver="RELEASE.2019-03-06T22-47-10Z"
pkgver=${_pkgver#*.}
pkgver=${pkgver%T*}
pkgver=0.${pkgver//-}
-pkgrel=0
+pkgrel=1
pkgdesc="An open source object storage server compatible with Amazon S3"
+pkgusers="minio"
+pkggroups="minio"
url="https://minio.io/"
arch="all"
license="Apache-2.0"
+install="minio.pre-install"
makedepends="go"
-source="https://github.com/minio/minio/archive/$_pkgver.tar.gz"
+source="
+ minio.initd
+ minio.confd
+ https://github.com/minio/minio/archive/$_pkgver.tar.gz
+ "
builddir="$srcdir/src/github.com/minio/$pkgname"
+options="!check" # pkg/disk fails with "disk_test.go:42: Unexpected FSType UNKNOWN"
+subpackages="$pkgname-openrc"
+
+export GOPATH="$srcdir"
+export CGO_ENABLED=0
prepare() {
- mkdir -p ${builddir%/*}
- mv "$srcdir"/$pkgname-$_pkgver "$builddir"/
- cd "$builddir"
- default_prepare
+ mkdir -p ${builddir%/*}
+ mv "$srcdir"/$pkgname-$_pkgver "$builddir"/
+ cd "$builddir"
+ default_prepare
}
build() {
- cd "$builddir"
- export GOPATH="$srcdir"
- export CGO_ENABLED=0
+ cd "$builddir"
local _ldflags=$(go run buildscripts/gen-ldflags.go 2> /dev/null)
go build -tags kqueue --ldflags "$_ldflags" -o bin/minio
}
+check() {
+ cd "$builddir"
+ go test -tags kqueue ./...
+}
+
package() {
install -Dm755 "$builddir"/bin/minio \
"$pkgdir"/usr/bin/minio
+ install -Dm755 "$srcdir"/"$pkgname".initd \
+ "$pkgdir"/etc/init.d/"$pkgname"
+ install -Dm644 "$srcdir"/"$pkgname".confd \
+ "$pkgdir"/etc/conf.d/"$pkgname"
}
-sha512sums="09c1ec200320f0843fd41711a2fe1596af906c84d82dfa080a15fa8e98713601adbc21b91d4c82d436f128cc00fe75575f88ddefc25e1ce5ed72bd2d65dfce12 RELEASE.2019-03-06T22-47-10Z.tar.gz"
+sha512sums="18e55dc143c0d71afa8ba758de2efde40946704de65d7a53bfb5f2162fedc736a3f596d0fa75e514cb615e3bbf65809a60bd4b1c2fa22be39d18613d7ab42395 minio.initd
+ed9790fbadfb38e4d660eb1befd87e803d70dec04d936e8cd26def4a9c21240bb7cae8750ae3395aa4761e6738b9e346c86ba57761cfde30efe46d2cb459a7e4 minio.confd
+09c1ec200320f0843fd41711a2fe1596af906c84d82dfa080a15fa8e98713601adbc21b91d4c82d436f128cc00fe75575f88ddefc25e1ce5ed72bd2d65dfce12 RELEASE.2019-03-06T22-47-10Z.tar.gz"
diff --git a/testing/minio/minio.confd b/testing/minio/minio.confd
new file mode 100644
index 0000000000..952ce13564
--- /dev/null
+++ b/testing/minio/minio.confd
@@ -0,0 +1,13 @@
+# defaults to storing data in /srv/minio
+# but you can run multiple instances, e.g minio.home in /srv/minio.home
+MINIO_VOLUMES="/srv/${RC_SVCNAME}"
+
+#export MINIO_ACCESS_KEY=myUser
+#export MINIO_SECRET_KEY=mySecretKey
+
+# recommended for production setups
+#MINIO_OPTS='--quiet --anonymous'
+
+# optional additional settings
+#address=minio.example.com:9000
+#export MINIO_DOMAIN=minio.example.com
diff --git a/testing/minio/minio.initd b/testing/minio/minio.initd
new file mode 100644
index 0000000000..ec6b18825f
--- /dev/null
+++ b/testing/minio/minio.initd
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+
+name='Minio Block Storage Server'
+command=/usr/bin/minio
+command_args="server \
+ ${address:+--address=$address} \
+ $MINIO_OPTS \
+ $MINIO_VOLUMES"
+command_background=true
+command_user="minio:minio"
+pidfile="/run/${RC_SVCNAME}.pid"
+
+start_pre() {
+ # the conf.d file might contain secrets!
+ [ -f "/etc/conf.d/${RC_SVCNAME}" ] && checkpath --file --mode 0600 --owner root:root "/etc/conf.d/${RC_SVCNAME}"
+ # make sure the default volume exists
+ checkpath --directory --mode 0700 --owner minio:minio "/srv/${RC_SVCNAME}"
+}
diff --git a/testing/minio/minio.pre-install b/testing/minio/minio.pre-install
new file mode 100644
index 0000000000..3015873c0f
--- /dev/null
+++ b/testing/minio/minio.pre-install
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S minio 2>/dev/null
+adduser -S -D -h /var/lib/minio -s /sbin/nologin -G minio -g minio minio 2>/dev/null
+
+exit 0