docker-registry-2.5.1.ebuild 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit golang-vcs-snapshot systemd user
  5. KEYWORDS="~amd64"
  6. EGO_PN="github.com/docker/distribution/..."
  7. EGIT_COMMIT="v${PV}"
  8. SRC_URI="https://${EGO_PN%/*}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
  9. DESCRIPTION="Docker Registry 2.0"
  10. HOMEPAGE="https://${EGO_PN%/*}"
  11. LICENSE="Apache-2.0"
  12. SLOT="0"
  13. IUSE=""
  14. DEPEND=">=dev-lang/go-1.5"
  15. SVCNAME=registry
  16. pkg_setup() {
  17. enewgroup ${SVCNAME}
  18. enewuser ${SVCNAME} -1 -1 /dev/null ${SVCNAME}
  19. }
  20. src_compile() {
  21. GOPATH="${S}" GO15VENDOREXPERIMENT=1 \
  22. go install -v -work -x ${EGO_BUILD_FLAGS} "${EGO_PN}" || die
  23. }
  24. src_install() {
  25. exeinto /usr/libexec/${PN}
  26. doexe "${S}"/bin/*
  27. insinto /etc/docker/registry
  28. newins "${S}"/src/${EGO_PN%/*}/cmd/registry/config-example.yml config.yml.example
  29. newinitd "${FILESDIR}/${SVCNAME}.initd" "${SVCNAME}"
  30. newconfd "${FILESDIR}/${SVCNAME}.confd" "${SVCNAME}"
  31. systemd_dounit "${FILESDIR}/${SVCNAME}.service"
  32. keepdir /var/{lib,log}/${SVCNAME}
  33. fowners ${SVCNAME}:${SVCNAME} /var/{lib,log}/${SVCNAME}
  34. insinto /etc/logrotate.d
  35. newins "${FILESDIR}/${SVCNAME}.logrotated" "${SVCNAME}"
  36. }