summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-containers/flannel')
-rw-r--r--app-containers/flannel/Manifest2
-rw-r--r--app-containers/flannel/files/flannel-docker.conf2
-rw-r--r--app-containers/flannel/files/flannel.tmpfilesd1
-rw-r--r--app-containers/flannel/files/flanneld.confd2
-rw-r--r--app-containers/flannel/files/flanneld.initd19
-rw-r--r--app-containers/flannel/files/flanneld.logrotated7
-rw-r--r--app-containers/flannel/files/flanneld.service13
-rw-r--r--app-containers/flannel/flannel-0.11.0.ebuild55
-rw-r--r--app-containers/flannel/flannel-0.14.0.ebuild54
-rw-r--r--app-containers/flannel/metadata.xml10
10 files changed, 165 insertions, 0 deletions
diff --git a/app-containers/flannel/Manifest b/app-containers/flannel/Manifest
new file mode 100644
index 000000000000..fdfb49c6cbe8
--- /dev/null
+++ b/app-containers/flannel/Manifest
@@ -0,0 +1,2 @@
+DIST flannel-0.11.0.tar.gz 6443391 BLAKE2B 5358e513a73fec6d8fcdb0182ec814fcf204eb12830f7d60acb3d4432f821ccc9e174fcc7adb57584ab1782c3f285e46b51bb0f76635fab9cf851cb2bd40c1b3 SHA512 72d18cd4ec58ede3848da3b94b7f3e33f8dda59d9fceb13864757998a24f0b312bc5b5d7927d3da8a805475efee469095ac09390fa632eb0c6ef9dd0f5d38a3b
+DIST flannel-0.14.0.tar.gz 8324790 BLAKE2B 47fd65d531f9fa10e602ccf1858549ede97d8f8c9afa32ffeb010d733060703262cafd02b5daddc65142dfa96b1c6b429eaff30b7fdaca27e2a5397c0d756e7c SHA512 a5d9f45d55f18c744e635b4d697200cf9d5a8c4387cd6d9c57220e652e3688337f2ee50fef193135dd0073b14edb8800fac8d5ca9f9d0d3e9ef70d09a52f259c
diff --git a/app-containers/flannel/files/flannel-docker.conf b/app-containers/flannel/files/flannel-docker.conf
new file mode 100644
index 000000000000..8f5517776b89
--- /dev/null
+++ b/app-containers/flannel/files/flannel-docker.conf
@@ -0,0 +1,2 @@
+[Service]
+EnvironmentFile=-/run/flannel/docker
diff --git a/app-containers/flannel/files/flannel.tmpfilesd b/app-containers/flannel/files/flannel.tmpfilesd
new file mode 100644
index 000000000000..98e5abd9b20f
--- /dev/null
+++ b/app-containers/flannel/files/flannel.tmpfilesd
@@ -0,0 +1 @@
+d /run/flannel 0755 root root
diff --git a/app-containers/flannel/files/flanneld.confd b/app-containers/flannel/files/flanneld.confd
new file mode 100644
index 000000000000..18686aa5d223
--- /dev/null
+++ b/app-containers/flannel/files/flanneld.confd
@@ -0,0 +1,2 @@
+# arguments for flannel
+command_args=""
diff --git a/app-containers/flannel/files/flanneld.initd b/app-containers/flannel/files/flanneld.initd
new file mode 100644
index 000000000000..d5d966a40d30
--- /dev/null
+++ b/app-containers/flannel/files/flanneld.initd
@@ -0,0 +1,19 @@
+#!/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/${RC_SVCNAME}.pid"}
+user=${user:-root}
+group=${group:-root}
+
+command="/usr/bin/${RC_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
+}
diff --git a/app-containers/flannel/files/flanneld.logrotated b/app-containers/flannel/files/flanneld.logrotated
new file mode 100644
index 000000000000..4108e6305578
--- /dev/null
+++ b/app-containers/flannel/files/flanneld.logrotated
@@ -0,0 +1,7 @@
+/var/log/flannel/* {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/app-containers/flannel/files/flanneld.service b/app-containers/flannel/files/flanneld.service
new file mode 100644
index 000000000000..86e69a49e73f
--- /dev/null
+++ b/app-containers/flannel/files/flanneld.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Flanneld overlay address etcd agent
+After=network.target
+Before=docker.service
+
+[Service]
+Type=notify
+Environment=FLANNEL_ETCD=http://127.0.0.1:4001,http://127.0.0.1:2379 FLANNEL_ETCD_KEY=/coreos.com/network
+ExecStart=/usr/bin/flanneld -etcd-endpoints=${FLANNEL_ETCD} -etcd-prefix=${FLANNEL_ETCD_KEY} $FLANNEL_OPTIONS
+ExecStartPost=/usr/libexec/flannel/mk-docker-opts.sh -k DOCKER_NETWORK_OPTIONS -d /run/flannel/docker
+
+[Install]
+RequiredBy=docker.service
diff --git a/app-containers/flannel/flannel-0.11.0.ebuild b/app-containers/flannel/flannel-0.11.0.ebuild
new file mode 100644
index 000000000000..9ddf9cc7bedf
--- /dev/null
+++ b/app-containers/flannel/flannel-0.11.0.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit golang-vcs-snapshot systemd user tmpfiles
+
+KEYWORDS="~amd64 ~arm64"
+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 BSD ISC LGPL-3 MIT"
+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
+ newtmpfiles "${FILESDIR}/flannel.tmpfilesd" flannel.conf
+ systemd_dounit "${FILESDIR}/flanneld.service"
+ dodoc README.md
+}
+
+pkg_postinst() {
+ tmpfiles_process flannel.conf
+}
diff --git a/app-containers/flannel/flannel-0.14.0.ebuild b/app-containers/flannel/flannel-0.14.0.ebuild
new file mode 100644
index 000000000000..ec33f31625ba
--- /dev/null
+++ b/app-containers/flannel/flannel-0.14.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit go-module systemd tmpfiles
+
+KEYWORDS="~amd64 ~arm64"
+DESCRIPTION="An etcd backed network fabric for containers"
+HOMEPAGE="https://github.com/coreos/flannel"
+SRC_URI="https://github.com/coreos/flannel/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0 BSD ISC LGPL-3 MIT"
+SLOT="0"
+IUSE="hardened"
+
+RESTRICT+=" test"
+
+src_prepare() {
+ default
+ sed -e "s:^var Version =.*:var Version = \"${PV}\":" \
+ -i "${S}/version/version.go" || die
+}
+
+src_compile() {
+ CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')"\
+ go build -o dist/flanneld -ldflags "
+ -X github.com/flannel-io/flannel/version.Version=v${PV}
+ -extldflags \"-static\"" . || die
+}
+
+src_test() {
+ GOPATH="${WORKDIR}/${P}" \
+ go test -v -work -x "${EGO_PN}" || die
+}
+
+src_install() {
+ dobin dist/${PN}d
+ 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
+ newtmpfiles "${FILESDIR}/flannel.tmpfilesd" flannel.conf
+ systemd_dounit "${FILESDIR}/flanneld.service"
+ dodoc README.md
+}
+
+pkg_postinst() {
+ tmpfiles_process flannel.conf
+}
diff --git a/app-containers/flannel/metadata.xml b/app-containers/flannel/metadata.xml
new file mode 100644
index 000000000000..4ed5e4e641ed
--- /dev/null
+++ b/app-containers/flannel/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>zmedico@gentoo.org</email>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">coreos/flannel</remote-id>
+ </upstream>
+</pkgmetadata>