summaryrefslogtreecommitdiff
path: root/sys-apps/minijail
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-25 11:50:47 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-25 11:50:47 +0000
commitd42200bec37eef2a7478d88988ff00addd0a9202 (patch)
tree10394660b3cbe4b50173c06950b31302cd25d0d1 /sys-apps/minijail
parent580f05ea8f512d11e23e8da80177d27835cbdbbc (diff)
gentoo resync : 25.01.2020
Diffstat (limited to 'sys-apps/minijail')
-rw-r--r--sys-apps/minijail/Manifest3
-rw-r--r--sys-apps/minijail/files/minijail-12-makefile.patch41
-rw-r--r--sys-apps/minijail/minijail-12.ebuild77
3 files changed, 121 insertions, 0 deletions
diff --git a/sys-apps/minijail/Manifest b/sys-apps/minijail/Manifest
index c6a03c01f9ad..e48d218cd49d 100644
--- a/sys-apps/minijail/Manifest
+++ b/sys-apps/minijail/Manifest
@@ -1,4 +1,7 @@
+AUX minijail-12-makefile.patch 1511 BLAKE2B 74b620f44ffa3a3f82771d10dfff5999f223613ee734a38be770ac91e128c3e4f26cbbdff197a0636cb8c3b094c70fbed08443560bea095407736327f9d485ac SHA512 c727ff4752345f08d89dab5bc7489793763bf459bc169f132a285bc40c1d8e1e40d366bc8336e35c5362f4e4b999ec9d07db2b3bcd5f394954dae54cb533515a
AUX minijail-9-makefile.patch 1589 BLAKE2B d2b253f769e79c179fce51b858ce9b7b70dec806e7f3f330928e5befc7a6fc12e4a09e5fca0e29404badbab2f389bb4c9385d0ecc555610d3b45df272c5d34e1 SHA512 38a3afe8c17f591e8172ad6725f04d5a898ee3ec3a97ee99c6118c1c12189061906a442b95243e7907031c194f0477c3bdbc6d96df4923b43487f60ededa403b
+DIST minijail-12.tar.gz 157030 BLAKE2B 55a1bb2aeb31290c211da8b8322672abadab7a2729b0afd6eafce9854a51320a2515bedc54864debc7ede6e437607dad8532ae76c14828d6c4f4265fec404dbe SHA512 feb829fc113f0041b9ab25e845560af47408f3d5f0704cdf756d0b8162ae7aae331c350908c3b17a4a5593ffa7326044f222a35e6794471cd5ed60173b2befa2
DIST minijail-9.tar.gz 118700 BLAKE2B 7d2959d5dd71bd9d8d8a0b7c278dab66771740f73acec20f19502da33990ca858796b4734676ffedc404cef72eee8c419c669ba7092ac00cbafa2e410564aba2 SHA512 6d05fbe8615f410e8314045d11f7a3638f563f3311f7d52b5a0c47cad8692d11b0a7db4fbb45141b56453a9beb0de7683d58e5298f0a27029aa017539bb48717
+EBUILD minijail-12.ebuild 1797 BLAKE2B d28cef527341f960f5d58ea0578ac7a10fe000413bf5e12739ddb6c0b107c8dabb287c282e20798352471ca0e121d0cb7c42918ca70201e474997a229ce7980d SHA512 eb3f04b4b5a586306e6364887e4d728a1dc661db11b639d1c9134a0286f42322d2769c921bdaa04a3fbf11bb0d1ede780cce73ac6e48af571331bd01c31ae11a
EBUILD minijail-9.ebuild 1691 BLAKE2B 09b11a3b5c8a898c8d4b76daaa79a70cd83fc64860349df50e03f4460170b772d94ac8c7f0e4cc5f9a4fbe1f4bb9f9be9e21e83a61e7ce94ca1a2626e87dc16d SHA512 c6a0292b154fe643628b82858ccd5e6e3ebb1d82fa3744d2463286d78b15fd249e678d941031c404d7158286dab3c141d6775c4018fb87835358e0c612a7eddb
MISC metadata.xml 301 BLAKE2B d5f9282d8aabde609103f044f2d3716395795229a7651e0c0f34df9c3995593633cf13d515fddda390096403bd1f52ca286a9c6f8fe287fb5af575b333b2146d SHA512 e88cdf0fc48e93ef15d4048015fde4939955cc48a437c9cc4f8f5053e3af4524206ee4ee3b11067fce6f0defc511484b1ba2b4afde82c9684d9df4e4750b9599
diff --git a/sys-apps/minijail/files/minijail-12-makefile.patch b/sys-apps/minijail/files/minijail-12-makefile.patch
new file mode 100644
index 000000000000..10d97197bb02
--- /dev/null
+++ b/sys-apps/minijail/files/minijail-12-makefile.patch
@@ -0,0 +1,41 @@
+--- a/Makefile
++++ b/Makefile
+@@ -46,9 +46,9 @@ ifeq ($(USE_SYSTEM_GTEST),no)
+ GTEST_CXXFLAGS := -std=gnu++14
+ GTEST_LIBS := gtest.a
+ else
+-GTEST_CXXFLAGS := $(shell gtest-config --cxxflags 2>/dev/null || \
++GTEST_CXXFLAGS ?= $(shell gtest-config --cxxflags 2>/dev/null || \
+ echo "-pthread")
+-GTEST_LIBS := $(shell gtest-config --libs 2>/dev/null || \
++GTEST_LIBS ?= $(shell gtest-config --libs 2>/dev/null || \
+ echo "-lgtest -pthread -lpthread")
+ endif
+
+@@ -73,6 +73,7 @@ clean: CLEAN(minijail0)
+
+
+ CC_LIBRARY(libminijail.so): LDLIBS += -lcap
++CC_LIBRARY(libminijail.so): LDFLAGS += -Wl,-soname,libminijail.so
+ CC_LIBRARY(libminijail.so): $(CORE_OBJECT_FILES)
+ clean: CLEAN(libminijail.so)
+
+@@ -91,6 +92,7 @@ TEST(CXX_BINARY(libminijail_unittest)): CC_LIBRARY(libminijailpreload.so)
+
+
+ CC_LIBRARY(libminijailpreload.so): LDLIBS += -lcap -ldl
++CC_LIBRARY(libminijailpreload.so): LDFLAGS += -Wl,-soname,libminijail.so
+ CC_LIBRARY(libminijailpreload.so): libminijailpreload.o $(CORE_OBJECT_FILES)
+ clean: CLEAN(libminijailpreload.so)
+
+--- a/common.mk
++++ b/common.mk
+@@ -323,7 +323,7 @@ COMMON_CFLAGS := -Wall -Wunused -Wno-unused-parameter -Werror -Wformat=2 \
+ -fno-strict-aliasing $(SSP_CFLAGS) -O1
+ CXXFLAGS += $(COMMON_CFLAGS) $(COMMON_CFLAGS-$(CXXDRIVER)) -std=gnu++14
+ CFLAGS += $(COMMON_CFLAGS) $(COMMON_CFLAGS-$(CDRIVER)) -std=gnu11
+-CPPFLAGS += -D_FORTIFY_SOURCE=2
++CPPFLAGS +=
+
+ # Enable large file support.
+ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
diff --git a/sys-apps/minijail/minijail-12.ebuild b/sys-apps/minijail/minijail-12.ebuild
new file mode 100644
index 000000000000..bf20c5f832a1
--- /dev/null
+++ b/sys-apps/minijail/minijail-12.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+inherit linux-info toolchain-funcs
+
+DESCRIPTION="helper binary and library for sandboxing & restricting privs of service"
+HOMEPAGE="https://android.googlesource.com/platform/external/minijail"
+
+# Use GitHub mirror as Gitiles doesn't generate stable tarballs.
+SRC_URI="https://github.com/google/${PN}/archive/linux-v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+seccomp test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="sys-libs/libcap-ng:="
+DEPEND="${RDEPEND}
+ test? (
+ virtual/pkgconfig
+ >=dev-cpp/gtest-1.8.0:=
+ )"
+
+S="${WORKDIR}/${PN}-linux-v${PV}"
+
+PATCHES=(
+ "${FILESDIR}/minijail-12-makefile.patch"
+)
+
+pkg_pretend() {
+ local CONFIG_CHECK="~NAMESPACES ~UTS_NS ~IPC_NS ~USER_NS ~PID_NS ~NET_NS
+ ~SECCOMP ~SECCOMP_FILTER ~CGROUPS"
+ check_extra_config
+}
+
+src_configure() {
+ export LIBDIR="/usr/$(get_libdir)"
+ export USE_seccomp="$(usex seccomp)"
+ export USE_SYSTEM_GTEST=yes
+ if use test; then
+ export GTEST_CXXFLAGS="$($(tc-getPKG_CONFIG) --cflags gtest_main)"
+ export GTEST_LIBS="$($(tc-getPKG_CONFIG) --libs gtest_main)"
+ else
+ export GTEST_CXXFLAGS='' GTEST_LIBS=''
+ fi
+ export VERBOSE=1
+}
+
+src_compile() {
+ tc-env_build emake all parse_seccomp_policy
+}
+
+src_test() {
+ GTEST_FILTER="-NamespaceTest.test_tmpfs_userns:NamespaceTest.test_namespaces" \
+ tc-env_build emake tests
+}
+
+src_install() {
+ dosbin minijail0
+ dolib.so libminijail{,preload}.so
+ dobin parse_seccomp_policy
+
+ doman minijail0.[15]
+ dodoc README.md
+
+ local include_dir="/usr/include"
+
+ "${S}"/platform2_preinstall.sh "${PV}" "${include_dir}"
+ insinto "/usr/$(get_libdir)/pkgconfig"
+ doins libminijail.pc
+
+ insinto "${include_dir}"
+ doins libminijail.h scoped_minijail.h
+}