summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2018-07-01 10:11:57 +0200
committerPacho Ramos <pacho@gentoo.org>2018-07-01 10:24:18 +0200
commite58f80613441945507e8af4a63b12cb60ae90111 (patch)
tree57dd7f7bbf724cb7819b5e7a529f633031a0cd8c /app-misc/jail
parentwww-servers/thin: add ruby24 (diff)
downloadgentoo-e58f80613441945507e8af4a63b12cb60ae90111.tar.gz
gentoo-e58f80613441945507e8af4a63b12cb60ae90111.tar.bz2
gentoo-e58f80613441945507e8af4a63b12cb60ae90111.zip
app-misc/jail: Fix resolving of links (#659094 by Deniss Gaplevsky)
Package-Manager: Portage-2.3.41, Repoman-2.3.9
Diffstat (limited to 'app-misc/jail')
-rw-r--r--app-misc/jail/files/jail-2.0-symlinks.patch11
-rw-r--r--app-misc/jail/files/jail-2.0-sysmacros.patch8
-rw-r--r--app-misc/jail/jail-2.0-r2.ebuild69
3 files changed, 84 insertions, 4 deletions
diff --git a/app-misc/jail/files/jail-2.0-symlinks.patch b/app-misc/jail/files/jail-2.0-symlinks.patch
new file mode 100644
index 000000000000..04b405efe300
--- /dev/null
+++ b/app-misc/jail/files/jail-2.0-symlinks.patch
@@ -0,0 +1,11 @@
+--- a/lib/arch/generic/functions~ 2014-07-03 11:37:33.000000000 +0200
++++ b/lib/arch/generic/functions 2018-07-01 10:02:57.101547309 +0200
+@@ -687,7 +687,7 @@
+ return();
+ }
+
+- local $query = "$file_cmd $p_name";
++ local $query = "$file_cmd -L $p_name";
+ local $res = `$query`;
+ local $line;
+
diff --git a/app-misc/jail/files/jail-2.0-sysmacros.patch b/app-misc/jail/files/jail-2.0-sysmacros.patch
index 4843c3d97194..ffe6a965934b 100644
--- a/app-misc/jail/files/jail-2.0-sysmacros.patch
+++ b/app-misc/jail/files/jail-2.0-sysmacros.patch
@@ -1,5 +1,5 @@
---- src/generic_helpers.c
-+++ src/generic_helpers.c
+--- a/src/generic_helpers.c
++++ b/src/generic_helpers.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
@@ -8,8 +8,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
---- src/terminal_helpers.c
-+++ src/terminal_helpers.c
+--- a/src/terminal_helpers.c
++++ b/src/terminal_helpers.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
diff --git a/app-misc/jail/jail-2.0-r2.ebuild b/app-misc/jail/jail-2.0-r2.ebuild
new file mode 100644
index 000000000000..8243ee0dfd3c
--- /dev/null
+++ b/app-misc/jail/jail-2.0-r2.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit eutils flag-o-matic
+
+DESCRIPTION="Builds a chroot and configures all the required files, directories and libraries"
+HOMEPAGE="https://github.com/spiculator/jail"
+SRC_URI="https://github.com/spiculator/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+IUSE=""
+
+RDEPEND="
+ dev-lang/perl
+ dev-util/strace
+"
+DEPEND=""
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.9-gentoo.patch
+ "${FILESDIR}"/${PN}-1.9-wrongshell.patch
+ "${FILESDIR}"/${PN}-1.9-multiuser-rsa.patch
+ "${FILESDIR}"/${PN}-1.9-ldflags.patch
+ "${FILESDIR}"/${PN}-2.0-sysmacros.patch
+ "${FILESDIR}"/${PN}-2.0-symlinks.patch #659094
+)
+
+src_compile() {
+ # configuration files should be installed in /etc not /usr/etc
+ sed -i "s:\$4/etc:\${D}/etc:g" install.sh || die
+
+ # the destination directory should be /usr not /usr/local
+ sed -i -e "s:usr/local:${D}/usr:g" \
+ -e "s:^COPT =.*:COPT = -Wl,-z,no:g" src/Makefile || die
+
+ emake -C src CC="$(tc-getCC)" CFLAGS="${CFLAGS}"
+}
+
+src_install() {
+ emake -C src install
+
+ # remove //var/tmp/portage/${P}/image//usr from files
+ FILES=( "${D}/usr/bin/mkjailenv"
+ "${D}/usr/bin/addjailsw"
+ "${D}/usr/bin/addjailuser"
+ "${D}/etc/jail.conf"
+ "${D}/usr/lib/libjail.pm"
+ "${D}/usr/lib/arch/generic/definitions"
+ "${D}/usr/lib/arch/generic/functions"
+ "${D}/usr/lib/arch/linux/definitions"
+ "${D}/usr/lib/arch/linux/functions"
+ "${D}/usr/lib/arch/freebsd/definitions"
+ "${D}/usr/lib/arch/freebsd/functions"
+ "${D}/usr/lib/arch/irix/definitions"
+ "${D}/usr/lib/arch/irix/functions"
+ "${D}/usr/lib/arch/solaris/definitions"
+ "${D}/usr/lib/arch/solaris/functions" )
+
+ for f in "${FILES[@]}"; do
+ sed -i "s:/${D}/usr:/usr:g" ${f} || die
+ done
+
+ sed -i "s:/usr/etc:/etc:" "${D}"/usr/lib/libjail.pm || die
+
+ dodoc doc/{CHANGELOG,INSTALL,README,SECURITY,VERSION}
+}