tini-0.13.0-r1.ebuild 948 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit cmake-utils flag-o-matic
  5. DESCRIPTION="A tiny but valid init for containers"
  6. HOMEPAGE="https://github.com/krallin/tini"
  7. SRC_URI="https://github.com/krallin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="+args static"
  12. PATCHES=( "${FILESDIR}"/${P}-preprocessed-license.patch )
  13. src_prepare() {
  14. default
  15. # Do not strip binary
  16. sed -i -e 's/-Wl,-s")$/")/' CMakeLists.txt || die
  17. }
  18. src_configure() {
  19. local mycmakeargs=()
  20. use args || mycmakeargs+=(-DMINIMAL=ON)
  21. cmake-utils_src_configure
  22. }
  23. src_compile() {
  24. append-cflags -DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37
  25. cmake-utils_src_compile
  26. }
  27. src_install() {
  28. cmake-utils_src_install
  29. if use static; then
  30. mv "${ED%/}"/usr/bin/{${PN}-static,${PN}} || die
  31. else
  32. rm "${ED%/}"/usr/bin/${PN}-static || die
  33. fi
  34. }