Skip to content

Commit

Permalink
dev-db/etcd: Add support to only install etcdctl
Browse files Browse the repository at this point in the history
Package-Manager: Portage-2.3.24, Repoman-2.3.6
  • Loading branch information
mrueg committed Feb 23, 2018
1 parent 4069fd7 commit 7d2e52b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
37 changes: 20 additions & 17 deletions dev-db/etcd/etcd-3.3.1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ HOMEPAGE="https://github.com/coreos/etcd"
SRC_URI="https://${EGO_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
IUSE="doc"
IUSE="doc +server"
DEPEND=">=dev-lang/go-1.9:="
RDEPEND="!dev-db/etcdctl"

Expand All @@ -37,23 +37,26 @@ src_compile() {

src_install() {
pushd src/${EGO_PN} || die
insinto /etc/${PN}
doins "${FILESDIR}/${PN}.conf"
dobin bin/*
dodoc README.md
dobin bin/etcdctl
use doc && dodoc -r Documentation
systemd_dounit "${FILESDIR}/${PN}.service"
systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d.conf" ${PN}.conf
newinitd "${FILESDIR}"/${PN}.initd ${PN}
newconfd "${FILESDIR}"/${PN}.confd ${PN}
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotated" "${PN}"
keepdir /var/lib/${PN}
fowners ${PN}:${PN} /var/lib/${PN}
fperms 0700 /var/lib/${PN}
keepdir /var/log/${PN}
fowners ${PN}:${PN} /var/log/${PN}
fperms 755 /var/log/${PN}
if use server; then
insinto /etc/${PN}
doins "${FILESDIR}/${PN}.conf"
dobin bin/etcd
dodoc README.md
systemd_dounit "${FILESDIR}/${PN}.service"
systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d.conf" ${PN}.conf
newinitd "${FILESDIR}"/${PN}.initd ${PN}
newconfd "${FILESDIR}"/${PN}.confd ${PN}
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotated" "${PN}"
keepdir /var/lib/${PN}
fowners ${PN}:${PN} /var/lib/${PN}
fperms 0700 /var/lib/${PN}
keepdir /var/log/${PN}
fowners ${PN}:${PN} /var/log/${PN}
fperms 755 /var/log/${PN}
fi
popd || die
}

Expand Down
3 changes: 3 additions & 0 deletions dev-db/etcd/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
<doc>https://github.com/coreos/etcd/blob/master/README.md/</doc>
<remote-id type="github">coreos/etcd</remote-id>
</upstream>
<use>
<flag name="server">Installs etcd daemon</flag>
</use>
<maintainer type="person">
<email>[email protected]</email>
</maintainer>
Expand Down

0 comments on commit 7d2e52b

Please sign in to comment.