etcd-3.1.0.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit user systemd golang-vcs-snapshot
  5. KEYWORDS="~amd64"
  6. EGO_PN=github.com/coreos/etcd
  7. DESCRIPTION="Highly-available key value store for shared configuration and service discovery"
  8. HOMEPAGE="https://${EGO_PN}/"
  9. SRC_URI="https://${EGO_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  10. LICENSE="Apache-2.0"
  11. SLOT="0"
  12. IUSE="doc"
  13. DEPEND=">=dev-lang/go-1.6:="
  14. RDEPEND="!dev-db/etcdctl"
  15. src_prepare() {
  16. eapply_user
  17. sed -e 's|GIT_SHA=.*|GIT_SHA=v${PV}|'\
  18. -i "${S}"/src/${EGO_PN}/build || die
  19. }
  20. pkg_setup() {
  21. enewgroup ${PN}
  22. enewuser ${PN} -1 -1 /var/lib/${PN} ${PN}
  23. }
  24. src_compile() {
  25. export GOPATH=${S}
  26. cd "${S}"/src/${EGO_PN} || die
  27. ./build || die
  28. }
  29. src_install() {
  30. cd "${S}"/src/${EGO_PN} || die
  31. insinto /etc/${PN}
  32. doins "${FILESDIR}/${PN}.conf"
  33. dobin bin/*
  34. dodoc README.md
  35. use doc && dodoc -r Documentation
  36. systemd_dounit "${FILESDIR}/${PN}.service"
  37. systemd_newtmpfilesd "${FILESDIR}/${PN}.tmpfiles.d.conf" ${PN}.conf
  38. newinitd "${FILESDIR}"/${PN}.initd ${PN}
  39. newconfd "${FILESDIR}"/${PN}.confd ${PN}
  40. insinto /etc/logrotate.d
  41. newins "${FILESDIR}/${PN}.logrotated" "${PN}"
  42. dodir /var/lib/${PN}
  43. fowners ${PN}:${PN} /var/lib/${PN}
  44. fperms 755 /var/lib/${PN}
  45. dodir /var/log/${PN}
  46. fowners ${PN}:${PN} /var/log/${PN}
  47. fperms 755 /var/log/${PN}
  48. }
  49. src_test() {
  50. cd "${S}"/src/${EGO_PN} || die
  51. ./test || die
  52. }