proot-3.2.2-r1.ebuild 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. MY_PN="PRoot"
  5. inherit eutils pax-utils toolchain-funcs
  6. DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
  7. HOMEPAGE="http://proot.me"
  8. SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="amd64 x86"
  12. IUSE="care test"
  13. RDEPEND="care? ( app-arch/libarchive:0= )
  14. sys-libs/talloc"
  15. DEPEND="${RDEPEND}
  16. care? ( dev-libs/uthash )
  17. test? ( dev-util/valgrind )"
  18. # Breaks sandbox
  19. RESTRICT="test"
  20. S="${WORKDIR}/${MY_PN}-${PV}"
  21. src_prepare() {
  22. epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
  23. "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch" \
  24. "${FILESDIR}/${P}-build-care.patch"
  25. epatch_user
  26. }
  27. src_compile() {
  28. # build the proot and care targets
  29. emake -C src V=1 \
  30. CC="$(tc-getCC)" \
  31. CHECK_VERSION="true" \
  32. CAREBUILDENV="ok" \
  33. proot $(usex care "care" "" "" "")
  34. }
  35. src_install() {
  36. if use care; then
  37. # Workaround for bug #493416
  38. pax-mark -Emp src/care
  39. dobin src/care
  40. fi
  41. # Workaround for bug #493416
  42. pax-mark -Emp src/proot
  43. dobin src/proot
  44. doman doc/proot.1
  45. dodoc doc/*.txt doc/articles/*
  46. }
  47. src_test() {
  48. emake -C tests -j1 CC="$(tc-getCC)"
  49. }
  50. pkg_postinst() {
  51. if use care; then
  52. elog "You have enabled 'care' USE flag, that builds and installs"
  53. elog "dynamically linked care binary."
  54. elog "Upstream does NOT support such way of building CARE,"
  55. elog "it provides only prebuilt binaries."
  56. elog "CARE also has known problems on hardened systems"
  57. elog "Please do NOT file bugs about them to https://bugs.gentoo.org"
  58. fi
  59. }