commit: 588a8971fe9252f583dd0be708fdf87e5d18a8ed
Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 3 18:49:57 2017 +0000
Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
CommitDate: Thu Aug 3 18:49:57 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=588a8971
app-emulation/flannel: Add initscripts and logrotate file
Package-Manager: Portage-2.3.6, Repoman-2.3.3
app-emulation/flannel/files/flanneld.confd | 2 +
app-emulation/flannel/files/flanneld.initd | 24 ++++++++++++
app-emulation/flannel/files/flanneld.logrotated | 7 ++++
app-emulation/flannel/flannel-0.8.0-r1.ebuild | 51 +++++++++++++++++++++++++
4 files changed, 84 insertions(+)
diff --git a/app-emulation/flannel/files/flanneld.confd
b/app-emulation/flannel/files/flanneld.confd
new file mode 100644
index 00000000000..18686aa5d22
--- /dev/null
+++ b/app-emulation/flannel/files/flanneld.confd
@@ -0,0 +1,2 @@
+# arguments for flannel
+command_args=""
diff --git a/app-emulation/flannel/files/flanneld.initd
b/app-emulation/flannel/files/flanneld.initd
new file mode 100644
index 00000000000..6f75abd40f5
--- /dev/null
+++ b/app-emulation/flannel/files/flanneld.initd
@@ -0,0 +1,24 @@
+#!/sbin/openrc-run
+# Copyright 2016-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="Flannel Network Fabric for Containers"
+pidfile=${pidfile:-"/run/${SVCNAME}/${SVCNAME}.pid"}
+user=${user:-root}
+group=${group:-root}
+
+command="/usr/bin/${SVCNAME}"
+command_args="${command_args}"
+command_background="true"
+start_stop_daemon_args="--user ${user} --group ${group} \
+ --stdout /var/log/flannel/flannel.log \
+ --stderr /var/log/flannel/flannel.log"
+
+depend() {
+ need net
+ after net
+}
+
+start_pre() {
+ checkpath -d -m 0755 -o "${user}":"${group}" "${pidfile%/*}"
+}
diff --git a/app-emulation/flannel/files/flanneld.logrotated
b/app-emulation/flannel/files/flanneld.logrotated
new file mode 100644
index 00000000000..4108e630557
--- /dev/null
+++ b/app-emulation/flannel/files/flanneld.logrotated
@@ -0,0 +1,7 @@
+/var/log/flannel/* {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/app-emulation/flannel/flannel-0.8.0-r1.ebuild
b/app-emulation/flannel/flannel-0.8.0-r1.ebuild
new file mode 100644
index 00000000000..5135efe94f8
--- /dev/null
+++ b/app-emulation/flannel/flannel-0.8.0-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit golang-vcs-snapshot systemd user
+
+KEYWORDS="~amd64"
+DESCRIPTION="An etcd backed network fabric for containers"
+EGO_PN="github.com/coreos/flannel"
+HOMEPAGE="https://github.com/coreos/flannel"
+SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="hardened"
+RESTRICT="test"
+
+src_prepare() {
+ default
+ sed -e "s:^var Version =.*:var Version = \"${PV}\":" \
+ -i "${S}/src/${EGO_PN}/version/version.go" || die
+}
+
+src_compile() {
+ CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')"\
+ GOPATH="${WORKDIR}/${P}" \
+ go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}"
+ [[ -x bin/${PN} ]] || die
+}
+
+src_test() {
+ GOPATH="${WORKDIR}/${P}" \
+ go test -v -work -x "${EGO_PN}" || die
+}
+
+src_install() {
+ newbin "bin/${PN}" ${PN}d
+ cd "src/${EGO_PN}" || die
+ exeinto /usr/libexec/flannel
+ doexe dist/mk-docker-opts.sh
+ insinto /etc/systemd/system/docker.service.d
+ newins "${FILESDIR}/flannel-docker.conf" flannel.conf
+ newinitd "${FILESDIR}"/flanneld.initd flanneld
+ newconfd "${FILESDIR}"/flanneld.confd flanneld
+ keepdir /var/log/${PN}
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/flanneld.logrotated flanneld
+ systemd_newtmpfilesd "${FILESDIR}/flannel.tmpfilesd" flannel.conf
+ systemd_dounit "${FILESDIR}/flanneld.service"
+ dodoc README.md
+}