1 |
commit: e58f80613441945507e8af4a63b12cb60ae90111 |
2 |
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 1 08:11:57 2018 +0000 |
4 |
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 1 08:24:18 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e58f8061 |
7 |
|
8 |
app-misc/jail: Fix resolving of links (#659094 by Deniss Gaplevsky) |
9 |
|
10 |
Package-Manager: Portage-2.3.41, Repoman-2.3.9 |
11 |
|
12 |
app-misc/jail/files/jail-2.0-symlinks.patch | 11 +++++ |
13 |
app-misc/jail/files/jail-2.0-sysmacros.patch | 8 ++-- |
14 |
app-misc/jail/jail-2.0-r2.ebuild | 69 ++++++++++++++++++++++++++++ |
15 |
3 files changed, 84 insertions(+), 4 deletions(-) |
16 |
|
17 |
diff --git a/app-misc/jail/files/jail-2.0-symlinks.patch b/app-misc/jail/files/jail-2.0-symlinks.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..04b405efe30 |
20 |
--- /dev/null |
21 |
+++ b/app-misc/jail/files/jail-2.0-symlinks.patch |
22 |
@@ -0,0 +1,11 @@ |
23 |
+--- a/lib/arch/generic/functions~ 2014-07-03 11:37:33.000000000 +0200 |
24 |
++++ b/lib/arch/generic/functions 2018-07-01 10:02:57.101547309 +0200 |
25 |
+@@ -687,7 +687,7 @@ |
26 |
+ return(); |
27 |
+ } |
28 |
+ |
29 |
+- local $query = "$file_cmd $p_name"; |
30 |
++ local $query = "$file_cmd -L $p_name"; |
31 |
+ local $res = `$query`; |
32 |
+ local $line; |
33 |
+ |
34 |
|
35 |
diff --git a/app-misc/jail/files/jail-2.0-sysmacros.patch b/app-misc/jail/files/jail-2.0-sysmacros.patch |
36 |
index 4843c3d9719..ffe6a965934 100644 |
37 |
--- a/app-misc/jail/files/jail-2.0-sysmacros.patch |
38 |
+++ b/app-misc/jail/files/jail-2.0-sysmacros.patch |
39 |
@@ -1,5 +1,5 @@ |
40 |
---- src/generic_helpers.c |
41 |
-+++ src/generic_helpers.c |
42 |
+--- a/src/generic_helpers.c |
43 |
++++ b/src/generic_helpers.c |
44 |
@@ -27,6 +27,7 @@ |
45 |
|
46 |
#include <stdlib.h> |
47 |
@@ -8,8 +8,8 @@ |
48 |
#include <sys/types.h> |
49 |
#include <sys/stat.h> |
50 |
#include <unistd.h> |
51 |
---- src/terminal_helpers.c |
52 |
-+++ src/terminal_helpers.c |
53 |
+--- a/src/terminal_helpers.c |
54 |
++++ b/src/terminal_helpers.c |
55 |
@@ -25,6 +25,7 @@ |
56 |
|
57 |
#include <stdlib.h> |
58 |
|
59 |
diff --git a/app-misc/jail/jail-2.0-r2.ebuild b/app-misc/jail/jail-2.0-r2.ebuild |
60 |
new file mode 100644 |
61 |
index 00000000000..8243ee0dfd3 |
62 |
--- /dev/null |
63 |
+++ b/app-misc/jail/jail-2.0-r2.ebuild |
64 |
@@ -0,0 +1,69 @@ |
65 |
+# Copyright 1999-2018 Gentoo Foundation |
66 |
+# Distributed under the terms of the GNU General Public License v2 |
67 |
+ |
68 |
+EAPI=7 |
69 |
+inherit eutils flag-o-matic |
70 |
+ |
71 |
+DESCRIPTION="Builds a chroot and configures all the required files, directories and libraries" |
72 |
+HOMEPAGE="https://github.com/spiculator/jail" |
73 |
+SRC_URI="https://github.com/spiculator/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
74 |
+ |
75 |
+LICENSE="GPL-2" |
76 |
+SLOT="0" |
77 |
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" |
78 |
+IUSE="" |
79 |
+ |
80 |
+RDEPEND=" |
81 |
+ dev-lang/perl |
82 |
+ dev-util/strace |
83 |
+" |
84 |
+DEPEND="" |
85 |
+ |
86 |
+PATCHES=( |
87 |
+ "${FILESDIR}"/${PN}-1.9-gentoo.patch |
88 |
+ "${FILESDIR}"/${PN}-1.9-wrongshell.patch |
89 |
+ "${FILESDIR}"/${PN}-1.9-multiuser-rsa.patch |
90 |
+ "${FILESDIR}"/${PN}-1.9-ldflags.patch |
91 |
+ "${FILESDIR}"/${PN}-2.0-sysmacros.patch |
92 |
+ "${FILESDIR}"/${PN}-2.0-symlinks.patch #659094 |
93 |
+) |
94 |
+ |
95 |
+src_compile() { |
96 |
+ # configuration files should be installed in /etc not /usr/etc |
97 |
+ sed -i "s:\$4/etc:\${D}/etc:g" install.sh || die |
98 |
+ |
99 |
+ # the destination directory should be /usr not /usr/local |
100 |
+ sed -i -e "s:usr/local:${D}/usr:g" \ |
101 |
+ -e "s:^COPT =.*:COPT = -Wl,-z,no:g" src/Makefile || die |
102 |
+ |
103 |
+ emake -C src CC="$(tc-getCC)" CFLAGS="${CFLAGS}" |
104 |
+} |
105 |
+ |
106 |
+src_install() { |
107 |
+ emake -C src install |
108 |
+ |
109 |
+ # remove //var/tmp/portage/${P}/image//usr from files |
110 |
+ FILES=( "${D}/usr/bin/mkjailenv" |
111 |
+ "${D}/usr/bin/addjailsw" |
112 |
+ "${D}/usr/bin/addjailuser" |
113 |
+ "${D}/etc/jail.conf" |
114 |
+ "${D}/usr/lib/libjail.pm" |
115 |
+ "${D}/usr/lib/arch/generic/definitions" |
116 |
+ "${D}/usr/lib/arch/generic/functions" |
117 |
+ "${D}/usr/lib/arch/linux/definitions" |
118 |
+ "${D}/usr/lib/arch/linux/functions" |
119 |
+ "${D}/usr/lib/arch/freebsd/definitions" |
120 |
+ "${D}/usr/lib/arch/freebsd/functions" |
121 |
+ "${D}/usr/lib/arch/irix/definitions" |
122 |
+ "${D}/usr/lib/arch/irix/functions" |
123 |
+ "${D}/usr/lib/arch/solaris/definitions" |
124 |
+ "${D}/usr/lib/arch/solaris/functions" ) |
125 |
+ |
126 |
+ for f in "${FILES[@]}"; do |
127 |
+ sed -i "s:/${D}/usr:/usr:g" ${f} || die |
128 |
+ done |
129 |
+ |
130 |
+ sed -i "s:/usr/etc:/etc:" "${D}"/usr/lib/libjail.pm || die |
131 |
+ |
132 |
+ dodoc doc/{CHANGELOG,INSTALL,README,SECURITY,VERSION} |
133 |
+} |