proot-4.0.1.ebuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 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}/${PN}-3.2.2-build-care.patch" \
  25. "${FILESDIR}/${PN}-4.0.1-argv.patch"
  26. epatch_user
  27. }
  28. src_compile() {
  29. # build the proot and care targets
  30. emake -C src V=1 \
  31. CC="$(tc-getCC)" \
  32. CHECK_VERSION="true" \
  33. CAREBUILDENV="ok" \
  34. proot $(use care && echo "care")
  35. }
  36. src_install() {
  37. use care && dobin src/care
  38. dobin src/proot
  39. newman doc/proot/man.1 proot.1
  40. dodoc doc/proot/*.txt
  41. dodoc -r doc/articles
  42. }
  43. src_test() {
  44. emake -C tests -j1 CC="$(tc-getCC)"
  45. }
  46. pkg_postinst() {
  47. if use care; then
  48. elog "You have enabled 'care' USE flag, that builds and installs"
  49. elog "dynamically linked care binary."
  50. elog "Upstream does NOT support such way of building CARE,"
  51. elog "it provides only prebuilt binaries."
  52. elog "CARE also has known problems on hardened systems"
  53. elog "Please do NOT file bugs about them to https://bugs.gentoo.org"
  54. fi
  55. }