Merge pull request #1157 from crawford/etcd

etcd: use etcd-starter and bump to latest releases
This commit is contained in:
Alex Crawford 2015-03-23 19:47:32 -07:00
commit 576e769732
10 changed files with 97 additions and 63 deletions

View File

@ -81,7 +81,7 @@ RDEPEND="${RDEPEND}
# implementation based on whether protocol 2 is enabled or not. # implementation based on whether protocol 2 is enabled or not.
RDEPEND="${RDEPEND} RDEPEND="${RDEPEND}
etcd_protocols_1? ( etcd_protocols_1? (
dev-db/etcd:1[etcd_protocols_2=] dev-db/etcd:1
!etcd_protocols_2? ( dev-db/etcdctl ) !etcd_protocols_2? ( dev-db/etcdctl )
) )
etcd_protocols_2? ( dev-db/etcd:2 ) etcd_protocols_2? ( dev-db/etcd:2 )
@ -108,6 +108,7 @@ RDEPEND="${RDEPEND}
coreos-base/coreos-init coreos-base/coreos-init
coreos-base/coreos-cloudinit coreos-base/coreos-cloudinit
coreos-base/coretest coreos-base/coretest
dev-db/etcd-starter
net-analyzer/nmap net-analyzer/nmap
net-firewall/ebtables net-firewall/ebtables
net-firewall/ipset net-firewall/ipset

View File

@ -0,0 +1 @@
etcd-starter-9999.ebuild

View File

@ -0,0 +1,51 @@
#
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header:$
#
EAPI=5
CROS_WORKON_PROJECT="coreos/etcd-starter"
CROS_WORKON_LOCALNAME="etcd-starter"
CROS_WORKON_REPO="git://github.com"
COREOS_GO_PACKAGE="github.com/coreos/etcd-starter"
inherit coreos-go cros-workon systemd
if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64"
else
CROS_WORKON_COMMIT="e6265b3a028225a8b57ddbfc3ad1992abc89974f" # v0.0.2
KEYWORDS="amd64"
fi
DESCRIPTION="etcd-starter"
HOMEPAGE="https://github.com/coreos/etcd-starter"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
IUSE="etcd_protocols_1 etcd_protocols_2"
REQUIRED_USE="|| ( etcd_protocols_1 etcd_protocols_2 )"
DEPEND=">=dev-lang/go-1.2"
src_compile() {
go_build "${COREOS_GO_PACKAGE}"
}
src_install() {
local libexec="libexec/etcd/internal_versions"
if use etcd_protocols_1 && use etcd_protocols_2; then
dobin "${WORKDIR}/gopath/bin/${PN}"
dosym "${PN}" /usr/bin/etcd
elif use etcd_protocols_1; then
dosym "../${libexec}/1/etcd" /usr/bin/etcd
elif use etcd_protocols_2; then
dosym "../${libexec}/2/etcd" /usr/bin/etcd
fi
systemd_dounit "${FILESDIR}"/etcd.service
systemd_dotmpfilesd "${FILESDIR}"/etcd.conf
}

View File

@ -1,54 +0,0 @@
#
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header:$
#
EAPI=4
CROS_WORKON_PROJECT="coreos/etcd"
CROS_WORKON_LOCALNAME="etcd"
CROS_WORKON_REPO="git://github.com"
inherit coreos-doc toolchain-funcs cros-workon systemd
if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64"
else
CROS_WORKON_COMMIT="d6523fe4638100c72f40cb282cd1232db13f7336" # v0.4.7
KEYWORDS="amd64"
fi
DESCRIPTION="etcd"
HOMEPAGE="https://github.com/coreos/etcd"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="1"
IUSE="etcd_protocols_1 etcd_protocols_2"
# Sanity check that this version is indeed wanted!
REQUIRED_USE="etcd_protocols_${SLOT}"
DEPEND=">=dev-lang/go-1.2"
RDEPEND="!dev-db/etcd:0
!etcd_protocols_2? ( !dev-db/etcd:2 )"
src_compile() {
./build
}
src_install() {
local libexec="libexec/${PN}/internal_versions"
exeinto "/usr/${libexec}"
newexe "${S}/bin/${PN}" ${SLOT}
# protocol1 is default if protocol2 is disabled
if ! use etcd_protocols_2; then
dosym "../${libexec}/${SLOT}" /usr/bin/${PN}
systemd_dounit "${FILESDIR}"/${PN}.service
systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
coreos-dodoc -r Documentation/*
fi
}

View File

@ -0,0 +1,39 @@
#
# Copyright (c) 2014 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header:$
#
EAPI=4
CROS_WORKON_PROJECT="coreos/etcd"
CROS_WORKON_LOCALNAME="etcd"
CROS_WORKON_REPO="git://github.com"
inherit coreos-doc toolchain-funcs cros-workon
if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64"
else
CROS_WORKON_COMMIT="2f6ea0a0e5a6854d2d0f79bf0d1bb87dde649071" # v0.4.8
KEYWORDS="amd64"
fi
DESCRIPTION="etcd"
HOMEPAGE="https://github.com/coreos/etcd"
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="1"
DEPEND=">=dev-lang/go-1.2"
RDEPEND="!dev-db/etcd:0"
src_compile() {
./build
}
src_install() {
local libexec="libexec/${PN}/internal_versions/${SLOT}"
exeinto "/usr/${libexec}"
doexe "${S}/bin/${PN}"
}

View File

@ -9,12 +9,12 @@ CROS_WORKON_PROJECT="coreos/etcd"
CROS_WORKON_LOCALNAME="etcd" CROS_WORKON_LOCALNAME="etcd"
CROS_WORKON_REPO="git://github.com" CROS_WORKON_REPO="git://github.com"
COREOS_GO_PACKAGE="github.com/coreos/etcd" COREOS_GO_PACKAGE="github.com/coreos/etcd"
inherit coreos-doc coreos-go toolchain-funcs cros-workon systemd inherit coreos-doc coreos-go toolchain-funcs cros-workon
if [[ "${PV}" == 9999 ]]; then if [[ "${PV}" == 9999 ]]; then
KEYWORDS="~amd64" KEYWORDS="~amd64"
else else
CROS_WORKON_COMMIT="9481945228b97c5d019596b921d8b03833964d9e" # v2.0.5 CROS_WORKON_COMMIT="e3c902228b1fefa8158583e167ae552622a24367" # v2.0.6
KEYWORDS="amd64" KEYWORDS="amd64"
fi fi
@ -38,18 +38,14 @@ src_compile() {
} }
src_install() { src_install() {
local libexec="libexec/${PN}/internal_versions" local libexec="libexec/${PN}/internal_versions/${SLOT}"
dobin ${WORKDIR}/gopath/bin/etcdctl dobin ${WORKDIR}/gopath/bin/etcdctl
dobin ${WORKDIR}/gopath/bin/etcd-migrate dobin ${WORKDIR}/gopath/bin/etcd-migrate
dobin ${WORKDIR}/gopath/bin/etcd-dump-logs dobin ${WORKDIR}/gopath/bin/etcd-dump-logs
exeinto "/usr/${libexec}" exeinto "/usr/${libexec}"
newexe "${WORKDIR}/gopath/bin/${PN}" ${SLOT} doexe "${WORKDIR}/gopath/bin/${PN}"
dosym "../${libexec}/${SLOT}" /usr/bin/${PN}
systemd_dounit "${FILESDIR}"/${PN}.service
systemd_dotmpfilesd "${FILESDIR}"/${PN}.conf
coreos-dodoc -r Documentation/* coreos-dodoc -r Documentation/*
} }