commit:     d017c72405862aae4b02f07b05303fd274b4ddd8
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  3 22:40:00 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri Sep  3 22:40:00 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d017c724

sys-libs/libcap: add 2.56

Closes: https://github.com/gentoo/gentoo/pull/22205
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 profiles/arch/alpha/package.use.mask               |  4 +
 profiles/arch/hppa/package.use.mask                |  4 +
 profiles/arch/ia64/package.use.mask                |  4 +
 profiles/arch/powerpc/package.use.mask             |  4 +
 profiles/arch/sparc/package.use.mask               |  4 +
 sys-libs/libcap/Manifest                           |  1 +
 .../files/libcap-2.56-build-system-fixes.patch     | 42 ++++++++++
 sys-libs/libcap/libcap-2.56.ebuild                 | 89 ++++++++++++++++++++++
 sys-libs/libcap/metadata.xml                       | 17 +++--
 9 files changed, 162 insertions(+), 7 deletions(-)

diff --git a/profiles/arch/alpha/package.use.mask 
b/profiles/arch/alpha/package.use.mask
index 28ca080220d..dfb3c9ca024 100644
--- a/profiles/arch/alpha/package.use.mask
+++ b/profiles/arch/alpha/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# David Seifert <s...@gentoo.org> (2021-09-04)
+# dev-lang/go not keyworded here
+sys-libs/libcap tools
+
 # Marek Szuba <mare...@gentoo.org> (2021-08-17)
 # net-wireless/rtl-sdr not keyworded here
 sys-apps/rng-tools rtlsdr

diff --git a/profiles/arch/hppa/package.use.mask 
b/profiles/arch/hppa/package.use.mask
index 5a86f34feaf..2c2966e181b 100644
--- a/profiles/arch/hppa/package.use.mask
+++ b/profiles/arch/hppa/package.use.mask
@@ -4,6 +4,10 @@
 # NOTE: When masking a USE flag due to missing keywords, please file a keyword
 # request bug for the hppa arch.
 
+# David Seifert <s...@gentoo.org> (2021-09-04)
+# dev-lang/go not keyworded here
+sys-libs/libcap tools
+
 # Marek Szuba <mare...@gentoo.org> (2021-08-11)
 # dev-ruby/tty-editor not keyworded here yet (Bug #807685)
 app-text/htmltidy test

diff --git a/profiles/arch/ia64/package.use.mask 
b/profiles/arch/ia64/package.use.mask
index 6927332333a..7574729ef7d 100644
--- a/profiles/arch/ia64/package.use.mask
+++ b/profiles/arch/ia64/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# David Seifert <s...@gentoo.org> (2021-09-04)
+# dev-lang/go not keyworded here
+sys-libs/libcap tools
+
 # Marek Szuba <mare...@gentoo.org> (2021-08-17)
 # net-wireless/rtl-sdr not keyworded here
 sys-apps/rng-tools rtlsdr

diff --git a/profiles/arch/powerpc/package.use.mask 
b/profiles/arch/powerpc/package.use.mask
index 63fa67cb553..ec0d3456c1f 100644
--- a/profiles/arch/powerpc/package.use.mask
+++ b/profiles/arch/powerpc/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# David Seifert <s...@gentoo.org> (2021-09-04)
+# dev-lang/go not keyworded here
+sys-libs/libcap tools
+
 # Thomas Deutschmann <whi...@gentoo.org> (2021-08-04)
 # Requires net-misc/modemmanager[qmi], mask until keyworded
 sys-apps/fwupd modemmanager

diff --git a/profiles/arch/sparc/package.use.mask 
b/profiles/arch/sparc/package.use.mask
index 92fbe638651..e592b1c4a5b 100644
--- a/profiles/arch/sparc/package.use.mask
+++ b/profiles/arch/sparc/package.use.mask
@@ -1,6 +1,10 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
+# David Seifert <s...@gentoo.org> (2021-09-04)
+# dev-lang/go not keyworded here
+sys-libs/libcap tools
+
 # Marek Szuba <mare...@gentoo.org> (2021-08-11)
 # dev-ruby/tty-editor not keyworded here yet (Bug #807685)
 app-text/htmltidy test

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index fb0ba3e19b1..594609befb8 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -2,3 +2,4 @@ DIST libcap-2.49.tar.xz 139568 BLAKE2B 
5746dcdf2a737e747450bd50a701ee8543277b17b
 DIST libcap-2.51.tar.xz 145440 BLAKE2B 
9f004e28891fbbb3552016e2e9250eab38935b6b40ad9e808a64ab07eecb52c5fa9032caed0baab719df8afe9aeec98403d10b05336bebe15a50b64020e5afc2
 SHA512 
3b4a97ef864a2ce2f87056ebc282223b0c71ca71c539744dc629ffe7905ca5fdde937ca70c34ec84406fe54863d39abf32775818a5e5a6fdf3069706b1723a88
 DIST libcap-2.52.tar.xz 158720 BLAKE2B 
0696ae00a485df019f5441efe1d71676ddf294f1116e7fc3f352ad0595f9d4830f2e4fac1f98353016de36a4866f9d018f53419970ccd114c6df0faa556bcea3
 SHA512 
95d9e0f81fd955c42a0f299163a4402f00e9e7a2b392dfbabe613abea4babba2730576e76c9b612665a0bb8bd88aa98bf28ea3eb5582b5c06cd1137594a59893
 DIST libcap-2.55.tar.xz 166164 BLAKE2B 
75136d228c6b42086698aea79e774bed37d43aa0692154026708ddd27275fc611a702dafd0ad76b16b32d8006f863f7ca3aff1f645c74f1649ad5ae9b77db47c
 SHA512 
b7c682b45800d96a86d12489855f643e8166849606e50ffae45da143790304858d677fe0d19067a9e09f5fa711548aee4bd7a6fda662a87ea2cc35c9455e8a2c
+DIST libcap-2.56.tar.xz 167056 BLAKE2B 
97d1cf6196bcbcb48e335f810385ca2b36e7c3e234a1f99172fe00419ecc4af7337f208e107f012e5ffd46c1b6207a9d4515f3a677a924dd26ed8a699a080a5a
 SHA512 
8a5c6c99458b0996c9599e00648e99e53b222ddf429535c475099c1af02796331b864fbfae767c16cfb7f2899cf0beaf74095e26a52988361ea1400f012f30c8

diff --git a/sys-libs/libcap/files/libcap-2.56-build-system-fixes.patch 
b/sys-libs/libcap/files/libcap-2.56-build-system-fixes.patch
new file mode 100644
index 00000000000..bd026b15632
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.56-build-system-fixes.patch
@@ -0,0 +1,42 @@
+From 35989c0ae0073009b1f9c0338410162a11d399fc Mon Sep 17 00:00:00 2001
+From: David Seifert <s...@gentoo.org>
+Date: Fri, 3 Sep 2021 09:41:26 +0200
+Subject: [PATCH] Build system fixes
+
+Summary:
+- Always respect CFLAGS
+- Only build tests conditionally (when we're going to run them)
+---
+ Make.Rules | 3 ++-
+ Makefile   | 1 -
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 3eeb098..04dd8dc 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -81,7 +81,8 @@ WARNINGS=-Wall -Wwrite-strings -Wpointer-arith -Wcast-qual 
-Wcast-align \
+         -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs       \
+       -Winline -Wshadow
+ COPTS ?= -O2
+-CFLAGS ?= $(COPTS) $(WARNINGS) $(DEBUG)
++CFLAGS ?= $(COPTS) $(DEBUG)
++CFLAGS += $(WARNINGS)
+ CPPFLAGS += -Dlinux $(DEFINES) $(LIBCAP_INCLUDES)
+ LDFLAGS ?= # -g
+ 
+diff --git a/Makefile b/Makefile
+index 1c195dd..3f71b12 100644
+--- a/Makefile
++++ b/Makefile
+@@ -17,7 +17,6 @@ ifeq ($(GOLANG),yes)
+       $(MAKE) -C go $@
+       rm -f cap/go.sum
+ endif
+-      $(MAKE) -C tests $@
+       $(MAKE) -C progs $@
+       $(MAKE) -C doc $@
+       $(MAKE) -C kdebug $@
+-- 
+2.33.0
+

diff --git a/sys-libs/libcap/libcap-2.56.ebuild 
b/sys-libs/libcap/libcap-2.56.ebuild
new file mode 100644
index 00000000000..ef97a68d05a
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.56.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal toolchain-funcs pam usr-ldscript
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="https://sites.google.com/site/fullycapable/";
+SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz";
+
+# it's available under either of the licenses
+LICENSE="|| ( GPL-2 BSD )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv 
~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="pam static-libs tools"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable.  #604802
+PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${PDEPEND}
+       sys-kernel/linux-headers"
+BDEPEND="tools? ( dev-lang/go )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-2.56-build-system-fixes.patch
+       "${FILESDIR}"/${PN}-2.38-no_perl.patch
+       "${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+)
+
+QA_FLAGS_IGNORED="sbin/captree" # go binaries don't use LDFLAGS
+
+src_prepare() {
+       default
+       multilib_copy_sources
+}
+
+run_emake() {
+       local args=(
+               AR="$(tc-getAR)"
+               CC="$(tc-getCC)"
+               OBJCOPY="$(tc-getOBJCOPY)"
+               RANLIB="$(tc-getRANLIB)"
+               exec_prefix="${EPREFIX}"
+               lib_prefix="${EPREFIX}/usr"
+               lib="$(get_libdir)"
+               prefix="${EPREFIX}/usr"
+               PAM_CAP="$(usex pam yes no)"
+               DYNAMIC=yes
+               GOLANG="$(multilib_native_usex tools yes no)"
+       )
+       emake "${args[@]}" "$@"
+}
+
+src_configure() {
+       tc-export_build_env BUILD_CC
+       multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+       run_emake
+}
+
+multilib_src_test() {
+       run_emake test
+}
+
+multilib_src_install() {
+       # no configure, needs explicit install line #444724#c3
+       run_emake DESTDIR="${D}" install
+
+       gen_usr_ldscript -a cap
+       gen_usr_ldscript -a psx
+       if ! use static-libs ; then
+               rm "${ED}"/usr/$(get_libdir)/lib{cap,psx}.a || die
+       fi
+
+       # install pam plugins ourselves
+       rm -rf "${ED}"/usr/$(get_libdir)/security || die
+
+       if use pam ; then
+               dopammod pam_cap/pam_cap.so
+               dopamsecurity '' pam_cap/capability.conf
+       fi
+}
+
+multilib_src_install_all() {
+       dodoc CHANGELOG README doc/capability.notes
+}

diff --git a/sys-libs/libcap/metadata.xml b/sys-libs/libcap/metadata.xml
index d10107478bd..c00b296dee9 100644
--- a/sys-libs/libcap/metadata.xml
+++ b/sys-libs/libcap/metadata.xml
@@ -1,11 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
-<maintainer type="project">
-       <email>base-sys...@gentoo.org</email>
-       <name>Gentoo Base System</name>
-</maintainer>
-<upstream>
-       <remote-id type="cpe">cpe:/a:libcap:libcap</remote-id>
-</upstream>
+       <maintainer type="project">
+               <email>base-sys...@gentoo.org</email>
+               <name>Gentoo Base System</name>
+       </maintainer>
+       <use>
+               <flag name="tools">Install captree, which requires 
<pkg>dev-lang/go</pkg></flag>
+       </use>
+       <upstream>
+               <remote-id type="cpe">cpe:/a:libcap:libcap</remote-id>
+       </upstream>
 </pkgmetadata>

Reply via email to