docker-runc-1.0.0_rc2_p20170201.ebuild 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. EGO_PN="github.com/docker/${PN/docker-}"
  5. if [[ ${PV} == *9999 ]]; then
  6. inherit golang-vcs
  7. else
  8. MY_PV="${PV/_/-}"
  9. EGIT_COMMIT="9df8b306d01f59d3a8029be411de015b7304dd8f"
  10. RUNC_COMMIT="9df8b3" # Change this when you update the ebuild
  11. SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
  12. KEYWORDS="~amd64 ~ppc64"
  13. inherit golang-vcs-snapshot
  14. fi
  15. DESCRIPTION="runc container cli tools (docker fork)"
  16. HOMEPAGE="http://runc.io"
  17. LICENSE="Apache-2.0"
  18. SLOT="0"
  19. IUSE="apparmor hardened +seccomp"
  20. RDEPEND="
  21. apparmor? ( sys-libs/libapparmor )
  22. seccomp? ( sys-libs/libseccomp )
  23. !app-emulation/runc
  24. "
  25. S=${WORKDIR}/${P}/src/${EGO_PN}
  26. RESTRICT="test"
  27. src_compile() {
  28. # Taken from app-emulation/docker-1.7.0-r1
  29. export CGO_CFLAGS="-I${ROOT}/usr/include"
  30. export CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')
  31. -L${ROOT}/usr/$(get_libdir)"
  32. # Setup GOPATH so things build
  33. rm -rf .gopath
  34. mkdir -p .gopath/src/"$(dirname "${GITHUB_URI}")"
  35. ln -sf ../../../.. .gopath/src/"${GITHUB_URI}"
  36. export GOPATH="${PWD}/.gopath:${PWD}/vendor"
  37. # build up optional flags
  38. local options=(
  39. $(usex apparmor 'apparmor')
  40. $(usex seccomp 'seccomp')
  41. )
  42. emake BUILDTAGS="${options[*]}" \
  43. COMMIT="${RUNC_COMMIT}"
  44. }
  45. src_install() {
  46. dobin runc
  47. }