summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Rüger <mrueg@gentoo.org>2017-08-03 20:49:57 +0200
committerManuel Rüger <mrueg@gentoo.org>2017-08-03 20:49:57 +0200
commit588a8971fe9252f583dd0be708fdf87e5d18a8ed (patch)
tree8941a8ab86a3bea835d7b499d2afc5c1d14455ef /app-emulation/flannel
parentdev-db/mariadb: Drop old revisions for 10.2.7 (diff)
downloadgentoo-588a8971fe9252f583dd0be708fdf87e5d18a8ed.tar.gz
gentoo-588a8971fe9252f583dd0be708fdf87e5d18a8ed.tar.bz2
gentoo-588a8971fe9252f583dd0be708fdf87e5d18a8ed.zip
app-emulation/flannel: Add initscripts and logrotate file
Package-Manager: Portage-2.3.6, Repoman-2.3.3
Diffstat (limited to 'app-emulation/flannel')
-rw-r--r--app-emulation/flannel/files/flanneld.confd2
-rw-r--r--app-emulation/flannel/files/flanneld.initd24
-rw-r--r--app-emulation/flannel/files/flanneld.logrotated7
-rw-r--r--app-emulation/flannel/flannel-0.8.0-r1.ebuild51
4 files changed, 84 insertions, 0 deletions
diff --git a/app-emulation/flannel/files/flanneld.confd b/app-emulation/flannel/files/flanneld.confd
new file mode 100644
index 000000000000..18686aa5d223
--- /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 000000000000..6f75abd40f53
--- /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 000000000000..4108e6305578
--- /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 000000000000..5135efe94f88
--- /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
+}