summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/proot')
-rw-r--r--sys-apps/proot/Manifest5
-rw-r--r--sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch19
-rw-r--r--sys-apps/proot/files/proot-3.2.1-makefile.patch11
-rw-r--r--sys-apps/proot/files/proot-3.2.2-build-care.patch20
-rw-r--r--sys-apps/proot/files/proot-4.0.1-argv.patch125
-rw-r--r--sys-apps/proot/metadata.xml24
-rw-r--r--sys-apps/proot/proot-3.2.2-r1.ebuild73
-rw-r--r--sys-apps/proot/proot-4.0.1.ebuild68
-rw-r--r--sys-apps/proot/proot-4.0.3.ebuild69
-rw-r--r--sys-apps/proot/proot-5.0.0.ebuild69
-rw-r--r--sys-apps/proot/proot-5.1.0.ebuild69
11 files changed, 552 insertions, 0 deletions
diff --git a/sys-apps/proot/Manifest b/sys-apps/proot/Manifest
new file mode 100644
index 000000000000..cd23e12ea8ea
--- /dev/null
+++ b/sys-apps/proot/Manifest
@@ -0,0 +1,5 @@
+DIST proot-3.2.2.tar.gz 171047 SHA256 481296465027c48de8b8779c4cdad57948c765139f2a17b25590068b8d21a111 SHA512 baf8df06a463978f0faf36f9d81935d6583b99b7e8c54b8ac330478ed92bb3a5d5cd624e028247c50bb9bc6fbe1300c5736a38c0aff250b23614aa52f922dfdd WHIRLPOOL 426c1b2ee6f6ee9ecc3f0b056d3baaf5269c894c302449dca263a1fe45c94d2e76bc07592fd88b9556554550653495fe1ce81e5021b1487e65239026fd23b962
+DIST proot-4.0.1.tar.gz 218732 SHA256 fbb92835f6d4f4cf0560709a852bdb2880611d3b0398b65e9036fabe9857645e SHA512 df6ea412856268af65ed5fd3ede8ae099c70e9b08d7875e3e2d8e44e9d4288de93e3844aa361db0b7b579b68b5e7a983989ec0742a6d31d7bef889f739db2158 WHIRLPOOL 640dde65a3b2f24777e292a90c35ff9489fa508054bf8a7752b5e5adbdb25c9fc17d300ebb344473194942b4bf60bdaab5f2ccd743a4bab0798d629573cec6df
+DIST proot-4.0.3.tar.gz 222716 SHA256 743e253c11d737ddaa0904774b3a9a9f01b5a22778b65076437282ffdc7638cb SHA512 1c74219d44ea79a4573c6dd21a5b62df8e93522886cadb1175044b782f40a711193af348763663d24ab634fbe13b67264f0bff061a980947810e38850d0133f8 WHIRLPOOL ffc6088c65cbe535c465e9839df34fa45eb6986a766f1ec86dbf6b655363817b3e0c21bd5863537797da4a91eb770d9e9267321f13715a7597173613a73117ee
+DIST proot-5.0.0.tar.gz 250005 SHA256 e3f4f38132416e0306fe8e7e225f037e1630665231c65a659969f7c0555483a7 SHA512 0617142d5bfe40329c12f5cbe3c850d01b82f10a8b44d63acb64e7e880af652fb60d05610fb91ce317353986eb30f031d82114661e5d58a38696d242ccd366ee WHIRLPOOL f2027f953046ed84e9095f599d4b414a5ec0c6b91544a66ebeaaaa5e48359dc44f91823aae237227f90a682b2c8290e718198ec74dfd9d7f74404b154f0ffc1f
+DIST proot-5.1.0.tar.gz 253251 SHA256 50fcb882662b2de3e64e603b68d1af75e920d480191a49e11c0cb63d50040386 SHA512 26be26d405a8bcbe94377c3e9c18a571e4b61e3074f0716b0db3517d147d9d4a07c80f7312171cf9580ac7748e72e688efaf1b8e4a0ca3bfc31c802aa351346f WHIRLPOOL 0642496dc5adba8e3e08bfc0c994fa173bfcfaa4b17c4f0586498fbbc62b06afaaa98156bd4ea95530a88b5d436cdf4acb66cced9bff428515c1bd3b3317f19a
diff --git a/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch b/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch
new file mode 100644
index 000000000000..43c0d03d978a
--- /dev/null
+++ b/sys-apps/proot/files/proot-2.3.1-lib-paths-fix.patch
@@ -0,0 +1,19 @@
+--- src/execve/ldso.c 2013-01-23 16:22:37.870287856 +0400
++++ src/execve/ldso.c 2013-01-23 16:31:40.219283675 +0400
+@@ -285,16 +285,10 @@
+ /* 6. /lib, /usr/lib + /usr/local/lib */
+ if (IS_CLASS32(elf_header))
+ status = add_host_ldso_paths(host_ldso_paths,
+-#if defined(ARCH_X86) || defined(ARCH_X86_64)
+- "/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu:"
+-#endif
+ "/lib32:/usr/lib32:/usr/local/lib32"
+ ":/lib:/usr/lib:/usr/local/lib");
+ else
+ status = add_host_ldso_paths(host_ldso_paths,
+-#if defined(ARCH_X86_64)
+- "/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:"
+-#endif
+ "/lib64:/usr/lib64:/usr/local/lib64"
+ ":/lib:/usr/lib:/usr/local/lib");
+ if (status < 0)
diff --git a/sys-apps/proot/files/proot-3.2.1-makefile.patch b/sys-apps/proot/files/proot-3.2.1-makefile.patch
new file mode 100644
index 000000000000..854c48ef0817
--- /dev/null
+++ b/sys-apps/proot/files/proot-3.2.1-makefile.patch
@@ -0,0 +1,11 @@
+--- src/GNUmakefile.orig 2013-12-06 10:47:18.554784621 +0400
++++ src/GNUmakefile 2013-12-06 10:47:43.129785804 +0400
+@@ -9,7 +9,7 @@
+ CC = gcc
+ LD = $(CC)
+ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I. -I$(VPATH)
+-CFLAGS += -Wall -Wextra -O2
++CFLAGS += -Wall -Wextra
+ LDFLAGS += -ltalloc
+
+ OBJECTS = \
diff --git a/sys-apps/proot/files/proot-3.2.2-build-care.patch b/sys-apps/proot/files/proot-3.2.2-build-care.patch
new file mode 100644
index 000000000000..c52a39cf787b
--- /dev/null
+++ b/sys-apps/proot/files/proot-3.2.2-build-care.patch
@@ -0,0 +1,20 @@
+Skip check for building care, patch by Patrick Lauer <patrick AT gentoo.org>
+
+--- src/GNUmakefile 2014-02-25 16:42:04.336863622 +0800
++++ src/GNUmakefile.new 2014-02-25 16:42:26.063050467 +0800
+@@ -54,15 +54,6 @@
+ all: proot
+
+ ######################################################################
+-# Sanity checks
+-
+-ifneq (,$(findstring care,$(MAKECMDGOALS)))
+-ifneq ($(CARE_BUILD_ENV),ok)
+-$(error care is supposed to be built with: http://build.reproducible.io)
+-endif
+-endif
+-
+-######################################################################
+ # Beautified output
+
+ quiet_GEN = @echo " GEN $@"; $(GEN)
diff --git a/sys-apps/proot/files/proot-4.0.1-argv.patch b/sys-apps/proot/files/proot-4.0.1-argv.patch
new file mode 100644
index 000000000000..df580563458c
--- /dev/null
+++ b/sys-apps/proot/files/proot-4.0.1-argv.patch
@@ -0,0 +1,125 @@
+commit 520fa3601c36dd0a3c84e310bd2a1189259000bd
+Author: Cédric VINCENT <cedric.vincent@st.com>
+Date: Thu Aug 7 14:29:37 2014 +0200
+
+ Don't dereference argv[0] when launching a script through a symlink.
+
+ Reported-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
+ Ref: https://bugs.gentoo.org/show_bug.cgi?id=517496
+
+ Also, don't complain about non-regular or non-executable files that
+ are not explicitely candidates.
+
+diff --git a/src/path/path.c b/src/path/path.c
+index 4225876..ecdef70 100644
+--- a/src/path/path.c
++++ b/src/path/path.c
+@@ -219,17 +219,21 @@ int which(Tracee *tracee, const char *paths, char host_path[PATH_MAX], char *con
+ /* Is the command available without any $PATH look-up? */
+ status = realpath2(tracee, host_path, command, true);
+ if (status == 0 && stat(host_path, &statr) == 0) {
+- if (!S_ISREG(statr.st_mode)) {
++ if (is_explicit && !S_ISREG(statr.st_mode)) {
+ notice(tracee, ERROR, USER, "'%s' is not a regular file", command);
+ return -EACCES;
+ }
+
+- if ((statr.st_mode & S_IXUSR) == 0) {
++ if (is_explicit && (statr.st_mode & S_IXUSR) == 0) {
+ notice(tracee, ERROR, USER, "'%s' is not executable", command);
+ return -EACCES;
+ }
+
+ found = true;
++
++ /* Don't dereference the final component to preserve
++ * argv0 in case it is a symlink to script. */
++ (void) realpath2(tracee, host_path, command, false);
+ }
+ else
+ found = false;
+@@ -274,8 +278,12 @@ int which(Tracee *tracee, const char *paths, char host_path[PATH_MAX], char *con
+ if (status == 0
+ && stat(host_path, &statr) == 0
+ && S_ISREG(statr.st_mode)
+- && (statr.st_mode & S_IXUSR) != 0)
+- return 0;
++ && (statr.st_mode & S_IXUSR) != 0) {
++ /* Don't dereference the final component to preserve
++ * argv0 in case it is a symlink to script. */
++ (void) realpath2(tracee, host_path, path, false);
++ return 0;
++ }
+ } while (*(cursor - 1) != '\0');
+
+ not_found:
+diff --git a/src/tracee/event.c b/src/tracee/event.c
+index 70668d6..5905c43 100644
+--- a/src/tracee/event.c
++++ b/src/tracee/event.c
+@@ -92,7 +92,7 @@ int launch_process(Tracee *tracee)
+ * guest rootfs. Note: Valgrind can't handle execve(2) on
+ * "foreign" binaries (ENOEXEC) but can handle execvp(3) on such
+ * binaries. */
+- execvp(tracee->exe, tracee->cmdline);
++ execv(tracee->exe, tracee->cmdline);
+ return -errno;
+
+ default: /* parent */
+diff --git a/tests/test-713b6910.sh b/tests/test-713b6910.sh
+new file mode 100644
+index 0000000..82e01fd
+--- /dev/null
++++ b/tests/test-713b6910.sh
+@@ -0,0 +1,51 @@
++if [ -z `which mcookie` ] || [ -z `which rm` ] || [ -z `which cat` ] || [ -z `which chmod` ] || [ -z `which ln` ] || [ -z `which grep` ] || [ -z `which mkdir` ] || [ ! -x ${ROOTFS}/bin/readlink ]; then
++ exit 125;
++fi
++
++######################################################################
++
++TMP1=/tmp/$(mcookie)
++TMP2=/tmp/$(mcookie)
++TMP3=/tmp/$(mcookie)
++TMP4=/tmp/$(mcookie)
++
++rm -fr ${TMP1} ${TMP2} ${TMP3} ${TMP4}
++
++######################################################################
++
++cat > ${TMP1} <<'EOF'
++#!/bin/sh
++echo $0
++EOF
++
++chmod +x ${TMP1}
++ln -s ${TMP1} ${TMP2}
++
++${PROOT} ${TMP2} | grep -v ${TMP1}
++${PROOT} ${TMP2} | grep ${TMP2}
++
++######################################################################
++
++mkdir -p ${TMP3}
++cd ${TMP3}
++
++ln -s $(which true) false
++! ${PROOT} false
++
++echo "#!$(which false)" > true
++chmod a-x true
++${PROOT} true
++
++######################################################################
++
++ln -s ${ROOTFS}/bin/readlink ${TMP4}
++
++TEST1=$(${PROOT} ${ROOTFS}/bin/readlink /proc/self/exe)
++TEST2=$(${PROOT} ${TMP4} /proc/self/exe)
++
++test "${TEST1}" = "${TEST2}"
++
++######################################################################
++
++cd /
++rm -fr ${TMP1} ${TMP2} ${TMP3} ${TMP4}
diff --git a/sys-apps/proot/metadata.xml b/sys-apps/proot/metadata.xml
new file mode 100644
index 000000000000..29676beeb874
--- /dev/null
+++ b/sys-apps/proot/metadata.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer>
+ <email>pinkbyte@gentoo.org</email>
+ <name>Sergey Popov</name>
+ </maintainer>
+ <longdescription lang="en">
+ PRoot is a user-space implementation of chroot, mount --bind, and binfmt_misc.
+ This means that users don't need any privilege or setup to do things like: using an arbitrary directory as the new root filesystem,
+ making files accessible somewhere else in the filesystem hierarchy, or executing programs built for another CPU architecture
+ transparently through QEMU user-mode.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">cedric-vincent/PRoot</remote-id>
+ <maintainer>
+ <email>gentoo@reproducible.io</email>
+ <name>Cédric Vincent</name>
+ </maintainer>
+ </upstream>
+ <use>
+ <flag name="care">Build dynamic CARE binary (more info - http://reproducible.io/)</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-apps/proot/proot-3.2.2-r1.ebuild b/sys-apps/proot/proot-3.2.2-r1.ebuild
new file mode 100644
index 000000000000..393ddf068bb7
--- /dev/null
+++ b/sys-apps/proot/proot-3.2.2-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils pax-utils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch" \
+ "${FILESDIR}/${P}-build-care.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(usex care "care" "" "" "")
+}
+
+src_install() {
+ if use care; then
+ # Workaround for bug #493416
+ pax-mark -Emp src/care
+ dobin src/care
+ fi
+ # Workaround for bug #493416
+ pax-mark -Emp src/proot
+
+ dobin src/proot
+ doman doc/proot.1
+ dodoc doc/*.txt doc/articles/*
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-4.0.1.ebuild b/sys-apps/proot/proot-4.0.1.ebuild
new file mode 100644
index 000000000000..be756664b273
--- /dev/null
+++ b/sys-apps/proot/proot-4.0.1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch" \
+ "${FILESDIR}/${PN}-3.2.2-build-care.patch" \
+ "${FILESDIR}/${PN}-4.0.1-argv.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ use care && dobin src/care
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-4.0.3.ebuild b/sys-apps/proot/proot-4.0.3.ebuild
new file mode 100644
index 000000000000..9ab5a080e935
--- /dev/null
+++ b/sys-apps/proot/proot-4.0.3.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ if use care; then
+ dobin src/care
+ dodoc doc/care/*.txt
+ fi
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-5.0.0.ebuild b/sys-apps/proot/proot-5.0.0.ebuild
new file mode 100644
index 000000000000..9ab5a080e935
--- /dev/null
+++ b/sys-apps/proot/proot-5.0.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ if use care; then
+ dobin src/care
+ dodoc doc/care/*.txt
+ fi
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}
diff --git a/sys-apps/proot/proot-5.1.0.ebuild b/sys-apps/proot/proot-5.1.0.ebuild
new file mode 100644
index 000000000000..9ab5a080e935
--- /dev/null
+++ b/sys-apps/proot/proot-5.1.0.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+MY_PN="PRoot"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="User-space implementation of chroot, mount --bind, and binfmt_misc"
+HOMEPAGE="http://proot.me"
+SRC_URI="https://github.com/cedric-vincent/${MY_PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="care test"
+
+RDEPEND="care? ( app-arch/libarchive:0= )
+ sys-libs/talloc"
+DEPEND="${RDEPEND}
+ care? ( dev-libs/uthash )
+ test? ( dev-util/valgrind )"
+
+# Breaks sandbox
+RESTRICT="test"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+ epatch "${FILESDIR}/${PN}-3.2.1-makefile.patch" \
+ "${FILESDIR}/${PN}-2.3.1-lib-paths-fix.patch"
+ epatch_user
+}
+
+src_compile() {
+ # build the proot and care targets
+ emake -C src V=1 \
+ CC="$(tc-getCC)" \
+ CHECK_VERSION="true" \
+ CAREBUILDENV="ok" \
+ proot $(use care && echo "care")
+}
+
+src_install() {
+ if use care; then
+ dobin src/care
+ dodoc doc/care/*.txt
+ fi
+ dobin src/proot
+ newman doc/proot/man.1 proot.1
+ dodoc doc/proot/*.txt
+ dodoc -r doc/articles
+}
+
+src_test() {
+ emake -C tests -j1 CC="$(tc-getCC)"
+}
+
+pkg_postinst() {
+ if use care; then
+ elog "You have enabled 'care' USE flag, that builds and installs"
+ elog "dynamically linked care binary."
+ elog "Upstream does NOT support such way of building CARE,"
+ elog "it provides only prebuilt binaries."
+ elog "CARE also has known problems on hardened systems"
+ elog "Please do NOT file bugs about them to http://bugs.gentoo.org"
+ fi
+}