etcd-2.3.7.ebuild 1.3 KB

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