summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <william.hubbs@sony.com>2019-08-23 16:50:58 -0500
committerWilliam Hubbs <williamh@gentoo.org>2019-08-23 16:50:58 -0500
commit2f1d2e7700a596a1436fb987d6e9f3830c488d11 (patch)
tree9383e67e62e8c1bfe93fcd34d6399a4efe0a8be2 /app-misc/spire
parentacct-user/spire: add the spire user (diff)
downloadgentoo-2f1d2e7700a596a1436fb987d6e9f3830c488d11.tar.gz
gentoo-2f1d2e7700a596a1436fb987d6e9f3830c488d11.tar.bz2
gentoo-2f1d2e7700a596a1436fb987d6e9f3830c488d11.zip
app-misc/spire: new package, the spiffe runtime environment
Copyright: Sony Interactive Entertainment Inc. Package-Manager: Portage-2.3.69, Repoman-2.3.16 Signed-off-by: William Hubbs <williamh@gentoo.org>
Diffstat (limited to 'app-misc/spire')
-rw-r--r--app-misc/spire/Manifest2
-rw-r--r--app-misc/spire/files/spire-agent.confd6
-rw-r--r--app-misc/spire/files/spire-agent.initd12
-rw-r--r--app-misc/spire/files/spire-server.confd6
-rw-r--r--app-misc/spire/files/spire-server.initd12
-rw-r--r--app-misc/spire/metadata.xml8
-rw-r--r--app-misc/spire/spire-0.8.1.ebuild61
7 files changed, 107 insertions, 0 deletions
diff --git a/app-misc/spire/Manifest b/app-misc/spire/Manifest
new file mode 100644
index 000000000000..abc65fce4f9a
--- /dev/null
+++ b/app-misc/spire/Manifest
@@ -0,0 +1,2 @@
+DIST spire-0.8.1-vendor.tar.gz 10550551 BLAKE2B 4ab04c0e4de231097620a015f523ed9d7e0d6872425826e4bc3572f920a4d3de5174cb78f4ed61340ffc1abe3e25d42e8735228b142b424c85ef24fac52740ca SHA512 879cba4eaa681814858fa7965b28d0217d4ae806c979d348cb6d5f413dca7f03f99c34b8dcdbc0dad8e5253990a473962b9c1438ba79bef5fe757df11c7f4ee7
+DIST spire-0.8.1.tar.gz 1070262 BLAKE2B 7e30ac233759f2fed7476a82d072c4ec7815346cb50419b10ac7c5ce566aae6e783a51284a39847d63c04b0e398aab7ad15d94ea4e05569b43e762abfadaf550 SHA512 aa864f3f1d0faa8b7bfa527effde244957f9b30c6f115e49819777b6f3a5ea751ed751ac19b94a45d02aa22e719e6bd6e33355f9b561bbc5458d5997d95a1437
diff --git a/app-misc/spire/files/spire-agent.confd b/app-misc/spire/files/spire-agent.confd
new file mode 100644
index 000000000000..c88234b0a32e
--- /dev/null
+++ b/app-misc/spire/files/spire-agent.confd
@@ -0,0 +1,6 @@
+# log file for the spire agent.
+# The default is /var/log/spire/spire-agent.log
+#logfile=""
+#
+# Extra arguments to pass when starting the spire agent.
+#spire_agent_args=""
diff --git a/app-misc/spire/files/spire-agent.initd b/app-misc/spire/files/spire-agent.initd
new file mode 100644
index 000000000000..bd64143f3e83
--- /dev/null
+++ b/app-misc/spire/files/spire-agent.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 2019 Sony Interactive Entertainment LLC
+# Distributed under the terms of the GNU General Public License v2
+
+name="spire agent daemon"
+description="spire agent"
+logfile="${logfile:-/var/log/spire/spire-agent.log}"
+command=/opt/spire/spire-agent
+command_args="run --logFile ${logfile} ${spire_agent_args}"
+command_user=spire
+directory=/opt/spire
+supervisor=supervise-daemon
diff --git a/app-misc/spire/files/spire-server.confd b/app-misc/spire/files/spire-server.confd
new file mode 100644
index 000000000000..835686132479
--- /dev/null
+++ b/app-misc/spire/files/spire-server.confd
@@ -0,0 +1,6 @@
+# log file for the spire server.
+# The default is /var/log/spire/spire-server.log
+#logfile=""
+#
+# Extra arguments to pass when starting the spire server.
+#spire_server_args=""
diff --git a/app-misc/spire/files/spire-server.initd b/app-misc/spire/files/spire-server.initd
new file mode 100644
index 000000000000..4594f5d1fa8d
--- /dev/null
+++ b/app-misc/spire/files/spire-server.initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+# Copyright 2019 Sony Interactive Entertainment LLC
+# Distributed under the terms of the GNU General Public License v2
+
+name="spire server daemon"
+description="spire server"
+logfile="${logfile:-/var/log/spire/spire-server.log}"
+command=/opt/spire/spire-server
+command_args="run --logFile ${logfile} ${spire_server_args}"
+command_user=spire
+directory=/opt/spire
+supervisor=supervise-daemon
diff --git a/app-misc/spire/metadata.xml b/app-misc/spire/metadata.xml
new file mode 100644
index 000000000000..c36c37139fad
--- /dev/null
+++ b/app-misc/spire/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>williamh@gentoo.org</email>
+ <name>William Hubbs</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/app-misc/spire/spire-0.8.1.ebuild b/app-misc/spire/spire-0.8.1.ebuild
new file mode 100644
index 000000000000..15aa92b309c2
--- /dev/null
+++ b/app-misc/spire/spire-0.8.1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+VENDOR_URI="https://dev.gentoo.org/~whubbs/dist/${P}-vendor.tar.gz"
+
+DESCRIPTION="the spiffe runtime environment"
+HOMEPAGE="https://github.com/spiffe/spire"
+SRC_URI="https://github.com/spiffe/spire/archive/${PV}.tar.gz -> ${P}.tar.gz
+ ${VENDOR_URI}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+COMMON_DEPEND="acct-group/spire
+ acct-user/spire"
+DEPEND="${COMMON_DEPEND}
+ dev-lang/go"
+RDEPEND="${COMMON_DEPEND}"
+
+RESTRICT="strip"
+
+src_prepare() {
+ default
+ mv ../vendor . || die "Unable to move ../vendor directory"
+}
+
+do_cmd() {
+ if [[ -z "$@" ]]; then
+ die "No arguments passed to do_cmd"
+ fi
+ echo $@
+ $@ || die
+}
+
+src_compile() {
+do_cmd cd cmd/spire-agent
+ do_cmd go build -mod vendor -o ../../spire-agent
+do_cmd cd ../../cmd/spire-server
+ do_cmd go build -mod vendor -o ../../spire-server
+}
+
+src_install() {
+ exeinto /opt/spire
+ doexe spire-agent spire-server
+ keepdir /opt/spire/.data
+ fowners spire:spire /opt/spire/.data
+ insinto /etc/spire
+ doins -r conf/*
+ dosym ../../etc/spire /opt/spire/conf
+ dosym ../../opt/spire/spire-agent /usr/bin/spire-agent
+ dosym ../../opt/spire/spire-server /usr/bin/spire-server
+ newconfd "${FILESDIR}"/spire-agent.confd spire-agent
+ newinitd "${FILESDIR}"/spire-agent.initd spire-agent
+ newconfd "${FILESDIR}"/spire-server.confd spire-server
+ newinitd "${FILESDIR}"/spire-server.initd spire-server
+keepdir /var/log/spire
+fowners spire:spire /var/log/spire
+}