diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /app-admin/serf |
reinit the tree, so we can have metadata
Diffstat (limited to 'app-admin/serf')
-rw-r--r-- | app-admin/serf/Manifest | 9 | ||||
-rw-r--r-- | app-admin/serf/files/serf.confd | 7 | ||||
-rw-r--r-- | app-admin/serf/files/serf.initd | 27 | ||||
-rw-r--r-- | app-admin/serf/files/serf.logrotated | 7 | ||||
-rw-r--r-- | app-admin/serf/files/serf.service | 14 | ||||
-rw-r--r-- | app-admin/serf/metadata.xml | 10 | ||||
-rw-r--r-- | app-admin/serf/serf-0.8.1-r1.ebuild | 83 |
7 files changed, 157 insertions, 0 deletions
diff --git a/app-admin/serf/Manifest b/app-admin/serf/Manifest new file mode 100644 index 000000000000..7911d1f70cfc --- /dev/null +++ b/app-admin/serf/Manifest @@ -0,0 +1,9 @@ +AUX serf.confd 240 SHA256 f6f7265f4dacf46171513f31ea62432497dac8e4dca78d470b90e5d2692fa03d SHA512 9bb726725a6116d23f4095a3e8f7d401d854c80ee9a5993d718c4aebef77f36a597d7a2e504e3dc95f0a177f2184d79fd253f330fb48b9c028d3bdf2db90b7d9 WHIRLPOOL 4d1a4bd1597f6963a53b14990b870c1365ceee0e6e52c30bf1421dc8248ac0a632a6401a1c7603e1881b26adb830d35b034379169304a2638ca302ebb2e4b409 +AUX serf.initd 683 SHA256 4ddf960da6a96a69490a07c41000cedfb4d9f7ed13dcd2666c65b3c041ad1b05 SHA512 a223d1e002eae3f91b941eb75a2741bb5fc22c78f4ab8ada430ee5e34f85f28410acc26e503eae672911161fab6847c6a7733b51cdad29fa4b4f67cfdc879597 WHIRLPOOL efae90b4fc882c14c8312524e955dc546783a30abd063d7a193386dcdf11653c49e15344031bfc9196897875a3f26a6f7970647b45754cc43eea1df7b1926896 +AUX serf.logrotated 81 SHA256 0d57fd24eba6da224dba64bf06faa7cabcadd0cf1daa32be4c6e41b9667c4732 SHA512 9d3664c123e846de81a2f574a9c2610e254d5ddad1c23b67ef7b8841e933c7aea93a419becaf45af9594ea98ac36d23883bebf3d344205c4756f3e1df9e87518 WHIRLPOOL 42ce8438ab8caa9723882d5a2cc98e2a99f8fe0868eddc08dbfb15a1d186a0811680c172fd7da72bcae2a1a8c78c77c937c24372091a8f9617a2c8b854d21a33 +AUX serf.service 286 SHA256 379e475320bf17f42a65f2de1fa46ae7d3727401a41d79c8b44380812377d054 SHA512 928dfca39afd79b113b299e4de25635fc9f68c64c77951d690797ed5796515d060fc36286f0dc1da63923042e3d8612ca8b1696dd511cb2fbd06550151d2a05b WHIRLPOOL c832befcd84cc595c9b1ef716276ced5ebb18025a7ccfdc166c7986aa87d01a27418e773511609b28b970cec1535fa0019f17023315fb1045dcc48395eba1480 +DIST github.com-mitchellh-gox-c9740af9c6574448fd48eb30a71f964014c7a837.tar.gz 15772 SHA256 826666828f1ec3e535268fa95d983362c6c773e9a87aa94613e7a47805d22e38 SHA512 d4b2d5d9666285584697bc0d6ddc2f1a1e3f23741650e831adb42baffbb5f72fc3d5ae8a8fb6719faf1df75d3da334941b0404387f0c213aabdb5c3d5634c55d WHIRLPOOL 89d52013bfb563a11a4042760470ac317398c3f8a61b9e7734c3ac2737d916126ad10a113948eb5a8362de3d77e598e42f4a0510760ae67465bde08658947f7a +DIST github.com-mitchellh-iochan-87b45ffd0e9581375c491fef3d32130bb15c5bd7.tar.gz 1785 SHA256 71c117246bb1d4d78ad5c3bc5d301942bcebaae5b1e35da1ad7851ceac71a675 SHA512 2efc0e3cbca496240e3e24550fd0d2aab742eb9b227230ff1ed4ee47344b994642b028bd4644cd45cd697f5f5ef6a729aad65537b10c6555bd52d9ca4b9c717c WHIRLPOOL 15dfd50bfc992a7b6a1b5d672d5bf9bfcb71a357eae371eac773e7fe9ad4ec8d4d0578e0dc6b12bb14689d1497129616b0eb300bbcb483a6865ac315bced562a +DIST serf-0.8.1.tar.gz 1445011 SHA256 266d38c08d7459d38ba901d7cdaf36122a3cb77049fa537f5ab17fac1747d094 SHA512 81a4bc2e1659324980fd59464af021ad5ec80431dc1b49b875bb0c97c8f92766dfee9b204bd8c9ab4e175a281bc23815f5e3008ecfb2848c7354c33603bb5514 WHIRLPOOL 1d7a39b84b939b73dda817df3f9b98c044a93e20561ed7cb573ee68afc2742a3f7aea9cfc837b6b25cd1abdf390bc84c2460b97b27c2a0090f13f9a73b5a7779 +EBUILD serf-0.8.1-r1.ebuild 2087 SHA256 48d1963ad6b6ae45798046303936c945e49aab9ea88390bb18af443ddbf21f48 SHA512 7fa41ac143f3532bfe612492ca084aa998c072f346e9897f441f31d55d41468615673ced32ef43c01a5e9962822a3b340997fbf167c34260f7083413faa81731 WHIRLPOOL 3a5480abc3d171d3a7932e844ac7e3e2b81a928ccc48e76d6a9b32e1cc15b1ca1098af8e6e229c10c7055679d11805e0c7d4b6ac96eeae0001ac9c239af914f0 +MISC metadata.xml 297 SHA256 b90deec50778c19614f4c7ae5a6ade77a8b647a153074547900f9646a986b350 SHA512 a4e75bdd3c86842ac3de4852d00f264e877c9784754eb9b2d4d38c39123115ded6beae61628b5315d7c19bfbefd1e0360491b37656e34a87b33498b246521e76 WHIRLPOOL a560703d68e9889b50d4a3f3781a3b40bc1bee640f289f99405128fb62bca4788f0875032619f765c30b68bed7ce23b6425a68de849bd1258214b29f5d23ad6e diff --git a/app-admin/serf/files/serf.confd b/app-admin/serf/files/serf.confd new file mode 100644 index 000000000000..f5aeaeddf7e7 --- /dev/null +++ b/app-admin/serf/files/serf.confd @@ -0,0 +1,7 @@ +# you can change the init script behavior by setting those parameters +# - group (default: serf) +# - pidfile (default: /run/serf/serf.pid) +# - user (default: serf) + +# extra arguments for the serf agent +command_args="-config-dir=/etc/serf.d" diff --git a/app-admin/serf/files/serf.initd b/app-admin/serf/files/serf.initd new file mode 100644 index 000000000000..042e4f8018a8 --- /dev/null +++ b/app-admin/serf/files/serf.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +# Copyright 2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +description="serf agent" +extra_started_commands="reload" +group=${group:-${RC_SVCNAME}} +pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +user=${user:-${RC_SVCNAME}} + +command="/usr/bin/${RC_SVCNAME}" +command_args="agent ${command_args:-config-dir=/etc/serf.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 $? +} diff --git a/app-admin/serf/files/serf.logrotated b/app-admin/serf/files/serf.logrotated new file mode 100644 index 000000000000..e35d7331b247 --- /dev/null +++ b/app-admin/serf/files/serf.logrotated @@ -0,0 +1,7 @@ +/var/log/serf/serf.log { + missingok + size 5M + rotate 3 + compress + copytruncate +} diff --git a/app-admin/serf/files/serf.service b/app-admin/serf/files/serf.service new file mode 100644 index 000000000000..f2d390fe8222 --- /dev/null +++ b/app-admin/serf/files/serf.service @@ -0,0 +1,14 @@ +[Unit] +Description=serf agent +Requires=network-online.target +After=network-online.target + +[Service] +User=serf +Environment=SERF_AGENT_OPTS="-config-dir=/etc/serf.d" +ExecStart=/usr/bin/serf agent $SERF_AGENT_OPTS +Restart=on-failure +KillSignal=SIGINT + +[Install] +WantedBy=multi-user.target diff --git a/app-admin/serf/metadata.xml b/app-admin/serf/metadata.xml new file mode 100644 index 000000000000..213d2fe2fa81 --- /dev/null +++ b/app-admin/serf/metadata.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>zmedico@gentoo.org</email> + </maintainer> + <upstream> + <remote-id type="github">hashicorp/serf</remote-id> + </upstream> +</pkgmetadata> diff --git a/app-admin/serf/serf-0.8.1-r1.ebuild b/app-admin/serf/serf-0.8.1-r1.ebuild new file mode 100644 index 000000000000..963e9bcc99ef --- /dev/null +++ b/app-admin/serf/serf-0.8.1-r1.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +EGO_VENDOR=( + "github.com/mitchellh/gox c9740af9c6574448fd48eb30a71f964014c7a837" + "github.com/mitchellh/iochan 87b45ffd0e9581375c491fef3d32130bb15c5bd7" +) + +inherit golang-vcs-snapshot systemd user + +KEYWORDS="~amd64" +EGO_PN="github.com/hashicorp/serf" +DESCRIPTION="Service orchestration and management tool" +HOMEPAGE="https://www.serfdom.io/" +SRC_URI="https://github.com/hashicorp/serf/archive/v${PV}.tar.gz -> ${P}.tar.gz + ${EGO_VENDOR_URI}" + +SLOT="0" +LICENSE="MPL-2.0" +IUSE="" +RESTRICT="test" + +DEPEND=" + >=dev-lang/go-1.6:= + >=dev-go/go-tools-0_pre20160121" +RDEPEND="" + +pkg_setup() { + enewgroup serf + enewuser serf -1 -1 /var/lib/${PN} serf +} + +src_prepare() { + eapply_user + # Avoid the need to have a git checkout + sed -e 's:^GIT.*::' \ + -e 's:-X main.GitCommit.*:" \\:' \ + -i "${S}/src/${EGO_PN}/scripts/build.sh" || die + + # go install golang.org/x/tools/cmd/stringer: mkdir /usr/lib/go-gentoo/bin/: permission denied + sed -e 's:go get -u -v $(GOTOOLS)::' \ + -e 's:^GIT.*::' \ + -i "${S}/src/${EGO_PN}/GNUmakefile" || die +} + +src_compile() { + export GOPATH="${S}" + mkdir "${S}/src/github.com/mitchellh" || die + mv "${S}/src/${EGO_PN}/vendor/github.com/mitchellh/"{gox,iochan} \ + "${S}/src/github.com/mitchellh" || die + go install -v -work -x ${EGO_BUILD_FLAGS} "github.com/mitchellh/gox/..." || die + # The dev target sets causes build.sh to set appropriate XC_OS + # and XC_ARCH, and skips generation of an unused zip file, + # avoiding a dependency on app-arch/zip. + PATH=${PATH}:${S}/bin \ + emake -C "${S}/src/${EGO_PN}" dev +} + +src_test() { + emake -C "${S}/src/${EGO_PN}" test +} + +src_install() { + local x + + dobin "${S}/bin/${PN}" + + keepdir /etc/serf.d + insinto /etc/serf.d + + for x in /var/{lib,log}/${PN}; do + keepdir "${x}" + fowners serf:serf "${x}" + done + + newinitd "${FILESDIR}/serf.initd" "${PN}" + newconfd "${FILESDIR}/serf.confd" "${PN}" + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotated" "${PN}" + systemd_dounit "${FILESDIR}/serf.service" +} |