app-emulation/reg: Add init scripts for webUI
authorManuel Rüger <mrueg@gentoo.org>
Wed, 18 Jul 2018 11:23:17 +0000 (13:23 +0200)
committerManuel Rüger <mrueg@gentoo.org>
Wed, 18 Jul 2018 11:23:17 +0000 (13:23 +0200)
Package-Manager: Portage-2.3.43, Repoman-2.3.10

app-emulation/reg/files/reg.confd [new file with mode: 0644]
app-emulation/reg/files/reg.initd [new file with mode: 0644]
app-emulation/reg/reg-0.15.4-r1.ebuild [new file with mode: 0644]

diff --git a/app-emulation/reg/files/reg.confd b/app-emulation/reg/files/reg.confd
new file mode 100644 (file)
index 0000000..1bd2475
--- /dev/null
@@ -0,0 +1,2 @@
+# arguments for reg server
+command_args="--asset-path=/var/lib/reg"
diff --git a/app-emulation/reg/files/reg.initd b/app-emulation/reg/files/reg.initd
new file mode 100644 (file)
index 0000000..7759f44
--- /dev/null
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 2016-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Reg server - providing a UI for Docker Registry"
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+user=${user:-${RC_SVCNAME}}
+group=${group:-${RC_SVCNAME}}
+
+command="/usr/bin/reg server"
+command_args="${command_args:---asset-path=/var/lib/reg}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+       --stdout /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log \
+       --stderr /var/log/${RC_SVCNAME}/${RC_SVCNAME}.log"
+
+depend() {
+       after net
+}
diff --git a/app-emulation/reg/reg-0.15.4-r1.ebuild b/app-emulation/reg/reg-0.15.4-r1.ebuild
new file mode 100644 (file)
index 0000000..fe202f0
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit golang-build golang-vcs-snapshot user
+
+EGO_PN="github.com/genuinetools/reg"
+GIT_COMMIT="8c930c585418564a4ce472fbbfccb8c5741c2520"
+ARCHIVE_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+KEYWORDS="~amd64"
+
+DESCRIPTION="Docker registry v2 command line client"
+HOMEPAGE="https://github.com/genuinetools/reg"
+SRC_URI="${ARCHIVE_URI}"
+LICENSE="MIT"
+SLOT="0"
+IUSE=""
+
+RESTRICT="test"
+
+pkg_setup() {
+       enewgroup reg
+       enewuser reg -1 -1 /var/lib/reg reg
+}
+
+src_compile() {
+       pushd src/${EGO_PN} || die
+       GOPATH="${S}" go build -v -ldflags "-X ${EGO_PN}/version.GITCOMMIT=${GIT_COMMIT} -X ${EGO_PN}/version.VERSION=${PV}" -o "${S}"/bin/reg . || die
+       popd || die
+}
+
+src_install() {
+       dobin bin/*
+       dodoc src/${EGO_PN}/README.md
+       insinto /var/lib/${PN}
+       doins -r src/${EGO_PN}/server/*
+       newinitd "${FILESDIR}"/reg.initd reg
+       newconfd "${FILESDIR}"/reg.confd reg
+
+       keepdir /var/log/reg
+       fowners -R reg:reg /var/log/reg /var/lib/reg/static
+}