Add ebuild for nomad
authorDa Risk <da_risk@geekorum.com>
Mon, 30 Mar 2020 15:11:06 -0400
changeset 229 6dd295839db8
parent 228 9380ea9128d5
child 230 6b9748bc3630
Add ebuild for nomad
.hgignore
acct-group/nomad/metadata.xml
acct-group/nomad/nomad-0.ebuild
acct-user/nomad/metadata.xml
acct-user/nomad/nomad-0.ebuild
sys-cluster/nomad/Manifest
sys-cluster/nomad/files/nomad.confd
sys-cluster/nomad/files/nomad.initd
sys-cluster/nomad/metadata.xml
sys-cluster/nomad/nomad-0.10.5.ebuild
--- a/.hgignore	Thu Feb 27 18:22:58 2020 -0400
+++ b/.hgignore	Mon Mar 30 15:11:06 2020 -0400
@@ -1,3 +1,4 @@
 syntax: glob
 *.sw?
 *~
+metadata
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/acct-group/nomad/metadata.xml	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>da_risk@geekorum.com</email>
+	</maintainer>
+</pkgmetadata>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/acct-group/nomad/nomad-0.ebuild	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,8 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit acct-group
+
+ACCT_GROUP_ID=646
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/acct-user/nomad/metadata.xml	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>da_risk@geekorum.com</email>
+	</maintainer>
+</pkgmetadata>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/acct-user/nomad/nomad-0.ebuild	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,11 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit acct-user
+
+DESCRIPTION="Nomad agent user"
+ACCT_USER_ID=646
+ACCT_USER_GROUPS=( nomad )
+acct-user_add_deps
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys-cluster/nomad/Manifest	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,2 @@
+DIST github.com-kardianos-govendor-e31350db9750308ce016ebef8350a8ff1e0a37d0.tar.gz 1280155 BLAKE2B af7d11600ffd019945ea98ab3e5cd8b2e13c3a4836222d286cd05cdf46fc5e069547d196fd9ec67c1a575cfd928036a66815cf2485080b9c21882594e23affdf SHA512 90d04203f7e8571e1f88da4680519712751c021271659b7b5cd2455630c8592e292808c4473a1304ef3f996213e0c9069fbd1fd6ff93e720229db44672c990a8
+DIST nomad-0.10.5.tar.gz 43766198 BLAKE2B 59262459feafcc4883e789416d154fdbc953aeaa3f4d0020997d0bd0a3f226ea527abd0fa9a1552b21875e768f2ce2698383a6b592dee190644f87bccd49a359 SHA512 42f3e55d8f4882a22d017ca2059174274f8b669052c30555925f86c1511b179d6cf1fc118e7d950f9e5c7d6421e48a6001f89cacb8f56ad5e9179318263a4461
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys-cluster/nomad/files/nomad.confd	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,10 @@
+# you can change the init script behavior by setting those parameters
+# - group (default: nomad)
+# - pidfile (default: /run/nomad/nomad.pid)
+# - user (default: nomad)
+
+# extra arguments for the consul agent
+command_args="-config-dir=/etc/nomad.d"
+
+# upstream strongly recommends > 1
+GOMAXPROCS=2
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys-cluster/nomad/files/nomad.initd	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,27 @@
+#!/sbin/openrc-run
+# Copyright 2015-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="nomad agent"
+extra_started_commands="reload"
+export GOMAXPROCS=${GOMAXPROCS:-2}
+group=${group:-${RC_SVCNAME}}
+user=${user:-${RC_SVCNAME}}
+pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"}
+command="/usr/bin/${RC_SVCNAME}"
+command_args="agent ${command_args:-config-dir=/etc/consul.d}"
+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"
+stopsig="SIGINT"
+
+depend() {
+	need net
+}
+
+reload() {
+	ebegin "Reloading ${RC_SVCNAME}"
+	${command} reload
+	eend $?
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys-cluster/nomad/metadata.xml	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>da_risk@geekorum.com</email>
+	</maintainer>
+</pkgmetadata>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sys-cluster/nomad/nomad-0.10.5.ebuild	Mon Mar 30 15:11:06 2020 -0400
@@ -0,0 +1,51 @@
+# Copyright 2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DESCRIPTION="The cluster manager from Hashicorp"
+HOMEPAGE="http://nomadproject.io"
+
+#RESTRICT="strip test"
+
+LICENSE="MPL-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+DEPEND="dev-go/go-bindata dev-go/go-bindata-assetfs"
+RDEPEND="${DEPEND}
+		acct-group/nomad
+		acct-user/nomad
+		"
+BDEPEND=""
+EGO_PN="github.com/hashicorp/${PN}"
+EGO_VENDOR=(
+	"github.com/kardianos/govendor e31350db9750308ce016ebef8350a8ff1e0a37d0"
+)
+
+inherit golang-vcs-snapshot golang-build
+
+SRC_URI="https://github.com/hashicorp/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
+		$EGO_VENDOR_URI"
+
+src_compile() {
+	ego_pn_check
+	# for now disable nvidia support
+	GOPATH="${WORKDIR}/${P}:$(get_golibdir_gopath)" \
+	GO_TAGS="nonvidia" \
+	emake -C "${S}/src/${EGO_PN}" "pkg/linux_amd64/${PN}"
+}
+
+src_install() {
+	dobin "${S}/src/${EGO_PN}/pkg/linux_amd64/${PN}"
+
+	local x
+	for x in /var/{lib,log}/${PN}; do
+		keepdir "${x}"
+		fowners ${PN}:${PN} "${x}"
+	done
+
+	newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+	newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+}