Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
Date: Sat, 11 Sep 2021 23:52:15
Message-Id: 1631404323.db1bc68b2aeba14deebf61e49174fde9612868df.sam@gentoo
1 commit: db1bc68b2aeba14deebf61e49174fde9612868df
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 11 23:51:44 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 11 23:52:03 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db1bc68b
7
8 sys-libs/libcap: add 2.57
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 sys-libs/libcap/Manifest | 1 +
13 .../libcap/files/libcap-2.57-parallel-make.patch | 29 +++++++
14 sys-libs/libcap/libcap-2.57.ebuild | 90 ++++++++++++++++++++++
15 3 files changed, 120 insertions(+)
16
17 diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
18 index 9e6e421def2..fcbd62a9743 100644
19 --- a/sys-libs/libcap/Manifest
20 +++ b/sys-libs/libcap/Manifest
21 @@ -1,2 +1,3 @@
22 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
23 DIST libcap-2.56.tar.xz 167056 BLAKE2B 97d1cf6196bcbcb48e335f810385ca2b36e7c3e234a1f99172fe00419ecc4af7337f208e107f012e5ffd46c1b6207a9d4515f3a677a924dd26ed8a699a080a5a SHA512 8a5c6c99458b0996c9599e00648e99e53b222ddf429535c475099c1af02796331b864fbfae767c16cfb7f2899cf0beaf74095e26a52988361ea1400f012f30c8
24 +DIST libcap-2.57.tar.xz 167740 BLAKE2B e0c004f3d11caf824d907315e6102707bb34c0ef3e9d430f23c191d711f073267ef6dc44463e2ce8041b8d13658b0c20560f7f3c6387f770ff9e66b81ff9f5d3 SHA512 5c70b3c6a1248ca0de92538614f0d0d516d72f6f25b135c92738c377b67533662e6fd6b0b61cb051ec99f406387d3334fcc7ddb54789626e4c387bcf46ebffbf
25
26 diff --git a/sys-libs/libcap/files/libcap-2.57-parallel-make.patch b/sys-libs/libcap/files/libcap-2.57-parallel-make.patch
27 new file mode 100644
28 index 00000000000..612044bcfb0
29 --- /dev/null
30 +++ b/sys-libs/libcap/files/libcap-2.57-parallel-make.patch
31 @@ -0,0 +1,29 @@
32 +https://git.kernel.org/pub/scm/libs/libcap/libcap.git/patch/?id=893c134ca5cd6fc33ac19d8dbb9d985067d2e66b
33 +
34 +From: "Andrew G. Morgan" <morgan@××××××.org>
35 +Date: Fri, 10 Sep 2021 16:11:57 -0700
36 +Subject: Another missing dependency for make -j13
37 +
38 +One more missing dependency for pam_cap.so building.
39 +
40 +Signed-off-by: Andrew G. Morgan <morgan@××××××.org>
41 +--- a/pam_cap/Makefile
42 ++++ b/pam_cap/Makefile
43 +@@ -19,7 +19,11 @@ install: all
44 + execable.o: execable.c ../libcap/execable.h ../libcap/loader.txt
45 + $(CC) $(CFLAGS) $(CPPFLAGS) -DLIBCAP_VERSION=\"libcap-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" -c execable.c -o $@
46 +
47 +-pam_cap.so: pam_cap.o execable.o pam_cap_linkopts
48 ++LIBCAP:
49 ++ $(MAKE) -C ../libcap all
50 ++ touch $@
51 ++
52 ++pam_cap.so: pam_cap.o execable.o pam_cap_linkopts LIBCAP
53 + cat pam_cap_linkopts | xargs -e $(LD) $(LDFLAGS) -o $@ pam_cap.o execable.o $(LIBCAPLIB)
54 +
55 + # Some distributions force link everything at compile time, and don't
56 +@@ -83,3 +87,4 @@ sudotest: test_pam_cap
57 +
58 + clean:
59 + rm -f *.o *.so testlink lazylink.so test_pam_cap pam_cap_linkopts *~
60 ++ rm -f LIBCAP
61
62 diff --git a/sys-libs/libcap/libcap-2.57.ebuild b/sys-libs/libcap/libcap-2.57.ebuild
63 new file mode 100644
64 index 00000000000..ca29aacc3bb
65 --- /dev/null
66 +++ b/sys-libs/libcap/libcap-2.57.ebuild
67 @@ -0,0 +1,90 @@
68 +# Copyright 1999-2021 Gentoo Authors
69 +# Distributed under the terms of the GNU General Public License v2
70 +
71 +EAPI=7
72 +
73 +inherit multilib-minimal toolchain-funcs pam usr-ldscript
74 +
75 +DESCRIPTION="POSIX 1003.1e capabilities"
76 +HOMEPAGE="https://sites.google.com/site/fullycapable/"
77 +SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
78 +
79 +# it's available under either of the licenses
80 +LICENSE="|| ( GPL-2 BSD )"
81 +SLOT="0"
82 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
83 +IUSE="pam static-libs tools"
84 +
85 +# While the build system optionally uses gperf, we don't DEPEND on it because
86 +# the build automatically falls back when it's unavailable. #604802
87 +PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
88 +DEPEND="${PDEPEND}
89 + sys-kernel/linux-headers"
90 +BDEPEND="tools? ( dev-lang/go )"
91 +
92 +PATCHES=(
93 + # Backported patch, drop on > 2.57
94 + "${FILESDIR}"/${PN}-2.57-parallel-make.patch
95 + "${FILESDIR}"/${PN}-2.38-no_perl.patch
96 + "${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
97 +)
98 +
99 +QA_FLAGS_IGNORED="sbin/captree" # go binaries don't use LDFLAGS
100 +
101 +src_prepare() {
102 + default
103 + multilib_copy_sources
104 +}
105 +
106 +run_emake() {
107 + local args=(
108 + AR="$(tc-getAR)"
109 + CC="$(tc-getCC)"
110 + OBJCOPY="$(tc-getOBJCOPY)"
111 + RANLIB="$(tc-getRANLIB)"
112 + exec_prefix="${EPREFIX}"
113 + lib_prefix="${EPREFIX}/usr"
114 + lib="$(get_libdir)"
115 + prefix="${EPREFIX}/usr"
116 + PAM_CAP="$(usex pam yes no)"
117 + DYNAMIC=yes
118 + GOLANG="$(multilib_native_usex tools yes no)"
119 + )
120 + emake "${args[@]}" "$@"
121 +}
122 +
123 +src_configure() {
124 + tc-export_build_env BUILD_CC
125 + multilib-minimal_src_configure
126 +}
127 +
128 +multilib_src_compile() {
129 + run_emake
130 +}
131 +
132 +multilib_src_test() {
133 + run_emake test
134 +}
135 +
136 +multilib_src_install() {
137 + # no configure, needs explicit install line #444724#c3
138 + run_emake DESTDIR="${D}" install
139 +
140 + gen_usr_ldscript -a cap
141 + gen_usr_ldscript -a psx
142 + if ! use static-libs ; then
143 + rm "${ED}"/usr/$(get_libdir)/lib{cap,psx}.a || die
144 + fi
145 +
146 + # install pam plugins ourselves
147 + rm -rf "${ED}"/usr/$(get_libdir)/security || die
148 +
149 + if use pam ; then
150 + dopammod pam_cap/pam_cap.so
151 + dopamsecurity '' pam_cap/capability.conf
152 + fi
153 +}
154 +
155 +multilib_src_install_all() {
156 + dodoc CHANGELOG README doc/capability.notes
157 +}