1 |
commit: 679620acd428f4e3a5348536bcea8a6bd6304ebf |
2 |
Author: David Seifert <soap <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 5 16:19:27 2021 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 5 16:19:27 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=679620ac |
7 |
|
8 |
sys-libs/libcap: add live ebuild |
9 |
|
10 |
Signed-off-by: David Seifert <soap <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libcap/libcap-9999.ebuild | 92 ++++++++++++++++++++++++++++++++++++++ |
13 |
1 file changed, 92 insertions(+) |
14 |
|
15 |
diff --git a/sys-libs/libcap/libcap-9999.ebuild b/sys-libs/libcap/libcap-9999.ebuild |
16 |
new file mode 100644 |
17 |
index 000000000000..969f9d0aaacb |
18 |
--- /dev/null |
19 |
+++ b/sys-libs/libcap/libcap-9999.ebuild |
20 |
@@ -0,0 +1,92 @@ |
21 |
+# Copyright 1999-2021 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=7 |
25 |
+ |
26 |
+inherit multilib-minimal toolchain-funcs pam usr-ldscript |
27 |
+ |
28 |
+if [[ ${PV} == *9999 ]]; then |
29 |
+ inherit git-r3 |
30 |
+ EGIT_REPO_URI="https://git.kernel.org/pub/scm/libs/libcap/libcap.git" |
31 |
+else |
32 |
+ SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz" |
33 |
+ |
34 |
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux" |
35 |
+fi |
36 |
+ |
37 |
+DESCRIPTION="POSIX 1003.1e capabilities" |
38 |
+HOMEPAGE="https://sites.google.com/site/fullycapable/" |
39 |
+ |
40 |
+# it's available under either of the licenses |
41 |
+LICENSE="|| ( GPL-2 BSD )" |
42 |
+SLOT="0" |
43 |
+IUSE="pam static-libs tools" |
44 |
+ |
45 |
+# While the build system optionally uses gperf, we don't DEPEND on it because |
46 |
+# the build automatically falls back when it's unavailable. #604802 |
47 |
+PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )" |
48 |
+DEPEND="${PDEPEND} |
49 |
+ sys-kernel/linux-headers" |
50 |
+BDEPEND=" |
51 |
+ sys-apps/diffutils |
52 |
+ tools? ( dev-lang/go )" |
53 |
+ |
54 |
+QA_FLAGS_IGNORED="sbin/captree" # go binaries don't use LDFLAGS |
55 |
+ |
56 |
+src_prepare() { |
57 |
+ default |
58 |
+ multilib_copy_sources |
59 |
+} |
60 |
+ |
61 |
+run_emake() { |
62 |
+ local args=( |
63 |
+ AR="$(tc-getAR)" |
64 |
+ CC="$(tc-getCC)" |
65 |
+ OBJCOPY="$(tc-getOBJCOPY)" |
66 |
+ RANLIB="$(tc-getRANLIB)" |
67 |
+ exec_prefix="${EPREFIX}" |
68 |
+ lib_prefix="${EPREFIX}/usr" |
69 |
+ lib="$(get_libdir)" |
70 |
+ prefix="${EPREFIX}/usr" |
71 |
+ PAM_CAP="$(usex pam yes no)" |
72 |
+ DYNAMIC=yes |
73 |
+ GOLANG="$(multilib_native_usex tools yes no)" |
74 |
+ ) |
75 |
+ emake "${args[@]}" "$@" |
76 |
+} |
77 |
+ |
78 |
+src_configure() { |
79 |
+ tc-export_build_env BUILD_CC |
80 |
+ multilib-minimal_src_configure |
81 |
+} |
82 |
+ |
83 |
+multilib_src_compile() { |
84 |
+ run_emake |
85 |
+} |
86 |
+ |
87 |
+multilib_src_test() { |
88 |
+ run_emake test |
89 |
+} |
90 |
+ |
91 |
+multilib_src_install() { |
92 |
+ # no configure, needs explicit install line #444724#c3 |
93 |
+ run_emake DESTDIR="${D}" install |
94 |
+ |
95 |
+ gen_usr_ldscript -a cap |
96 |
+ gen_usr_ldscript -a psx |
97 |
+ if ! use static-libs ; then |
98 |
+ rm "${ED}"/usr/$(get_libdir)/lib{cap,psx}.a || die |
99 |
+ fi |
100 |
+ |
101 |
+ # install pam plugins ourselves |
102 |
+ rm -rf "${ED}"/usr/$(get_libdir)/security || die |
103 |
+ |
104 |
+ if use pam ; then |
105 |
+ dopammod pam_cap/pam_cap.so |
106 |
+ dopamsecurity '' pam_cap/capability.conf |
107 |
+ fi |
108 |
+} |
109 |
+ |
110 |
+multilib_src_install_all() { |
111 |
+ dodoc CHANGELOG README doc/capability.notes |
112 |
+} |