public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2016-03-30 23:48 Mike Frysinger
  0 siblings, 0 replies; 22+ messages in thread
From: Mike Frysinger @ 2016-03-30 23:48 UTC (permalink / raw
  To: gentoo-commits

commit:     1f6bf821bf9d9e9182c3fc086ecad319da61d591
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 30 23:15:53 2016 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Wed Mar 30 23:47:43 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f6bf821

sys-libs/libcap: drop old <2.24 versions

 sys-libs/libcap/Manifest                           |   1 -
 .../files/libcap-2.22-build-system-fixes.patch     | 171 ---------------------
 sys-libs/libcap/libcap-2.22-r2.ebuild              |  69 ---------
 3 files changed, 241 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index ba24d96..265935c 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,2 @@
-DIST libcap-2.22.tar.bz2 60051 SHA256 73ebbd4877b5f69dd28b72098e510c5b318bc480f8201c4061ac98b78c04050f SHA512 d4e070cfed7dbf416c949e79fbfbfcde2da4705d4f55527b18482c9959b80fea2841bf70f317fa5e620e13a75a8e5da69f94304b8e54195f2d0492f14d342339 WHIRLPOOL 000e3c76e83366423efc0e935c6191496c0e9bf1cc559babdbeea74c8c81009e883985c5f1c739b4fb1744522e09bda253f6012b7e52284f291eabeaf20f6a88
 DIST libcap-2.24.tar.xz 63412 SHA256 cee4568f78dc851d726fc93f25f4ed91cc223b1fe8259daa4a77158d174e6c65 SHA512 c062bab936d651a50efa66dcfa51ab3ce4b0881195d23bb32142b5c8044d30e0e2152f3497844ce90c04f909aeffe2d41203efff41972e38758dcca7b653884b WHIRLPOOL bb7a9d8d3b999ad289962ebdc8b9eff87e25bd744a86ee4717e999738cb5a556a51826d0f0cbfc628629948fa8355d5d972208910d6c1c99bdf66a673b6f1cc8
 DIST libcap-2.25.tar.xz 63672 SHA256 693c8ac51e983ee678205571ef272439d83afe62dd8e424ea14ad9790bc35162 SHA512 c3ab491885292adc171cde542b96f1295e84132febb50112a46575c3bde3a3eb6fcf733f7a756b4b656e013c0abb5ed6571db24799f8c0b23d8f759f992864f9 WHIRLPOOL 294a399224997bb3e6187103f364dee2d64f5ab633068361c56fcb4a496abf24d0283b35d4c48df193d36f9372540a3afe853627429ba7f7caba7e9826e1a13d

diff --git a/sys-libs/libcap/files/libcap-2.22-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.22-build-system-fixes.patch
deleted file mode 100644
index 888c089..0000000
--- a/sys-libs/libcap/files/libcap-2.22-build-system-fixes.patch
+++ /dev/null
@@ -1,171 +0,0 @@
-From 5540f3c2a3bd70ebc8140b74ac5a0aecdbc53234 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sun, 16 Nov 2008 09:10:31 -0500
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-	- allow toolchain vars to be set via environment
-		- CC / BUILD_CC / AR / RANLIB
-		- CFLAGS / CPPFLAGS / LDFLAGS
-	- split CPPFLAGS out of CFLAGS
-	- break -fPIC out of global CFLAGS and only use where needed
-	- use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- Make.Rules       |   25 +++++++++++++------------
- libcap/Makefile  |   11 ++++++-----
- pam_cap/Makefile |    8 +++++---
- progs/Makefile   |    2 +-
- 4 files changed, 25 insertions(+), 21 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 011aa14..6e432a6 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -44,27 +44,28 @@ MINOR=19
- 
- # Compilation specifics
- 
--KERNEL_HEADERS := $(topdir)/libcap/include
--IPATH += -fPIC -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
--
--CC := gcc
--CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
--BUILD_CC := $(CC)
--BUILD_CFLAGS := $(CFLAGS) $(IPATH)
--AR := ar
--RANLIB := ranlib
-+CC ?= gcc
-+CFLAGS ?= -O2
-+BUILD_CC ?= $(CC)
-+BUILD_CFLAGS ?= $(CFLAGS)
-+AR ?= ar
-+RANLIB ?= ranlib
- DEBUG = -g #-DDEBUG
- WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-         -Wstrict-prototypes -Wmissing-prototypes \
-         -Wnested-externs -Winline -Wshadow
- LD=$(CC) -Wl,-x -shared
--LDFLAGS := #-g
-+LDFLAGS ?= #-g
- 
--SYSTEM_HEADERS = /usr/include
-+KERNEL_HEADERS = $(topdir)/libcap/include
-+LIBCAP_CPPFLAGS = -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
-+CPPFLAGS += $(LIBCAP_CPPFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
- INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 4762c60..cf99523 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -16,7 +16,7 @@ FILES=cap_alloc cap_proc cap_extint cap_flag cap_text
- # no support).
- ifeq ($(LIBATTR),yes)
- FILES += cap_file
--LDFLAGS += -lattr
-+LDLIBS += -lattr
- endif
- 
- INCLS=libcap.h cap_names.h $(INCS)
-@@ -24,6 +24,7 @@ OBJS=$(addsuffix .o, $(FILES))
- MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-+CFLAGS += -fPIC
- 
- all: $(MINLIBNAME) $(STALIBNAME)
- 
-@@ -33,7 +34,7 @@ INCLUDE_GPERF_OUTPUT = -include $(GPERF_OUTPUT)
- endif
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -50,15 +51,15 @@ $(STALIBNAME): $(OBJS)
- 	$(RANLIB) $@
- 
- $(MINLIBNAME): $(OBJS)
--	$(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^
-+	$(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJLIBNAME) -o $@ $^ $(LDLIBS)
- 	ln -sf $(MINLIBNAME) $(MAJLIBNAME)
- 	ln -sf $(MAJLIBNAME) $(LIBNAME)
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(INCDIR)/sys
-@@ -77,7 +77,7 @@ install: all
- 	install -m 0644 include/sys/capability.h $(INCDIR)/sys
- 	mkdir -p -m 0755 $(LIBDIR)
- 	install -m 0644 $(STALIBNAME) $(LIBDIR)/$(STALIBNAME)
--	install -m 0644 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
-+	install -m 0755 $(MINLIBNAME) $(LIBDIR)/$(MINLIBNAME)
- 	ln -sf $(MINLIBNAME) $(LIBDIR)/$(MAJLIBNAME)
- 	ln -sf $(MAJLIBNAME) $(LIBDIR)/$(LIBNAME)
- ifeq ($(FAKEROOT),)
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index 9ca5bef..bdae933 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -9,6 +9,8 @@ include ../Make.Rules
- # written (and you know why it fails), email me and explain why. Thanks!
- LDLIBS += -L../libcap -lcap
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testcompile
- 
-@@ -17,13 +19,13 @@ install: all
- 	install -m 0755 pam_cap.so $(LIBDIR)/security
- 
- pam_cap.so: pam_cap.o
--	$(LD) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
-+	$(LD) $(CFLAGS) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- testcompile: test.c pam_cap.o
--	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
- 
- clean:
- 	rm -f *.o *.so testcompile *~
-diff --git a/progs/Makefile b/progs/Makefile
-index ef51dc6..c261f57 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -22,7 +22,7 @@ $(BUILD): %: %.o
- 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(SBINDIR)
--- 
-1.7.4.rc2
-

diff --git a/sys-libs/libcap/libcap-2.22-r2.ebuild b/sys-libs/libcap/libcap-2.22-r2.ebuild
deleted file mode 100644
index 6fb3f81..0000000
--- a/sys-libs/libcap/libcap-2.22-r2.ebuild
+++ /dev/null
@@ -1,69 +0,0 @@
-# Copyright 1999-2015 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-EAPI="4"
-
-inherit eutils multilib multilib-minimal toolchain-funcs pam
-
-DESCRIPTION="POSIX 1003.1e capabilities"
-HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html"
-SRC_URI="mirror://gentoo/${P}.tar.bz2"
-
-# 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 s390 sh sparc x86 ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux"
-IUSE="pam"
-
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
-	pam? ( virtual/pam )"
-DEPEND="${RDEPEND}
-	sys-kernel/linux-headers"
-
-src_prepare() {
-	epatch "${FILESDIR}"/${PN}-2.22-build-system-fixes.patch
-	epatch "${FILESDIR}"/${PN}-2.22-no-perl.patch
-	epatch "${FILESDIR}"/${PN}-2.20-ignore-RAISE_SETFCAP-install-failures.patch
-	epatch "${FILESDIR}"/${PN}-2.21-include.patch
-
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	if multilib_is_native_abi && use pam; then
-		pam=yes
-	else
-		pam=no
-	fi
-
-	sed -i \
-		-e "/^PAM_CAP/s:=.*:=${pam}:" \
-		-e '/^DYNAMIC/s:=.*:=yes:' \
-		-e "/^lib=/s:=.*:=/usr/$(get_libdir):" \
-		Make.Rules
-}
-
-multilib_src_compile() {
-	tc-export_build_env BUILD_CC
-	tc-export AR CC RANLIB
-
-	default
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	emake install DESTDIR="${ED}"
-
-	gen_usr_ldscript -a cap
-
-	rm -rf "${ED}"/usr/$(get_libdir)/security
-	if multilib_is_native_abi && 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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2017-02-01 14:42 Tony Vroon
  0 siblings, 0 replies; 22+ messages in thread
From: Tony Vroon @ 2017-02-01 14:42 UTC (permalink / raw
  To: gentoo-commits

commit:     3e68f63c6dd1309dff74786854d3ceabb8476582
Author:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
AuthorDate: Wed Feb  1 14:41:53 2017 +0000
Commit:     Tony Vroon <chainsaw <AT> gentoo <DOT> org>
CommitDate: Wed Feb  1 14:41:53 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e68f63c

sys-libs/libcap: Patch & research by Mike "floppym" Gilbert to allow compilation against gperf 3.1; ported to no-perl Makefile by me. Closes bug #604802 by dwfreed.

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 sys-libs/libcap/files/libcap-2.25-gperf.patch | 17 +++++++++++++++++
 sys-libs/libcap/libcap-2.25.ebuild            |  1 +
 2 files changed, 18 insertions(+)

diff --git a/sys-libs/libcap/files/libcap-2.25-gperf.patch b/sys-libs/libcap/files/libcap-2.25-gperf.patch
new file mode 100644
index 00000000..aa67a19
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.25-gperf.patch
@@ -0,0 +1,17 @@
+diff -uNr libcap-2.25.ORIG/libcap/Makefile libcap-2.25/libcap/Makefile
+--- libcap-2.25.ORIG/libcap/Makefile	2017-02-01 09:58:34.966642226 +0000
++++ libcap-2.25/libcap/Makefile	2017-02-01 10:01:49.943651936 +0000
+@@ -44,11 +44,12 @@
+ 	./_makenames > cap_names.h
+ 
+ $(GPERF_OUTPUT): cap_names.list.h
+-	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; \
++	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%%\n"; \
+ 	$(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
+ 	gperf \
+ 		--ignore-case \
+ 		--language=ANSI-C \
++		--includes \
+ 		--readonly \
+ 		--null-strings \
+ 		--global-table \

diff --git a/sys-libs/libcap/libcap-2.25.ebuild b/sys-libs/libcap/libcap-2.25.ebuild
index f523bd1..ad5bb12 100644
--- a/sys-libs/libcap/libcap-2.25.ebuild
+++ b/sys-libs/libcap/libcap-2.25.ebuild
@@ -26,6 +26,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.22-no-perl.patch
 	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
 	"${FILESDIR}"/${PN}-2.21-include.patch
+	"${FILESDIR}"/${PN}-2.25-gperf.patch
 )
 
 src_prepare() {


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2019-05-03 16:10 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2019-05-03 16:10 UTC (permalink / raw
  To: gentoo-commits

commit:     17f3370ebf047a59d0e0e47ecf92d6bfd4331dab
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Fri May  3 13:55:45 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Fri May  3 16:10:43 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17f3370e

sys-libs/libcap: Removed old.

Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                        |  1 -
 sys-libs/libcap/files/libcap-2.22-no-perl.patch | 54 -----------------
 sys-libs/libcap/files/libcap-2.25-gperf.patch   | 20 -------
 sys-libs/libcap/libcap-2.25.ebuild              | 78 -------------------------
 4 files changed, 153 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 51cf86f2078..0c08e136c4b 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,2 @@
-DIST libcap-2.25.tar.xz 63672 BLAKE2B 205790dea83f15b585e5151814ea520ab1545661d18fa57f36e8c8e597a7c0f0ff1d7b5ccffc36e313eb28606f1e71678233a06896e29cb28e5559b190dd47ed SHA512 c3ab491885292adc171cde542b96f1295e84132febb50112a46575c3bde3a3eb6fcf733f7a756b4b656e013c0abb5ed6571db24799f8c0b23d8f759f992864f9
 DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219bbb9524f979ac65e472bf932db496acf93984fa77fe42e71d45b85cd603ca461a071fb4742526dfbc5f66eb SHA512 1c2d59f007226405a924950b2c2090393527e06f0692a84e6463e33915a070df61a9070b8f30a624d5630ddd39290eac117e5d440577d1edd48510195b9d12f0
 DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6

diff --git a/sys-libs/libcap/files/libcap-2.22-no-perl.patch b/sys-libs/libcap/files/libcap-2.22-no-perl.patch
deleted file mode 100644
index 9c29e7efbf3..00000000000
--- a/sys-libs/libcap/files/libcap-2.22-no-perl.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From fdd0f3b207785711663f48e0dd3414d90d1f2e86 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Sat, 12 Nov 2011 14:24:08 -0500
-Subject: [PATCH] use awk/sed instead of perl for creating header files
-
-More systems should have awk/sed than perl.
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
----
- libcap/Makefile |   20 ++++++++++++++++----
- 1 files changed, 16 insertions(+), 4 deletions(-)
-
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 4762c60..68845e0 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -24,6 +24,8 @@ OBJS=$(addsuffix .o, $(FILES))
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
- CFLAGS += -fPIC
-+AWK = awk
-+SED = sed
- 
- all: $(MINLIBNAME) $(STALIBNAME)
- 
-@@ -39,11 +41,21 @@ cap_names.h: _makenames
- 	./_makenames > cap_names.h
- 
- $(GPERF_OUTPUT): cap_names.list.h
--	perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
-+	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; \
-+	$(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
-+	gperf \
-+		--ignore-case \
-+		--language=ANSI-C \
-+		--readonly \
-+		--null-strings \
-+		--global-table \
-+		--hash-function-name=__cap_hash_name \
-+		--lookup-function-name="__cap_lookup_name" \
-+		-c -t -m20 $(INDENT) > $@
- 
--cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
--	@echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
--	perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(KERNEL_HEADERS)/linux/capability.h | fgrep -v 0x > $@
-+cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
-+	@echo "=> making $@ from $<"
-+	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
- 
- $(STALIBNAME): $(OBJS)
- 	$(AR) rcs $@ $^
--- 
-1.7.6.1
-

diff --git a/sys-libs/libcap/files/libcap-2.25-gperf.patch b/sys-libs/libcap/files/libcap-2.25-gperf.patch
deleted file mode 100644
index 86e930f6a44..00000000000
--- a/sys-libs/libcap/files/libcap-2.25-gperf.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-update gperf call to work with gperf-3.1
-
-https://bugs.gentoo.org/604802
-
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -44,11 +44,12 @@
- 	./_makenames > cap_names.h
- 
- $(GPERF_OUTPUT): cap_names.list.h
--	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, unsigned int);\n%}\n%%\n"; \
-+	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%%\n"; \
- 	$(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
- 	gperf \
- 		--ignore-case \
- 		--language=ANSI-C \
-+		--includes \
- 		--readonly \
- 		--null-strings \
- 		--global-table \

diff --git a/sys-libs/libcap/libcap-2.25.ebuild b/sys-libs/libcap/libcap-2.25.ebuild
deleted file mode 100644
index c8bff991d30..00000000000
--- a/sys-libs/libcap/libcap-2.25.ebuild
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=5
-
-inherit eutils multilib multilib-minimal toolchain-funcs pam
-
-DESCRIPTION="POSIX 1003.1e capabilities"
-HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html"
-SRC_URI="mirror://kernel/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 s390 sh sparc x86 ~amd64-linux ~x86-linux"
-IUSE="pam static-libs"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
-	pam? ( virtual/pam )"
-DEPEND="${RDEPEND}
-	sys-kernel/linux-headers"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.25-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.22-no-perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-	"${FILESDIR}"/${PN}-2.25-gperf.patch
-)
-
-src_prepare() {
-	epatch "${PATCHES[@]}"
-	multilib_copy_sources
-}
-
-multilib_src_configure() {
-	local pam
-	if multilib_is_native_abi && use pam; then
-		pam=yes
-	else
-		pam=no
-	fi
-
-	sed -i \
-		-e "/^PAM_CAP/s:=.*:=${pam}:" \
-		-e '/^DYNAMIC/s:=.*:=yes:' \
-		-e '/^lib_prefix=/s:=.*:=$(prefix):' \
-		-e "/^lib=/s:=.*:=$(get_libdir):" \
-		Make.Rules
-}
-
-multilib_src_compile() {
-	tc-export AR CC RANLIB
-	local BUILD_CC
-	tc-export_build_env BUILD_CC
-
-	default
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	emake install DESTDIR="${ED}"
-
-	gen_usr_ldscript -a cap
-	use static-libs || rm "${ED}"/usr/$(get_libdir)/libcap.a
-
-	rm -rf "${ED}"/usr/$(get_libdir)/security
-	if multilib_is_native_abi && 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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2019-12-10 10:29 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2019-12-10 10:29 UTC (permalink / raw
  To: gentoo-commits

commit:     5831cfcec76e993c6b3263a9b075e7a66bac13a4
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 10 10:28:57 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Dec 10 10:28:57 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5831cfce

sys-libs/libcap: Bump to version 2.28

Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 +
 .../files/libcap-2.28-build-system-fixes.patch     | 163 +++++++++++++++++++++
 .../libcap/files/libcap-2.28-header_location.patch |  39 +++++
 sys-libs/libcap/files/libcap-2.28-no_perl.patch    |  64 ++++++++
 sys-libs/libcap/libcap-2.28.ebuild                 |  83 +++++++++++
 5 files changed, 350 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 0c08e136c4b..6b6121dd497 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,2 +1,3 @@
 DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219bbb9524f979ac65e472bf932db496acf93984fa77fe42e71d45b85cd603ca461a071fb4742526dfbc5f66eb SHA512 1c2d59f007226405a924950b2c2090393527e06f0692a84e6463e33915a070df61a9070b8f30a624d5630ddd39290eac117e5d440577d1edd48510195b9d12f0
 DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6
+DIST libcap-2.28.tar.xz 94244 BLAKE2B 9416ca78da0b985c25682746b5f5d052835d29ed40e2ffb2f70e3e59753423c91176a41f7d32b28d75800ccfccc5ed446050985a44471f0d0cc4cc9e0ef69661 SHA512 e693ac97483f575bb8a3f4d50262082e6d0d4906f2df48a4f52db4dde21014fcdc683d40712294c7c59d1be21740276bd20b486afee53815dc49e57a9938c5eb

diff --git a/sys-libs/libcap/files/libcap-2.28-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.28-build-system-fixes.patch
new file mode 100644
index 00000000000..03455febade
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.28-build-system-fixes.patch
@@ -0,0 +1,163 @@
+From f65164072879ebb6b1fd6cc79a6b77804150bcc4 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 10 Feb 2016 09:47:27 +0100
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people.  Specifically:
+	- allow toolchain vars to be set via environment
+	- CC / BUILD_CC / AR / RANLIB
+	- CFLAGS / CPPFLAGS / LDFLAGS
+	- split CPPFLAGS out of CFLAGS
+	- break -fPIC out of global CFLAGS and only use where needed
+	- use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.24 to libcap-2.25
+Forward ported from libcap-2.25 to libcap-2.28
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules       | 28 +++++++++++++++-------------
+ libcap/Makefile  |  7 ++++---
+ pam_cap/Makefile |  8 +++++---
+ progs/Makefile   |  2 +-
+ 4 files changed, 25 insertions(+), 20 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index ab4f17c..f97021d 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -45,36 +45,38 @@ MINOR=28
+ 
+ # Compilation specifics
+ 
+-KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+-
+-CC := gcc
+-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+-BUILD_CC := $(CC)
+-BUILD_CFLAGS := $(CFLAGS) $(IPATH)
+-AR := ar
+-RANLIB := ranlib
++CC ?= gcc
++CFLAGS ?= -O2
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++AR ?= ar
++RANLIB ?= ranlib
+ DEBUG = -g #-DDEBUG
+ WARNINGS=-Wall -Wwrite-strings \
+         -Wpointer-arith -Wcast-qual -Wcast-align \
+         -Wstrict-prototypes -Wmissing-prototypes \
+         -Wnested-externs -Winline -Wshadow
+ LD=$(CC) -Wl,-x -shared
+-LDFLAGS := #-g
++LDFLAGS ?= #-g
+ LIBCAPLIB := -L$(topdir)/libcap -lcap
+ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
+ 
+ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
+ 
+-SYSTEM_HEADERS = /usr/include
++KERNEL_HEADERS = $(topdir)/libcap/include/uapi
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
++LIBCAP_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+ 
+-GOLANG := $(shell if [ -n "$(shell go version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
++GOLANG ?= $(shell if [ -n "$(shell go version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
+ ifeq ($(GOLANG),yes)
+ GOROOT := $(shell go env GOROOT)
+ GOCGO := $(shell if [ "$(shell go env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 8619972..93f43bf 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
++CFLAGS += -fPIC
+ 
+ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc $(STAPSXLIBNAME)
+ 
+@@ -39,7 +40,7 @@ libcap.pc: libcap.pc.in
+ 		$< >$@
+ 
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+ 
+ cap_names.h: _makenames
+ 	./_makenames > cap_names.h
+@@ -66,10 +67,10 @@ $(MINLIBNAME): $(CAPOBJS)
+ 	ln -sf $(MAJLIBNAME) $(LIBNAME)
+ 
+ %.o: %.c $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(INCDIR)/sys
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index 22f0f81..a1f11f6 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -3,6 +3,8 @@
+ topdir=$(shell pwd)/..
+ include ../Make.Rules
+ 
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ 	$(MAKE) testcompile
+ 
+@@ -16,13 +18,13 @@ install: all
+ # written (and you know why it fails), email me and explain why. Thanks!
+ 
+ pam_cap.so: pam_cap.o
+-	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
++	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ pam_cap.o: pam_cap.c
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ testcompile: test.c pam_cap.o
+-	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
+ 
+ clean:
+ 	rm -f *.o *.so testcompile *~
+diff --git a/progs/Makefile b/progs/Makefile
+index 0786ad3..3abbbd9 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -18,7 +18,7 @@ $(BUILD): %: %.o
+ 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ %.o: %.c $(INCS)
+-	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+-- 
+2.24.0
+

diff --git a/sys-libs/libcap/files/libcap-2.28-header_location.patch b/sys-libs/libcap/files/libcap-2.28-header_location.patch
new file mode 100644
index 00000000000..8b0678cab75
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.28-header_location.patch
@@ -0,0 +1,39 @@
+From 685fcf590a4737ddd85f085d7bccc6a9687c0023 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Tue, 10 Dec 2019 11:14:57 +0100
+Subject: [PATCH] build: Fix psx_syscall.h location
+
+---
+ tests/libcap_psx_test.c | 2 +-
+ tests/psx_test.c        | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/libcap_psx_test.c b/tests/libcap_psx_test.c
+index 4b09bb0..6eebdfa 100644
+--- a/tests/libcap_psx_test.c
++++ b/tests/libcap_psx_test.c
+@@ -1,7 +1,7 @@
+ #include <pthread.h>
+ #include <stdio.h>
+ #include <sys/capability.h>
+-#include <sys/psx_syscall.h>
++#include "../libcap/include/sys/psx_syscall.h"
+ 
+ int main(int argc, char **argv) {
+     printf("hello libcap and libpsx\n");
+diff --git a/tests/psx_test.c b/tests/psx_test.c
+index 92b99a0..a3191f1 100644
+--- a/tests/psx_test.c
++++ b/tests/psx_test.c
+@@ -2,7 +2,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <sys/prctl.h>
+-#include <sys/psx_syscall.h>
++#include "../libcap/include/sys/psx_syscall.h"
+ #include <sys/syscall.h>
+ 
+ static void say_hello_expecting(const char *title, int n, int kept) {
+-- 
+2.24.0
+

diff --git a/sys-libs/libcap/files/libcap-2.28-no_perl.patch b/sys-libs/libcap/files/libcap-2.28-no_perl.patch
new file mode 100644
index 00000000000..d8a20c2e131
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.28-no_perl.patch
@@ -0,0 +1,64 @@
+From 71ed151782c55b69ad4ce87658c0ce2ccc9c4a86 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 21 Nov 2018 11:00:54 +0100
+Subject: [PATCH] use awk/sed instead of perl for creating header files
+
+More systems should have awk/sed than perl.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.22 to libcap-2.26
+and incorporated the gperf-3.1 fix provided by Mike Gilbert
+<floppym@gentoo.org>
+Forward ported from libcap-2.26 to libcap-2.28
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ libcap/Makefile | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 93f43bf..e2e371d 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -22,6 +22,8 @@ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
+ CFLAGS += -fPIC
++AWK = awk
++SED = sed
+ 
+ all: $(MINLIBNAME) $(STALIBNAME) libcap.pc $(STAPSXLIBNAME)
+ 
+@@ -46,12 +48,22 @@ cap_names.h: _makenames
+ 	./_makenames > cap_names.h
+ 
+ $(GPERF_OUTPUT): cap_names.list.h
+-	perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+-	sed -e 's/unsigned int len/size_t len/' -i $@
+-
+-cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
+-	@echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
+-	perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(KERNEL_HEADERS)/linux/capability.h | fgrep -v 0x > $@
++	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%%\n"; \
++	$(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
++	gperf \
++		--ignore-case \
++		--language=ANSI-C \
++		--includes \
++		--readonly \
++		--null-strings \
++		--global-table \
++		--hash-function-name=__cap_hash_name \
++		--lookup-function-name="__cap_lookup_name" \
++		-c -t -m20 $(INDENT) > $@
++
++cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
++	@echo "=> making $@ from $<"
++	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
+ 
+ $(STALIBNAME): $(CAPOBJS)
+ 	$(AR) rcs $@ $^
+-- 
+2.24.0
+

diff --git a/sys-libs/libcap/libcap-2.28.ebuild b/sys-libs/libcap/libcap-2.28.ebuild
new file mode 100644
index 00000000000..ab870aa7e15
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.28.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib multilib-minimal toolchain-funcs pam usr-ldscript
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html"
+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 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="pam static-libs"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable.  #604802
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
+	pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	sys-kernel/linux-headers"
+
+# Requires test suite being run as root (via sudo)
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.28-build-system-fixes.patch
+	"${FILESDIR}"/${PN}-2.28-no_perl.patch
+	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+	"${FILESDIR}"/${PN}-2.21-include.patch
+	"${FILESDIR}"/${PN}-2.28-header_location.patch
+)
+
+src_prepare() {
+	default
+	multilib_copy_sources
+}
+
+run_emake() {
+	local args=(
+		exec_prefix="${EPREFIX}"
+		lib_prefix="${EPREFIX}/usr"
+		lib="$(get_libdir)"
+		prefix="${EPREFIX}/usr"
+		PAM_CAP="$(usex pam yes no)"
+		DYNAMIC=yes
+		GOLANG=no
+	)
+	emake "${args[@]}" "$@"
+}
+
+multilib_src_compile() {
+	tc-export AR CC RANLIB
+	local BUILD_CC
+	tc-export_build_env BUILD_CC
+
+	run_emake
+}
+
+multilib_src_install() {
+	# no configure, needs explicit install line #444724#c3
+	run_emake DESTDIR="${D}" install
+
+	gen_usr_ldscript -a cap
+	if ! use static-libs ; then
+		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
+	fi
+
+	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
+		rm -r "${ED}"/usr/$(get_libdir)/security || die
+	fi
+
+	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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-03-04 10:04 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-03-04 10:04 UTC (permalink / raw
  To: gentoo-commits

commit:     aa17aa2db175c1733ce9c7d5effd3c444c74c9fd
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Mar  4 09:37:19 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Mar  4 10:03:55 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa17aa2d

sys-libs/libcap: Bump to version 2.33

Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 +
 .../files/libcap-2.33-build-system-fixes.patch     | 214 +++++++++++++++++++++
 sys-libs/libcap/libcap-2.33.ebuild                 |  84 ++++++++
 3 files changed, 299 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 240d90775b2..f4dcbecfade 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -2,3 +2,4 @@ DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219b
 DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6
 DIST libcap-2.31.tar.xz 99236 BLAKE2B c4cd5e2e105cc05b2aee2ee6435b9a28c06a91dee5cdd1baf6d94f625d89e134ad35a4493ffdfda7f3ffb0b41aa6e75a20cd705bfe9df570e82d0b6ea4e484e1 SHA512 9f0ef665a52e77356d6028abdead3c3cf75f97406ac09d60a33500222428c581d8aaa7d25d7eb9051d9c73ebfaefa7af5581430e1ecc1dfea73398a3ac7cbc3a
 DIST libcap-2.32.tar.xz 99708 BLAKE2B cbd4676ca9ada4c4dd6dee5137c0bb16f23af5d9a224c81b476c19326f87352fb06e2e123c9431558cd22f91032064ed6de8407d5861728dd141be16957363db SHA512 e2325cf0a1d0509c49336f7e5760e5b339c889cdde8d6c359197aed711423f951ad390a2a3dd4943b03afe152ad8502ea1db9d7ef247148b93e93a3c4895a019
+DIST libcap-2.33.tar.xz 111280 BLAKE2B 9a34b6e871c6175da5ef665ab7a5ed8b9889f598875f58a6e0b7aef9b6b2737f2a85bb0a6e259a730a3fcea3b8ebbec793b52ee5dec7d11fcf236dfb2148eb83 SHA512 bb5bdc1318b524ee607026038dff7c1c621f1710fa07f8c341b1f86761cb086d32b93d7a12dbe4256d4440ee984143db8659d2679330e221ce184d7048c142b4

diff --git a/sys-libs/libcap/files/libcap-2.33-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.33-build-system-fixes.patch
new file mode 100644
index 00000000000..a5d96780231
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.33-build-system-fixes.patch
@@ -0,0 +1,214 @@
+From 17e5e3e7f647343dafa701b95628b5160790e2a4 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 10 Feb 2016 09:47:27 +0100
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people.  Specifically:
+	- allow toolchain vars to be set via environment
+	- CC / BUILD_CC / AR / RANLIB
+	- CFLAGS / CPPFLAGS / LDFLAGS
+	- split CPPFLAGS out of CFLAGS
+	- break -fPIC out of global CFLAGS and only use where needed
+	- use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.24 to libcap-2.25
+Forward ported from libcap-2.25 to libcap-2.28
+Forward ported from libcap-2.28 to libcap-2.29
+Forward ported from libcap-2.29 to libcap-2.33
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules       | 27 +++++++++++++++------------
+ Makefile         |  1 -
+ libcap/Makefile  |  7 ++++---
+ pam_cap/Makefile |  8 +++++---
+ progs/Makefile   |  2 +-
+ tests/Makefile   |  8 +++++---
+ 6 files changed, 30 insertions(+), 23 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 948435f..5a5184d 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -47,35 +47,38 @@ MINOR=33
+ # Compilation specifics
+ 
+ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+-
+-CC := gcc # -std=c99
+-CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+-BUILD_CC := $(CC)
+-BUILD_CFLAGS := $(CFLAGS) $(IPATH)
+-AR := ar
+-RANLIB := ranlib
++
++CC ?= gcc # -std=c99
++CFLAGS ?= -O2
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++AR ?= ar
++RANLIB ?= ranlib
+ DEBUG = -g #-DDEBUG
+ WARNINGS=-Wall -Wwrite-strings \
+         -Wpointer-arith -Wcast-qual -Wcast-align \
+         -Wstrict-prototypes -Wmissing-prototypes \
+         -Wnested-externs -Winline -Wshadow
+ LD=$(CC) -Wl,-x -shared
+-LDFLAGS := #-g
++LDFLAGS ?= #-g
+ LIBCAPLIB := -L$(topdir)/libcap -lcap
+ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
+ 
+ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
+ 
+-SYSTEM_HEADERS = /usr/include
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
++LIBCAP_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+ 
+-GOLANG := $(shell if [ -n "$(shell go version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
++GOLANG ?= $(shell if [ -n "$(shell go version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
+ ifeq ($(GOLANG),yes)
+ GOROOT := $(shell go env GOROOT)
+ GOCGO := $(shell if [ "$(shell go env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
+diff --git a/Makefile b/Makefile
+index d8cf49c..c0b10a0 100644
+--- a/Makefile
++++ b/Makefile
+@@ -16,7 +16,6 @@ endif
+ ifeq ($(GOLANG),yes)
+ 	$(MAKE) -C go $@
+ endif
+-	$(MAKE) -C tests $@
+ 	$(MAKE) -C progs $@
+ 	$(MAKE) -C doc $@
+ 	$(MAKE) -C kdebug $@
+diff --git a/libcap/Makefile b/libcap/Makefile
+index c2cb0d1..406dfe5 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
++CFLAGS += -fPIC
+ 
+ all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
+ 
+@@ -48,7 +49,7 @@ libpsx.pc: libpsx.pc.in
+ 		$< >$@
+ 
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+ 
+ cap_names.h: _makenames
+ 	./_makenames > cap_names.h
+@@ -75,10 +76,10 @@ $(MINLIBNAME): $(CAPOBJS)
+ 	ln -sf $(MAJLIBNAME) $(LIBNAME)
+ 
+ %.o: %.c $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+ cap_test: cap_test.c libcap.h
+ 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index 56604fd..2da4674 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -3,6 +3,8 @@
+ topdir=$(shell pwd)/..
+ include ../Make.Rules
+ 
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ 	$(MAKE) testlink
+ 
+@@ -16,16 +18,16 @@ install: all
+ # written (and you know why it fails), email me and explain why. Thanks!
+ 
+ pam_cap.so: pam_cap.o
+-	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
++	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ pam_cap.o: pam_cap.c
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ test_pam_cap: test_pam_cap.c pam_cap.c
+ 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
+ 
+ testlink: test.c pam_cap.o
+-	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
+ 
+ test: pam_cap.so
+ 	make testlink
+diff --git a/progs/Makefile b/progs/Makefile
+index 4c24f16..a3bbbd4 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
+ 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ %.o: %.c $(INCS)
+-	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+diff --git a/tests/Makefile b/tests/Makefile
+index 3fedeca..3645ddd 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -16,6 +16,8 @@ test: run_psx_test run_libcap_psx_test
+ 
+ sudotest: test run_libcap_launch_test run_libcap_launch_test
+ 
++CFLAGS += -fPIC
++
+ install: all
+ 
+ run_psx_test: psx_test psx_test_wrap
+@@ -23,16 +25,16 @@ run_psx_test: psx_test psx_test_wrap
+ 	./psx_test_wrap
+ 
+ psx_test: psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) -DNOWRAP $< -o $@ $(LIBPSXLIB)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -DNOWRAP $< -o $@ $(LIBPSXLIB)
+ 
+ psx_test_wrap: psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
+ 
+ run_libcap_psx_test: libcap_psx_test
+ 	./libcap_psx_test
+ 
+ libcap_psx_test: libcap_psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
+ 
+ run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
+ 	sudo ./libcap_launch_test
+-- 
+2.25.1
+

diff --git a/sys-libs/libcap/libcap-2.33.ebuild b/sys-libs/libcap/libcap-2.33.ebuild
new file mode 100644
index 00000000000..81f165bc931
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.33.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib 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 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="pam static-libs"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable.  #604802
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]
+	pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	sys-kernel/linux-headers"
+
+# Requires test suite being run as root (via sudo)
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.33-build-system-fixes.patch
+	"${FILESDIR}"/${PN}-2.28-no_perl.patch
+	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+	"${FILESDIR}"/${PN}-2.21-include.patch
+)
+
+src_prepare() {
+	default
+	multilib_copy_sources
+}
+
+run_emake() {
+	local args=(
+		exec_prefix="${EPREFIX}"
+		lib_prefix="${EPREFIX}/usr"
+		lib="$(get_libdir)"
+		prefix="${EPREFIX}/usr"
+		PAM_CAP="$(usex pam yes no)"
+		DYNAMIC=yes
+		GOLANG=no
+	)
+	emake "${args[@]}" "$@"
+}
+
+multilib_src_compile() {
+	tc-export AR CC RANLIB
+	local BUILD_CC
+	tc-export_build_env BUILD_CC
+
+	run_emake
+}
+
+multilib_src_install() {
+	# no configure, needs explicit install line #444724#c3
+	run_emake DESTDIR="${D}" install
+
+	gen_usr_ldscript -a cap
+	if ! use static-libs ; then
+		# Don't remove libpsx.a!
+		# See https://bugs.gentoo.org/703912
+		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
+	fi
+
+	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
+		rm -r "${ED}"/usr/$(get_libdir)/security || die
+	fi
+
+	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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-06-04 17:45 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-06-04 17:45 UTC (permalink / raw
  To: gentoo-commits

commit:     6b8d59e79ff1c1b53298e2b86f3cce54a4726440
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  4 17:24:46 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Jun  4 17:24:46 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6b8d59e7

sys-libs/libcap: Removed old

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 -
 .../files/libcap-2.33-build-system-fixes.patch     | 214 ---------------------
 sys-libs/libcap/libcap-2.33.ebuild                 |  85 --------
 3 files changed, 300 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 796100f8d33..6bf4782b366 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,5 +1,4 @@
 DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219bbb9524f979ac65e472bf932db496acf93984fa77fe42e71d45b85cd603ca461a071fb4742526dfbc5f66eb SHA512 1c2d59f007226405a924950b2c2090393527e06f0692a84e6463e33915a070df61a9070b8f30a624d5630ddd39290eac117e5d440577d1edd48510195b9d12f0
 DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6
-DIST libcap-2.33.tar.xz 111280 BLAKE2B 9a34b6e871c6175da5ef665ab7a5ed8b9889f598875f58a6e0b7aef9b6b2737f2a85bb0a6e259a730a3fcea3b8ebbec793b52ee5dec7d11fcf236dfb2148eb83 SHA512 bb5bdc1318b524ee607026038dff7c1c621f1710fa07f8c341b1f86761cb086d32b93d7a12dbe4256d4440ee984143db8659d2679330e221ce184d7048c142b4
 DIST libcap-2.34.tar.xz 111556 BLAKE2B 083599a899e5cc8942aedc3c932627d8608ea9cdc4eefe716e5fe2fb195276be26373697aa5bb3e84b801ccabb08f78c44f67ed82ea5c383a7c6a4d86f9e06b4 SHA512 6604aeab3de547e16e3c63e35cf41a5aaacf0cb52ffc818c822ada88595437986df731990d4b288eb72f9150de41fb8a93a6a727b936058e88b49b86352c4771
 DIST libcap-2.36.tar.xz 112612 BLAKE2B fec0997eba7af6e9df83ce91235bdd96e98d7284268f0e3d3f4ef41e7b5e0621649a90069f2a162bcecf387c156ff481be379012fc57bbbc59309b850fe879ae SHA512 0193bd1b1b6223260a629458a37db581a0ff61f1d23f439fd2bdd0e6f3acb30ce996fb0f4f86c59670183d9f42932ae1e817e44e6b64f4ff49d61ea3a4a10aa5

diff --git a/sys-libs/libcap/files/libcap-2.33-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.33-build-system-fixes.patch
deleted file mode 100644
index a5d96780231..00000000000
--- a/sys-libs/libcap/files/libcap-2.33-build-system-fixes.patch
+++ /dev/null
@@ -1,214 +0,0 @@
-From 17e5e3e7f647343dafa701b95628b5160790e2a4 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 10 Feb 2016 09:47:27 +0100
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-	- allow toolchain vars to be set via environment
-	- CC / BUILD_CC / AR / RANLIB
-	- CFLAGS / CPPFLAGS / LDFLAGS
-	- split CPPFLAGS out of CFLAGS
-	- break -fPIC out of global CFLAGS and only use where needed
-	- use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.24 to libcap-2.25
-Forward ported from libcap-2.25 to libcap-2.28
-Forward ported from libcap-2.28 to libcap-2.29
-Forward ported from libcap-2.29 to libcap-2.33
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- Make.Rules       | 27 +++++++++++++++------------
- Makefile         |  1 -
- libcap/Makefile  |  7 ++++---
- pam_cap/Makefile |  8 +++++---
- progs/Makefile   |  2 +-
- tests/Makefile   |  8 +++++---
- 6 files changed, 30 insertions(+), 23 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 948435f..5a5184d 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -47,35 +47,38 @@ MINOR=33
- # Compilation specifics
- 
- KERNEL_HEADERS := $(topdir)/libcap/include/uapi
--IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
--
--CC := gcc # -std=c99
--CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
--BUILD_CC := $(CC)
--BUILD_CFLAGS := $(CFLAGS) $(IPATH)
--AR := ar
--RANLIB := ranlib
-+
-+CC ?= gcc # -std=c99
-+CFLAGS ?= -O2
-+BUILD_CC ?= $(CC)
-+BUILD_CFLAGS ?= $(CFLAGS)
-+AR ?= ar
-+RANLIB ?= ranlib
- DEBUG = -g #-DDEBUG
- WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-         -Wstrict-prototypes -Wmissing-prototypes \
-         -Wnested-externs -Winline -Wshadow
- LD=$(CC) -Wl,-x -shared
--LDFLAGS := #-g
-+LDFLAGS ?= #-g
- LIBCAPLIB := -L$(topdir)/libcap -lcap
- LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
- 
- BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
--SYSTEM_HEADERS = /usr/include
-+LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
-+LIBCAP_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
- 
--GOLANG := $(shell if [ -n "$(shell go version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
-+GOLANG ?= $(shell if [ -n "$(shell go version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
- ifeq ($(GOLANG),yes)
- GOROOT := $(shell go env GOROOT)
- GOCGO := $(shell if [ "$(shell go env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
-diff --git a/Makefile b/Makefile
-index d8cf49c..c0b10a0 100644
---- a/Makefile
-+++ b/Makefile
-@@ -16,7 +16,6 @@ endif
- ifeq ($(GOLANG),yes)
- 	$(MAKE) -C go $@
- endif
--	$(MAKE) -C tests $@
- 	$(MAKE) -C progs $@
- 	$(MAKE) -C doc $@
- 	$(MAKE) -C kdebug $@
-diff --git a/libcap/Makefile b/libcap/Makefile
-index c2cb0d1..406dfe5 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
- MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-+CFLAGS += -fPIC
- 
- all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
- 
-@@ -48,7 +49,7 @@ libpsx.pc: libpsx.pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -75,10 +76,10 @@ $(MINLIBNAME): $(CAPOBJS)
- 	ln -sf $(MAJLIBNAME) $(LIBNAME)
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- cap_test: cap_test.c libcap.h
- 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index 56604fd..2da4674 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -3,6 +3,8 @@
- topdir=$(shell pwd)/..
- include ../Make.Rules
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testlink
- 
-@@ -16,16 +18,16 @@ install: all
- # written (and you know why it fails), email me and explain why. Thanks!
- 
- pam_cap.so: pam_cap.o
--	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- test_pam_cap: test_pam_cap.c pam_cap.c
- 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
- 
- testlink: test.c pam_cap.o
--	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
- 
- test: pam_cap.so
- 	make testlink
-diff --git a/progs/Makefile b/progs/Makefile
-index 4c24f16..a3bbbd4 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
- 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
-diff --git a/tests/Makefile b/tests/Makefile
-index 3fedeca..3645ddd 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -16,6 +16,8 @@ test: run_psx_test run_libcap_psx_test
- 
- sudotest: test run_libcap_launch_test run_libcap_launch_test
- 
-+CFLAGS += -fPIC
-+
- install: all
- 
- run_psx_test: psx_test psx_test_wrap
-@@ -23,16 +25,16 @@ run_psx_test: psx_test psx_test_wrap
- 	./psx_test_wrap
- 
- psx_test: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) -DNOWRAP $< -o $@ $(LIBPSXLIB)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -DNOWRAP $< -o $@ $(LIBPSXLIB)
- 
- psx_test_wrap: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
- 
- run_libcap_psx_test: libcap_psx_test
- 	./libcap_psx_test
- 
- libcap_psx_test: libcap_psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
- 
- run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
- 	sudo ./libcap_launch_test
--- 
-2.25.1
-

diff --git a/sys-libs/libcap/libcap-2.33.ebuild b/sys-libs/libcap/libcap-2.33.ebuild
deleted file mode 100644
index 1242ea1ed91..00000000000
--- a/sys-libs/libcap/libcap-2.33.ebuild
+++ /dev/null
@@ -1,85 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.33-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.28-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-	)
-	emake "${args[@]}" "$@"
-}
-
-multilib_src_compile() {
-	tc-export AR CC RANLIB
-	local BUILD_CC
-	tc-export_build_env BUILD_CC
-
-	run_emake
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	run_emake DESTDIR="${D}" install
-
-	gen_usr_ldscript -a cap
-	if ! use static-libs ; then
-		# Don't remove libpsx.a!
-		# See https://bugs.gentoo.org/703912
-		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
-	fi
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-07-04 21:45 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-07-04 21:45 UTC (permalink / raw
  To: gentoo-commits

commit:     1b7f28b6405b5c2595f202f02bc7045707f7430e
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Jul  4 21:44:29 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Jul  4 21:45:34 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b7f28b6

sys-libs/libcap: Bump to version 2.37

Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 +
 .../files/libcap-2.37-build-system-fixes.patch     | 215 +++++++++++++++++++++
 sys-libs/libcap/libcap-2.37.ebuild                 |  87 +++++++++
 3 files changed, 303 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 6bf4782b366..6a8f856a61d 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -2,3 +2,4 @@ DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219b
 DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6
 DIST libcap-2.34.tar.xz 111556 BLAKE2B 083599a899e5cc8942aedc3c932627d8608ea9cdc4eefe716e5fe2fb195276be26373697aa5bb3e84b801ccabb08f78c44f67ed82ea5c383a7c6a4d86f9e06b4 SHA512 6604aeab3de547e16e3c63e35cf41a5aaacf0cb52ffc818c822ada88595437986df731990d4b288eb72f9150de41fb8a93a6a727b936058e88b49b86352c4771
 DIST libcap-2.36.tar.xz 112612 BLAKE2B fec0997eba7af6e9df83ce91235bdd96e98d7284268f0e3d3f4ef41e7b5e0621649a90069f2a162bcecf387c156ff481be379012fc57bbbc59309b850fe879ae SHA512 0193bd1b1b6223260a629458a37db581a0ff61f1d23f439fd2bdd0e6f3acb30ce996fb0f4f86c59670183d9f42932ae1e817e44e6b64f4ff49d61ea3a4a10aa5
+DIST libcap-2.37.tar.xz 114800 BLAKE2B 96f9d12510266da3ca49b26859b29cbd2ea45ae676eaf54b6e3b732c0a8ab22ff8a8a4b5b2de68a7094b7d7df5d2d1664d0b5060cd25a3da05ea86ac9cdd0e75 SHA512 72d75165f78299411baa22a358dcee8169753d0a96ba97c31f24e3a25cf99fa818a00f980a99e8bc2c996a433533ae09d0401f1f3dfb03017bdc4b21d71ba848

diff --git a/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch
new file mode 100644
index 00000000000..797ac62dd1f
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch
@@ -0,0 +1,215 @@
+From 16bca4a0f45a712867992dbe30aa51558c78d424 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 5 May 2020 09:52:40 +0200
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people.  Specifically:
+        - allow toolchain vars to be set via environment
+        - CC / BUILD_CC / AR / RANLIB
+        - CFLAGS / CPPFLAGS / LDFLAGS
+        - split CPPFLAGS out of CFLAGS
+        - break -fPIC out of global CFLAGS and only use where needed
+        - use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.24 to libcap-2.25
+Forward ported from libcap-2.25 to libcap-2.28
+Forward ported from libcap-2.28 to libcap-2.29
+Forward ported from libcap-2.29 to libcap-2.33
+Forward ported from libcap-2.33 to libcap-2.34
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules       | 24 +++++++++++++-----------
+ Makefile         |  1 -
+ libcap/Makefile  |  7 ++++---
+ pam_cap/Makefile |  8 +++++---
+ progs/Makefile   |  2 +-
+ tests/Makefile   |  8 +++++---
+ 6 files changed, 28 insertions(+), 22 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index a4baa61..0e7945a 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -49,37 +49,39 @@ GOMAJOR=0
+ # Compilation specifics
+ 
+ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+ 
+-CC := $(CROSS_COMPILE)gcc
++CC ?= $(CROSS_COMPILE)gcc
+ DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+-CFLAGS := -O2 $(DEFINES)
+-BUILD_CC := $(CC)
+-BUILD_CFLAGS := -O2 $(DEFINES) $(IPATH)
+-AR := $(CROSS_COMPILE)ar
+-RANLIB := $(CROSS_COMPILE)ranlib
++CFLAGS ?= -O2 $(DEFINES)
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++AR ?= $(CROSS_COMPILE)ar
++RANLIB ?= $(CROSS_COMPILE)ranlib
+ DEBUG = -g #-DDEBUG
+ WARNINGS=-Wall -Wwrite-strings \
+         -Wpointer-arith -Wcast-qual -Wcast-align \
+         -Wstrict-prototypes -Wmissing-prototypes \
+         -Wnested-externs -Winline -Wshadow
+ LD=$(CC) -Wl,-x -shared
+-LDFLAGS := #-g
++LDFLAGS ?= #-g
+ LIBCAPLIB := -L$(topdir)/libcap -lcap
+ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
+ 
+ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
+ 
+-SYSTEM_HEADERS = /usr/include
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+ 
+ GO := go
+-GOLANG := $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
++GOLANG ?= $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
+ ifeq ($(GOLANG),yes)
+ GOROOT := $(shell $(GO) env GOROOT)
+ GOCGO := $(shell if [ "$(shell $(GO) env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
+diff --git a/Makefile b/Makefile
+index cc37029..f3e9507 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 $@
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 1ef9086..01c2bb6 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
++CFLAGS += -fPIC
+ 
+ all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
+ 
+@@ -48,7 +49,7 @@ libpsx.pc: libpsx.pc.in
+ 		$< >$@
+ 
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+ 
+ cap_names.h: _makenames
+ 	./_makenames > cap_names.h
+@@ -75,10 +76,10 @@ $(MINLIBNAME): $(CAPOBJS)
+ 	ln -sf $(MAJLIBNAME) $(LIBNAME)
+ 
+ %.o: %.c $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+ cap_test: cap_test.c libcap.h
+ 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index 56604fd..2da4674 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -3,6 +3,8 @@
+ topdir=$(shell pwd)/..
+ include ../Make.Rules
+ 
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ 	$(MAKE) testlink
+ 
+@@ -16,16 +18,16 @@ install: all
+ # written (and you know why it fails), email me and explain why. Thanks!
+ 
+ pam_cap.so: pam_cap.o
+-	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
++	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ pam_cap.o: pam_cap.c
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ test_pam_cap: test_pam_cap.c pam_cap.c
+ 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
+ 
+ testlink: test.c pam_cap.o
+-	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
+ 
+ test: pam_cap.so
+ 	make testlink
+diff --git a/progs/Makefile b/progs/Makefile
+index 076e44f..fd13351 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
+ 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ %.o: %.c $(INCS)
+-	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@
++	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+diff --git a/tests/Makefile b/tests/Makefile
+index 3fedeca..3645ddd 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -16,6 +16,8 @@ test: run_psx_test run_libcap_psx_test
+ 
+ sudotest: test run_libcap_launch_test run_libcap_launch_test
+ 
++CFLAGS += -fPIC
++
+ install: all
+ 
+ run_psx_test: psx_test psx_test_wrap
+@@ -23,16 +25,16 @@ run_psx_test: psx_test psx_test_wrap
+ 	./psx_test_wrap
+ 
+ psx_test: psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) -DNOWRAP $< -o $@ $(LIBPSXLIB)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -DNOWRAP $< -o $@ $(LIBPSXLIB)
+ 
+ psx_test_wrap: psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
+ 
+ run_libcap_psx_test: libcap_psx_test
+ 	./libcap_psx_test
+ 
+ libcap_psx_test: libcap_psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
+ 
+ run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
+ 	sudo ./libcap_launch_test
+-- 
+2.27.0
+

diff --git a/sys-libs/libcap/libcap-2.37.ebuild b/sys-libs/libcap/libcap-2.37.ebuild
new file mode 100644
index 00000000000..644015ae437
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.37.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib 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"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable.  #604802
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
+PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	${PDEPEND}
+	sys-kernel/linux-headers"
+
+# Requires test suite being run as root (via sudo)
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.37-build-system-fixes.patch
+	"${FILESDIR}"/${PN}-2.28-no_perl.patch
+	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+	"${FILESDIR}"/${PN}-2.21-include.patch
+)
+
+src_prepare() {
+	default
+	multilib_copy_sources
+}
+
+run_emake() {
+	local args=(
+		exec_prefix="${EPREFIX}"
+		lib_prefix="${EPREFIX}/usr"
+		lib="$(get_libdir)"
+		prefix="${EPREFIX}/usr"
+		PAM_CAP="$(usex pam yes no)"
+		DYNAMIC=yes
+		GOLANG=no
+	)
+	emake "${args[@]}" "$@"
+}
+
+src_configure() {
+	tc-export AR CC RANLIB
+	tc-export_build_env BUILD_CC
+	multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+	run_emake
+}
+
+multilib_src_install() {
+	# no configure, needs explicit install line #444724#c3
+	run_emake DESTDIR="${D}" install
+
+	gen_usr_ldscript -a cap
+	if ! use static-libs ; then
+		# Don't remove libpsx.a!
+		# See https://bugs.gentoo.org/703912
+		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
+	fi
+
+	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
+		rm -r "${ED}"/usr/$(get_libdir)/security || die
+	fi
+
+	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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-07-13  9:10 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-07-13  9:10 UTC (permalink / raw
  To: gentoo-commits

commit:     e4ed231090a644b84beb036be501c5f35a653947
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 13 09:09:06 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jul 13 09:09:06 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4ed2310

sys-libs/libcap: Bump to version 2.39

Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 +
 .../files/libcap-2.39-build-system-fixes.patch     | 212 +++++++++++++++++++++
 sys-libs/libcap/libcap-2.39.ebuild                 |  87 +++++++++
 3 files changed, 300 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 4970055027d..12671d79f75 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -3,3 +3,4 @@ DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c
 DIST libcap-2.36.tar.xz 112612 BLAKE2B fec0997eba7af6e9df83ce91235bdd96e98d7284268f0e3d3f4ef41e7b5e0621649a90069f2a162bcecf387c156ff481be379012fc57bbbc59309b850fe879ae SHA512 0193bd1b1b6223260a629458a37db581a0ff61f1d23f439fd2bdd0e6f3acb30ce996fb0f4f86c59670183d9f42932ae1e817e44e6b64f4ff49d61ea3a4a10aa5
 DIST libcap-2.37.tar.xz 114800 BLAKE2B 96f9d12510266da3ca49b26859b29cbd2ea45ae676eaf54b6e3b732c0a8ab22ff8a8a4b5b2de68a7094b7d7df5d2d1664d0b5060cd25a3da05ea86ac9cdd0e75 SHA512 72d75165f78299411baa22a358dcee8169753d0a96ba97c31f24e3a25cf99fa818a00f980a99e8bc2c996a433533ae09d0401f1f3dfb03017bdc4b21d71ba848
 DIST libcap-2.38.tar.xz 115752 BLAKE2B e096a54f44aac3411035a6365b74c423e1a4bdd8d1f99e53af1e2a825687a46e428f42718b485a8f40bfa59bdf7c0872d5a60599253ae774d3289677fc161890 SHA512 df92c77f29d9a92b9356f9422a55ba56855e89875b24db57f42f247a8ee0891a2e50f235805aa848c2564de33c1ecd5d68e4a9e8ea6896542cf7585ccbf677d1
+DIST libcap-2.39.tar.xz 137404 BLAKE2B b9cf7221f37e202cb200b04144e160e711c64a7b4c06cbff7787b4117542b3d1b9ace48d4cce5e03b608fa659661077da14e07578fd61ba7609765fb6e8cf37d SHA512 82cd81d67ec439a6051eaa4c20ff302bb5a667c585eada837605b122dc04d8fe6b4c619e7373af2423f3b0f4ab2258147fff309001a8f483e185b7e6578e1f98

diff --git a/sys-libs/libcap/files/libcap-2.39-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.39-build-system-fixes.patch
new file mode 100644
index 00000000000..7ae18107f9a
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.39-build-system-fixes.patch
@@ -0,0 +1,212 @@
+From cc1012914a4041eb2b5fb30057f28f62c1788662 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 5 May 2020 09:52:40 +0200
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people.  Specifically:
+        - allow toolchain vars to be set via environment
+        - CC / BUILD_CC / AR / RANLIB
+        - CFLAGS / CPPFLAGS / LDFLAGS
+        - split CPPFLAGS out of CFLAGS
+        - break -fPIC out of global CFLAGS and only use where needed
+        - use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.24 to libcap-2.25
+Forward ported from libcap-2.25 to libcap-2.28
+Forward ported from libcap-2.28 to libcap-2.29
+Forward ported from libcap-2.29 to libcap-2.33
+Forward ported from libcap-2.33 to libcap-2.34
+Forward ported from libcap-2.34 to libcap-2.37
+Forward ported from libcap-2.37 to libcap-2.39
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules       | 24 +++++++++++++-----------
+ Makefile         |  1 -
+ libcap/Makefile  |  7 ++++---
+ pam_cap/Makefile |  8 +++++---
+ progs/Makefile   |  2 +-
+ tests/Makefile   |  6 ++++--
+ 6 files changed, 27 insertions(+), 21 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 98fb9db..889798e 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -52,37 +52,39 @@ GOMAJOR=0
+ # Compilation specifics
+ 
+ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+ 
+-CC := $(CROSS_COMPILE)gcc
++CC ?= $(CROSS_COMPILE)gcc
+ DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+-CFLAGS := -O2 $(DEFINES)
+-BUILD_CC := $(CC)
+-BUILD_CFLAGS := -O2 $(DEFINES) $(IPATH)
+-AR := $(CROSS_COMPILE)ar
+-RANLIB := $(CROSS_COMPILE)ranlib
++CFLAGS ?= -O2 $(DEFINES)
++BUILD_CC ?= $(CC)
++BUILD_CFLAGS ?= $(CFLAGS)
++AR ?= $(CROSS_COMPILE)ar
++RANLIB ?= $(CROSS_COMPILE)ranlib
+ DEBUG = -g #-DDEBUG
+ WARNINGS=-Wall -Wwrite-strings \
+         -Wpointer-arith -Wcast-qual -Wcast-align \
+         -Wstrict-prototypes -Wmissing-prototypes \
+         -Wnested-externs -Winline -Wshadow
+ LD=$(CC) -Wl,-x -shared
+-LDFLAGS := #-g
++LDFLAGS ?= #-g
+ LIBCAPLIB := -L$(topdir)/libcap -lcap
+ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
+ 
+ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
+ 
+-SYSTEM_HEADERS = /usr/include
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+ 
+ GO := go
+-GOLANG := $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
++GOLANG ?= $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
+ ifeq ($(GOLANG),yes)
+ GOROOT := $(shell $(GO) env GOROOT)
+ GOCGO := $(shell if [ "$(shell $(GO) env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
+diff --git a/Makefile b/Makefile
+index e148633..b29f5f1 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 $@
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 4321c2f..3d6463d 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
++CFLAGS += -fPIC
+ 
+ all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
+ 
+@@ -48,7 +49,7 @@ libpsx.pc: libpsx.pc.in
+ 		$< >$@
+ 
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+ 
+ cap_names.h: _makenames
+ 	./_makenames > cap_names.h
+@@ -80,10 +81,10 @@ $(MINLIBNAME): $(CAPOBJS)
+ 	ln -sf $(MAJLIBNAME) $(LIBNAME)
+ 
+ %.o: %.c $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+ cap_test: cap_test.c libcap.h
+ 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index 56604fd..2da4674 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -3,6 +3,8 @@
+ topdir=$(shell pwd)/..
+ include ../Make.Rules
+ 
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ 	$(MAKE) testlink
+ 
+@@ -16,16 +18,16 @@ install: all
+ # written (and you know why it fails), email me and explain why. Thanks!
+ 
+ pam_cap.so: pam_cap.o
+-	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
++	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ pam_cap.o: pam_cap.c
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ test_pam_cap: test_pam_cap.c pam_cap.c
+ 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
+ 
+ testlink: test.c pam_cap.o
+-	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
+ 
+ test: pam_cap.so
+ 	make testlink
+diff --git a/progs/Makefile b/progs/Makefile
+index 076e44f..fd13351 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
+ 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ %.o: %.c $(INCS)
+-	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@
++	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+diff --git a/tests/Makefile b/tests/Makefile
+index bfedbc2..2b9a801 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -16,19 +16,21 @@ test: run_psx_test run_libcap_psx_test
+ 
+ sudotest: test run_libcap_launch_test run_libcap_launch_test
+ 
++CFLAGS += -fPIC
++
+ install: all
+ 
+ run_psx_test: psx_test
+ 	./psx_test
+ 
+ psx_test: psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
+ 
+ run_libcap_psx_test: libcap_psx_test
+ 	./libcap_psx_test
+ 
+ libcap_psx_test: libcap_psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
+ 
+ run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
+ 	sudo ./libcap_launch_test
+-- 
+2.27.0
+

diff --git a/sys-libs/libcap/libcap-2.39.ebuild b/sys-libs/libcap/libcap-2.39.ebuild
new file mode 100644
index 00000000000..0b09bd935e0
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.39.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib 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"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable.  #604802
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
+PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	${PDEPEND}
+	sys-kernel/linux-headers"
+
+# Requires test suite being run as root (via sudo)
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.39-build-system-fixes.patch
+	"${FILESDIR}"/${PN}-2.38-no_perl.patch
+	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+	"${FILESDIR}"/${PN}-2.21-include.patch
+)
+
+src_prepare() {
+	default
+	multilib_copy_sources
+}
+
+run_emake() {
+	local args=(
+		exec_prefix="${EPREFIX}"
+		lib_prefix="${EPREFIX}/usr"
+		lib="$(get_libdir)"
+		prefix="${EPREFIX}/usr"
+		PAM_CAP="$(usex pam yes no)"
+		DYNAMIC=yes
+		GOLANG=no
+	)
+	emake "${args[@]}" "$@"
+}
+
+src_configure() {
+	tc-export AR CC RANLIB
+	tc-export_build_env BUILD_CC
+	multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+	run_emake
+}
+
+multilib_src_install() {
+	# no configure, needs explicit install line #444724#c3
+	run_emake DESTDIR="${D}" install
+
+	gen_usr_ldscript -a cap
+	if ! use static-libs ; then
+		# Don't remove libpsx.a!
+		# See https://bugs.gentoo.org/703912
+		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
+	fi
+
+	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
+		rm -r "${ED}"/usr/$(get_libdir)/security || die
+	fi
+
+	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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-07-20 13:50 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-07-20 13:50 UTC (permalink / raw
  To: gentoo-commits

commit:     f95537cd23fcb6ca942aef63f944cfbf5525d5c5
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 20 13:49:20 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jul 20 13:50:43 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f95537cd

sys-libs/libcap: Removed old

Package-Manager: Portage-3.0.0, Repoman-2.3.23
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 -
 .../files/libcap-2.37-build-system-fixes.patch     | 216 ---------------------
 sys-libs/libcap/libcap-2.38.ebuild                 |  87 ---------
 3 files changed, 304 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 49bd96e5760..42401ce3408 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,5 +1,4 @@
 DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219bbb9524f979ac65e472bf932db496acf93984fa77fe42e71d45b85cd603ca461a071fb4742526dfbc5f66eb SHA512 1c2d59f007226405a924950b2c2090393527e06f0692a84e6463e33915a070df61a9070b8f30a624d5630ddd39290eac117e5d440577d1edd48510195b9d12f0
 DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6
-DIST libcap-2.38.tar.xz 115752 BLAKE2B e096a54f44aac3411035a6365b74c423e1a4bdd8d1f99e53af1e2a825687a46e428f42718b485a8f40bfa59bdf7c0872d5a60599253ae774d3289677fc161890 SHA512 df92c77f29d9a92b9356f9422a55ba56855e89875b24db57f42f247a8ee0891a2e50f235805aa848c2564de33c1ecd5d68e4a9e8ea6896542cf7585ccbf677d1
 DIST libcap-2.39.tar.xz 137404 BLAKE2B b9cf7221f37e202cb200b04144e160e711c64a7b4c06cbff7787b4117542b3d1b9ace48d4cce5e03b608fa659661077da14e07578fd61ba7609765fb6e8cf37d SHA512 82cd81d67ec439a6051eaa4c20ff302bb5a667c585eada837605b122dc04d8fe6b4c619e7373af2423f3b0f4ab2258147fff309001a8f483e185b7e6578e1f98
 DIST libcap-2.40.tar.xz 137832 BLAKE2B 968b8563400e6d19f72660d51057ee893d35ddd029fb095364417cf4811516424aa49bb03de803642cb68cdbaa34e055f7fb0319e789f444b6ac6f2c372d06dd SHA512 117e8dbb81cbe8974f7d3f36e89e9bec69ce81c2662f7b8edfb1753a109de028427c07d0fd77e03f2004dfff88054daf284d50dd8226c7b5f087f6dd264dd3f2

diff --git a/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch
deleted file mode 100644
index 3d0a771aa5f..00000000000
--- a/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch
+++ /dev/null
@@ -1,216 +0,0 @@
-From 33c8c4ebf725aa9950689d4dc72d2f5da30beab5 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Tue, 5 May 2020 09:52:40 +0200
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-        - allow toolchain vars to be set via environment
-        - CC / BUILD_CC / AR / RANLIB
-        - CFLAGS / CPPFLAGS / LDFLAGS
-        - split CPPFLAGS out of CFLAGS
-        - break -fPIC out of global CFLAGS and only use where needed
-        - use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.24 to libcap-2.25
-Forward ported from libcap-2.25 to libcap-2.28
-Forward ported from libcap-2.28 to libcap-2.29
-Forward ported from libcap-2.29 to libcap-2.33
-Forward ported from libcap-2.33 to libcap-2.34
-Forward ported from libcap-2.34 to libcap-2.37
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- Make.Rules       | 24 +++++++++++++-----------
- Makefile         |  1 -
- libcap/Makefile  |  7 ++++---
- pam_cap/Makefile |  8 +++++---
- progs/Makefile   |  2 +-
- tests/Makefile   |  8 +++++---
- 6 files changed, 28 insertions(+), 22 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index a4baa61..0e7945a 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -49,37 +49,39 @@ GOMAJOR=0
- # Compilation specifics
- 
- KERNEL_HEADERS := $(topdir)/libcap/include/uapi
--IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
- 
--CC := $(CROSS_COMPILE)gcc
-+CC ?= $(CROSS_COMPILE)gcc
- DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
--CFLAGS := -O2 $(DEFINES)
--BUILD_CC := $(CC)
--BUILD_CFLAGS := -O2 $(DEFINES) $(IPATH)
--AR := $(CROSS_COMPILE)ar
--RANLIB := $(CROSS_COMPILE)ranlib
-+CFLAGS ?= -O2 $(DEFINES)
-+BUILD_CC ?= $(CC)
-+BUILD_CFLAGS ?= $(CFLAGS)
-+AR ?= $(CROSS_COMPILE)ar
-+RANLIB ?= $(CROSS_COMPILE)ranlib
- DEBUG = -g #-DDEBUG
- WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-         -Wstrict-prototypes -Wmissing-prototypes \
-         -Wnested-externs -Winline -Wshadow
- LD=$(CC) -Wl,-x -shared
--LDFLAGS := #-g
-+LDFLAGS ?= #-g
- LIBCAPLIB := -L$(topdir)/libcap -lcap
- LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
- 
- BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
--SYSTEM_HEADERS = /usr/include
-+LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
- 
- GO := go
--GOLANG := $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
-+GOLANG ?= $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
- ifeq ($(GOLANG),yes)
- GOROOT := $(shell $(GO) env GOROOT)
- GOCGO := $(shell if [ "$(shell $(GO) env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
-diff --git a/Makefile b/Makefile
-index cc37029..f3e9507 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 $@
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 1ef9086..01c2bb6 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
- MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-+CFLAGS += -fPIC
- 
- all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
- 
-@@ -48,7 +49,7 @@ libpsx.pc: libpsx.pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -75,10 +76,10 @@ $(MINLIBNAME): $(CAPOBJS)
- 	ln -sf $(MAJLIBNAME) $(LIBNAME)
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- cap_test: cap_test.c libcap.h
- 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index 56604fd..2da4674 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -3,6 +3,8 @@
- topdir=$(shell pwd)/..
- include ../Make.Rules
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testlink
- 
-@@ -16,16 +18,16 @@ install: all
- # written (and you know why it fails), email me and explain why. Thanks!
- 
- pam_cap.so: pam_cap.o
--	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- test_pam_cap: test_pam_cap.c pam_cap.c
- 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
- 
- testlink: test.c pam_cap.o
--	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
- 
- test: pam_cap.so
- 	make testlink
-diff --git a/progs/Makefile b/progs/Makefile
-index 076e44f..fd13351 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
- 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
-diff --git a/tests/Makefile b/tests/Makefile
-index 3fedeca..3645ddd 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -16,6 +16,8 @@ test: run_psx_test run_libcap_psx_test
- 
- sudotest: test run_libcap_launch_test run_libcap_launch_test
- 
-+CFLAGS += -fPIC
-+
- install: all
- 
- run_psx_test: psx_test psx_test_wrap
-@@ -23,16 +25,16 @@ run_psx_test: psx_test psx_test_wrap
- 	./psx_test_wrap
- 
- psx_test: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) -DNOWRAP $< -o $@ $(LIBPSXLIB)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -DNOWRAP $< -o $@ $(LIBPSXLIB)
- 
- psx_test_wrap: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
- 
- run_libcap_psx_test: libcap_psx_test
- 	./libcap_psx_test
- 
- libcap_psx_test: libcap_psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
- 
- run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
- 	sudo ./libcap_launch_test
--- 
-2.27.0
-

diff --git a/sys-libs/libcap/libcap-2.38.ebuild b/sys-libs/libcap/libcap-2.38.ebuild
deleted file mode 100644
index 3f680c7722f..00000000000
--- a/sys-libs/libcap/libcap-2.38.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.37-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	run_emake DESTDIR="${D}" install
-
-	gen_usr_ldscript -a cap
-	if ! use static-libs ; then
-		# Don't remove libpsx.a!
-		# See https://bugs.gentoo.org/703912
-		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
-	fi
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-08-02 17:14 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-08-02 17:14 UTC (permalink / raw
  To: gentoo-commits

commit:     6792521f0d0d8c2c8e2c25e633f917c4052a457e
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  2 17:08:20 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Aug  2 17:14:08 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6792521f

sys-libs/libcap: Bump to version 2.42

Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 +
 .../files/libcap-2.42-build-system-fixes.patch     | 200 +++++++++++++++++++++
 sys-libs/libcap/libcap-2.42.ebuild                 |  87 +++++++++
 3 files changed, 288 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index fbfeb0b4a0a..01adfee40c7 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -2,3 +2,4 @@ DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219b
 DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6
 DIST libcap-2.40.tar.xz 137832 BLAKE2B 968b8563400e6d19f72660d51057ee893d35ddd029fb095364417cf4811516424aa49bb03de803642cb68cdbaa34e055f7fb0319e789f444b6ac6f2c372d06dd SHA512 117e8dbb81cbe8974f7d3f36e89e9bec69ce81c2662f7b8edfb1753a109de028427c07d0fd77e03f2004dfff88054daf284d50dd8226c7b5f087f6dd264dd3f2
 DIST libcap-2.41.tar.xz 139812 BLAKE2B 96630d2ff45e3cc40f18d0a739796bbed4c5b246a48db64b81870c6f200c6cedfed74ed0267261c3de712e9d14799015ccd1a2391e9a2a9c6d5c250864bf841f SHA512 efb778f1fee3da9ccbcc5c05d0e33dfced55a7fdfe17e1f40f121b6ec08b891c0cd95e91e5b6dce84a9cdb62d40f20efe2b26454013e1e898c25c3f9550af0f9
+DIST libcap-2.42.tar.xz 141288 BLAKE2B 1ee5c3934ba88a8127a6d96780a539d8b291e99d2e621660338fb9a9d511470bedfc3406af0bc787fda0ee0c54ce491d65a11a3e92a8da9f5d494c0931de77db SHA512 2abe2d106583a48e3ee0dbc0f82e5ec92a3209cad2abcc1690a12f33364a1dab467b624670a1cdcac0c8d12761e86d5a05bca90aa4199fee75d46e181a695d50

diff --git a/sys-libs/libcap/files/libcap-2.42-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.42-build-system-fixes.patch
new file mode 100644
index 00000000000..10959cf9339
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.42-build-system-fixes.patch
@@ -0,0 +1,200 @@
+From 8599fc87e91b7903cfb1877983615dadcbcc1b29 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Tue, 5 May 2020 09:52:40 +0200
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people.  Specifically:
+        - allow toolchain vars to be set via environment
+        - CC / BUILD_CC / AR / RANLIB
+        - CFLAGS / CPPFLAGS / LDFLAGS
+        - split CPPFLAGS out of CFLAGS
+        - break -fPIC out of global CFLAGS and only use where needed
+        - use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.24 to libcap-2.25
+Forward ported from libcap-2.25 to libcap-2.28
+Forward ported from libcap-2.28 to libcap-2.29
+Forward ported from libcap-2.29 to libcap-2.33
+Forward ported from libcap-2.33 to libcap-2.34
+Forward ported from libcap-2.34 to libcap-2.37
+Forward ported from libcap-2.37 to libcap-2.39
+Forward ported from libcap-2.39 to libcap-2.42
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules       | 12 +++++++-----
+ Makefile         |  1 -
+ libcap/Makefile  |  7 ++++---
+ pam_cap/Makefile |  8 +++++---
+ progs/Makefile   |  2 +-
+ tests/Makefile   |  6 ++++--
+ 6 files changed, 21 insertions(+), 15 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 8440e18..67fd4a6 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -52,13 +52,12 @@ GOMAJOR=0
+ # Compilation specifics
+ 
+ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+ 
+ CC ?= $(CROSS_COMPILE)gcc
+ DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+ CFLAGS ?= -O2 $(DEFINES)
+ BUILD_CC ?= $(CC)
+-BUILD_CFLAGS ?= -O2 $(DEFINES) $(IPATH)
++BUILD_CFLAGS ?= $(CFLAGS)
+ AR ?= $(CROSS_COMPILE)ar
+ RANLIB ?= $(CROSS_COMPILE)ranlib
+ DEBUG = -g #-DDEBUG
+@@ -73,16 +72,19 @@ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
+ 
+ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
+ 
+-SYSTEM_HEADERS = /usr/include
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+ 
+ GO := go
+-GOLANG := $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
++GOLANG ?= $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
+ ifeq ($(GOLANG),yes)
+ GOROOT := $(shell $(GO) env GOROOT)
+ GOCGO := $(shell if [ "$(shell $(GO) env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
+diff --git a/Makefile b/Makefile
+index 03d7748..4437468 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 $@
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 81b089e..63fe555 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
+ MAJLIBNAME=$(LIBNAME).$(VERSION)
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR)
+ GPERF_OUTPUT = _caps_output.gperf
++CFLAGS += -fPIC
+ 
+ all: $(MINLIBNAME) $(STACAPLIBNAME) pcs $(STAPSXLIBNAME)
+ 
+@@ -50,7 +51,7 @@ libpsx.pc: libpsx.pc.in
+ 		$< >$@
+ 
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+ 
+ cap_names.h: _makenames
+ 	./_makenames > cap_names.h
+@@ -82,10 +83,10 @@ $(MINLIBNAME): $(CAPOBJS)
+ 	ln -sf $(MAJLIBNAME) $(LIBNAME)
+ 
+ %.o: %.c $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+ cap_test: cap_test.c libcap.h
+ 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index 56604fd..2da4674 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -3,6 +3,8 @@
+ topdir=$(shell pwd)/..
+ include ../Make.Rules
+ 
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ 	$(MAKE) testlink
+ 
+@@ -16,16 +18,16 @@ install: all
+ # written (and you know why it fails), email me and explain why. Thanks!
+ 
+ pam_cap.so: pam_cap.o
+-	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
++	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ pam_cap.o: pam_cap.c
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ test_pam_cap: test_pam_cap.c pam_cap.c
+ 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
+ 
+ testlink: test.c pam_cap.o
+-	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
+ 
+ test: pam_cap.so
+ 	make testlink
+diff --git a/progs/Makefile b/progs/Makefile
+index 076e44f..fd13351 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
+ 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ %.o: %.c $(INCS)
+-	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@
++	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+diff --git a/tests/Makefile b/tests/Makefile
+index bfedbc2..2b9a801 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -16,19 +16,21 @@ test: run_psx_test run_libcap_psx_test
+ 
+ sudotest: test run_libcap_launch_test run_libcap_launch_test
+ 
++CFLAGS += -fPIC
++
+ install: all
+ 
+ run_psx_test: psx_test
+ 	./psx_test
+ 
+ psx_test: psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
+ 
+ run_libcap_psx_test: libcap_psx_test
+ 	./libcap_psx_test
+ 
+ libcap_psx_test: libcap_psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
+ 
+ run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
+ 	sudo ./libcap_launch_test
+-- 
+2.28.0
+

diff --git a/sys-libs/libcap/libcap-2.42.ebuild b/sys-libs/libcap/libcap-2.42.ebuild
new file mode 100644
index 00000000000..acba4de6b6c
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.42.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib 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"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable.  #604802
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
+PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	${PDEPEND}
+	sys-kernel/linux-headers"
+
+# Requires test suite being run as root (via sudo)
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.42-build-system-fixes.patch
+	"${FILESDIR}"/${PN}-2.38-no_perl.patch
+	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+	"${FILESDIR}"/${PN}-2.21-include.patch
+)
+
+src_prepare() {
+	default
+	multilib_copy_sources
+}
+
+run_emake() {
+	local args=(
+		exec_prefix="${EPREFIX}"
+		lib_prefix="${EPREFIX}/usr"
+		lib="$(get_libdir)"
+		prefix="${EPREFIX}/usr"
+		PAM_CAP="$(usex pam yes no)"
+		DYNAMIC=yes
+		GOLANG=no
+	)
+	emake "${args[@]}" "$@"
+}
+
+src_configure() {
+	tc-export AR CC RANLIB
+	tc-export_build_env BUILD_CC
+	multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+	run_emake
+}
+
+multilib_src_install() {
+	# no configure, needs explicit install line #444724#c3
+	run_emake DESTDIR="${D}" install
+
+	gen_usr_ldscript -a cap
+	if ! use static-libs ; then
+		# Don't remove libpsx.a!
+		# See https://bugs.gentoo.org/703912
+		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
+	fi
+
+	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
+		rm -r "${ED}"/usr/$(get_libdir)/security || die
+	fi
+
+	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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-09-18 10:30 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-09-18 10:30 UTC (permalink / raw
  To: gentoo-commits

commit:     8f6e5a06d3de32ce0c0de63b5b0e2718d258b65a
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 18 10:28:10 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Fri Sep 18 10:30:10 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f6e5a06

sys-libs/libcap: Removed old

Package-Manager: Portage-3.0.7, Repoman-3.0.1
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   4 -
 .../files/libcap-2.25-build-system-fixes.patch     | 153 ---------------
 sys-libs/libcap/files/libcap-2.26-no-perl.patch    |  61 ------
 .../files/libcap-2.39-build-system-fixes.patch     | 212 ---------------------
 sys-libs/libcap/libcap-2.26-r2.ebuild              |  82 --------
 sys-libs/libcap/libcap-2.27.ebuild                 |  82 --------
 sys-libs/libcap/libcap-2.41.ebuild                 |  87 ---------
 sys-libs/libcap/libcap-2.42.ebuild                 |  87 ---------
 8 files changed, 768 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index cc017ffcf49..4ddc3241c0b 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,5 +1 @@
-DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219bbb9524f979ac65e472bf932db496acf93984fa77fe42e71d45b85cd603ca461a071fb4742526dfbc5f66eb SHA512 1c2d59f007226405a924950b2c2090393527e06f0692a84e6463e33915a070df61a9070b8f30a624d5630ddd39290eac117e5d440577d1edd48510195b9d12f0
-DIST libcap-2.27.tar.xz 67780 BLAKE2B 7b58d7afdd90281771a302cd9554f067b9e3636b0c052935973d8a0d890490c3933b3513874b788a8c10e37ab5ad9cfa766408c9629b7c8562cb17bfdef87747 SHA512 e32335fd3e0d1564574acc73df7030b5b0fd98875217bffabd76f2765f1a7a6f1369f03df2ee22a1782776838784e342378c10613ea1163d53ae5055ab6a62b6
-DIST libcap-2.41.tar.xz 139812 BLAKE2B 96630d2ff45e3cc40f18d0a739796bbed4c5b246a48db64b81870c6f200c6cedfed74ed0267261c3de712e9d14799015ccd1a2391e9a2a9c6d5c250864bf841f SHA512 efb778f1fee3da9ccbcc5c05d0e33dfced55a7fdfe17e1f40f121b6ec08b891c0cd95e91e5b6dce84a9cdb62d40f20efe2b26454013e1e898c25c3f9550af0f9
-DIST libcap-2.42.tar.xz 141288 BLAKE2B 1ee5c3934ba88a8127a6d96780a539d8b291e99d2e621660338fb9a9d511470bedfc3406af0bc787fda0ee0c54ce491d65a11a3e92a8da9f5d494c0931de77db SHA512 2abe2d106583a48e3ee0dbc0f82e5ec92a3209cad2abcc1690a12f33364a1dab467b624670a1cdcac0c8d12761e86d5a05bca90aa4199fee75d46e181a695d50
 DIST libcap-2.43.tar.xz 125284 BLAKE2B bde36f8397f4adb74760eb403daa06bee1b8f45ddc253cc3c3ef1f6e95d0e4c76d0f2e6fa3335a8bc451f18ac7128c96230f6aba9ae0320fa4f9d669e7b4f715 SHA512 817add571fb2c54ad2a39974e6545b8fc8d855ecdcf2e00b2cc10e583802c49dfea2d8bca484c89ecd574fdacfc46565b51e3064a4407cf1985defb913240d45

diff --git a/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch
deleted file mode 100644
index c33fffda8d9..00000000000
--- a/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch
+++ /dev/null
@@ -1,153 +0,0 @@
-From d5a0c023a7f3deefd471d7b97ef4fa40ed374645 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 10 Feb 2016 09:47:27 +0100
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-	- allow toolchain vars to be set via environment
-	- CC / BUILD_CC / AR / RANLIB
-	- CFLAGS / CPPFLAGS / LDFLAGS
-	- split CPPFLAGS out of CFLAGS
-	- break -fPIC out of global CFLAGS and only use where needed
-	- use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.24 to libcap-2.25
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- Make.Rules       | 26 ++++++++++++++------------
- libcap/Makefile  |  7 ++++---
- pam_cap/Makefile |  8 +++++---
- progs/Makefile   |  2 +-
- 4 files changed, 24 insertions(+), 19 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 8347b26..d7196ef 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -45,28 +45,30 @@ MINOR=25
- 
- # Compilation specifics
- 
--KERNEL_HEADERS := $(topdir)/libcap/include/uapi
--IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
--
--CC := gcc
--CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
--BUILD_CC := $(CC)
--BUILD_CFLAGS := $(CFLAGS) $(IPATH)
--AR := ar
--RANLIB := ranlib
-+CC ?= gcc
-+CFLAGS ?= -O2
-+BUILD_CC ?= $(CC)
-+BUILD_CFLAGS ?= $(CFLAGS)
-+AR ?= ar
-+RANLIB ?= ranlib
- DEBUG = -g #-DDEBUG
- WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-         -Wstrict-prototypes -Wmissing-prototypes \
-         -Wnested-externs -Winline -Wshadow
- LD=$(CC) -Wl,-x -shared
--LDFLAGS := #-g
-+LDFLAGS ?= #-g
- BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
--SYSTEM_HEADERS = /usr/include
-+KERNEL_HEADERS = $(topdir)/libcap/include/uapi
-+LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
-+LIBCAP_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
-diff --git a/libcap/Makefile b/libcap/Makefile
-index d189777..b99740f 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -17,6 +17,7 @@ OBJS=$(addsuffix .o, $(FILES))
- MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-+CFLAGS += -fPIC
- 
- all: $(MINLIBNAME) $(STALIBNAME) libcap.pc
- 
-@@ -35,7 +36,7 @@ libcap.pc: libcap.pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -57,10 +58,10 @@ $(MINLIBNAME): $(OBJS)
- 	ln -sf $(MAJLIBNAME) $(LIBNAME)
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(INCDIR)/sys
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index cc32fb6..6f07b6b 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -9,6 +9,8 @@ include ../Make.Rules
- # written (and you know why it fails), email me and explain why. Thanks!
- LDLIBS += -L../libcap -lcap
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testcompile
- 
-@@ -17,13 +19,13 @@ install: all
- 	install -m 0755 pam_cap.so $(FAKEROOT)$(LIBDIR)/security
- 
- pam_cap.so: pam_cap.o
--	$(LD) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
-+	$(LD) $(CFLAGS) $(LDFLAGS) -o pam_cap.so $< $(LDLIBS)
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- testcompile: test.c pam_cap.o
--	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LDLIBS)
- 
- clean:
- 	rm -f *.o *.so testcompile *~
-diff --git a/progs/Makefile b/progs/Makefile
-index c094a24..b9f0d3f 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -19,7 +19,7 @@ $(BUILD): %: %.o
- 	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
--- 
-2.7.1
-

diff --git a/sys-libs/libcap/files/libcap-2.26-no-perl.patch b/sys-libs/libcap/files/libcap-2.26-no-perl.patch
deleted file mode 100644
index 55ee34ee71f..00000000000
--- a/sys-libs/libcap/files/libcap-2.26-no-perl.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From c15a25a61d64efe8f7b29c1e2d0a96885835ec59 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 21 Nov 2018 11:00:54 +0100
-Subject: [PATCH] use awk/sed instead of perl for creating header files
-
-More systems should have awk/sed than perl.
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.22 to libcap-2.26
-and incorporated the gperf-3.1 fix provided by Mike Gilbert
-<floppym@gentoo.org>
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- libcap/Makefile | 21 +++++++++++++++++----
- 1 file changed, 17 insertions(+), 4 deletions(-)
-
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 77b26c5..a3f0507 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -18,6 +18,8 @@ MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
- CFLAGS += -fPIC
-+AWK = awk
-+SED = sed
- 
- all: $(MINLIBNAME) $(STALIBNAME) libcap.pc
- 
-@@ -42,11 +44,22 @@ cap_names.h: _makenames
- 	./_makenames > cap_names.h
- 
- $(GPERF_OUTPUT): cap_names.list.h
--	perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
-+	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%%\n"; \
-+	$(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
-+	gperf \
-+		--ignore-case \
-+		--language=ANSI-C \
-+		--includes \
-+		--readonly \
-+		--null-strings \
-+		--global-table \
-+		--hash-function-name=__cap_hash_name \
-+		--lookup-function-name="__cap_lookup_name" \
-+		-c -t -m20 $(INDENT) > $@
- 
--cap_names.list.h: Makefile $(KERNEL_HEADERS)/linux/capability.h
--	@echo "=> making $@ from $(KERNEL_HEADERS)/linux/capability.h"
--	perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(KERNEL_HEADERS)/linux/capability.h | fgrep -v 0x > $@
-+cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
-+	@echo "=> making $@ from $<"
-+	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
- 
- $(STALIBNAME): $(OBJS)
- 	$(AR) rcs $@ $^
--- 
-2.20.0.rc0
-

diff --git a/sys-libs/libcap/files/libcap-2.39-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.39-build-system-fixes.patch
deleted file mode 100644
index 7ae18107f9a..00000000000
--- a/sys-libs/libcap/files/libcap-2.39-build-system-fixes.patch
+++ /dev/null
@@ -1,212 +0,0 @@
-From cc1012914a4041eb2b5fb30057f28f62c1788662 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Tue, 5 May 2020 09:52:40 +0200
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-        - allow toolchain vars to be set via environment
-        - CC / BUILD_CC / AR / RANLIB
-        - CFLAGS / CPPFLAGS / LDFLAGS
-        - split CPPFLAGS out of CFLAGS
-        - break -fPIC out of global CFLAGS and only use where needed
-        - use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.24 to libcap-2.25
-Forward ported from libcap-2.25 to libcap-2.28
-Forward ported from libcap-2.28 to libcap-2.29
-Forward ported from libcap-2.29 to libcap-2.33
-Forward ported from libcap-2.33 to libcap-2.34
-Forward ported from libcap-2.34 to libcap-2.37
-Forward ported from libcap-2.37 to libcap-2.39
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- Make.Rules       | 24 +++++++++++++-----------
- Makefile         |  1 -
- libcap/Makefile  |  7 ++++---
- pam_cap/Makefile |  8 +++++---
- progs/Makefile   |  2 +-
- tests/Makefile   |  6 ++++--
- 6 files changed, 27 insertions(+), 21 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 98fb9db..889798e 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -52,37 +52,39 @@ GOMAJOR=0
- # Compilation specifics
- 
- KERNEL_HEADERS := $(topdir)/libcap/include/uapi
--IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
- 
--CC := $(CROSS_COMPILE)gcc
-+CC ?= $(CROSS_COMPILE)gcc
- DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
--CFLAGS := -O2 $(DEFINES)
--BUILD_CC := $(CC)
--BUILD_CFLAGS := -O2 $(DEFINES) $(IPATH)
--AR := $(CROSS_COMPILE)ar
--RANLIB := $(CROSS_COMPILE)ranlib
-+CFLAGS ?= -O2 $(DEFINES)
-+BUILD_CC ?= $(CC)
-+BUILD_CFLAGS ?= $(CFLAGS)
-+AR ?= $(CROSS_COMPILE)ar
-+RANLIB ?= $(CROSS_COMPILE)ranlib
- DEBUG = -g #-DDEBUG
- WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-         -Wstrict-prototypes -Wmissing-prototypes \
-         -Wnested-externs -Winline -Wshadow
- LD=$(CC) -Wl,-x -shared
--LDFLAGS := #-g
-+LDFLAGS ?= #-g
- LIBCAPLIB := -L$(topdir)/libcap -lcap
- LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
- 
- BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
--SYSTEM_HEADERS = /usr/include
-+LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
- 
- GO := go
--GOLANG := $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
-+GOLANG ?= $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
- ifeq ($(GOLANG),yes)
- GOROOT := $(shell $(GO) env GOROOT)
- GOCGO := $(shell if [ "$(shell $(GO) env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
-diff --git a/Makefile b/Makefile
-index e148633..b29f5f1 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 $@
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 4321c2f..3d6463d 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
- MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-+CFLAGS += -fPIC
- 
- all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
- 
-@@ -48,7 +49,7 @@ libpsx.pc: libpsx.pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -80,10 +81,10 @@ $(MINLIBNAME): $(CAPOBJS)
- 	ln -sf $(MAJLIBNAME) $(LIBNAME)
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- cap_test: cap_test.c libcap.h
- 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index 56604fd..2da4674 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -3,6 +3,8 @@
- topdir=$(shell pwd)/..
- include ../Make.Rules
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testlink
- 
-@@ -16,16 +18,16 @@ install: all
- # written (and you know why it fails), email me and explain why. Thanks!
- 
- pam_cap.so: pam_cap.o
--	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- test_pam_cap: test_pam_cap.c pam_cap.c
- 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
- 
- testlink: test.c pam_cap.o
--	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
- 
- test: pam_cap.so
- 	make testlink
-diff --git a/progs/Makefile b/progs/Makefile
-index 076e44f..fd13351 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
- 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
-diff --git a/tests/Makefile b/tests/Makefile
-index bfedbc2..2b9a801 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -16,19 +16,21 @@ test: run_psx_test run_libcap_psx_test
- 
- sudotest: test run_libcap_launch_test run_libcap_launch_test
- 
-+CFLAGS += -fPIC
-+
- install: all
- 
- run_psx_test: psx_test
- 	./psx_test
- 
- psx_test: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
- 
- run_libcap_psx_test: libcap_psx_test
- 	./libcap_psx_test
- 
- libcap_psx_test: libcap_psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
- 
- run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
- 	sudo ./libcap_launch_test
--- 
-2.27.0
-

diff --git a/sys-libs/libcap/libcap-2.26-r2.ebuild b/sys-libs/libcap/libcap-2.26-r2.ebuild
deleted file mode 100644
index 4e7d7d29593..00000000000
--- a/sys-libs/libcap/libcap-2.26-r2.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit multilib 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.25-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.26-no-perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-	)
-	emake "${args[@]}" "$@"
-}
-
-multilib_src_compile() {
-	tc-export AR CC RANLIB
-	local BUILD_CC
-	tc-export_build_env BUILD_CC
-
-	run_emake
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	run_emake DESTDIR="${D}" install
-
-	gen_usr_ldscript -a cap
-	if ! use static-libs ; then
-		rm "${ED%/}"/usr/$(get_libdir)/libcap.a || die
-	fi
-
-	if [[ -d "${ED%/}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED%/}"/usr/$(get_libdir)/security || die
-	fi
-
-	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/libcap-2.27.ebuild b/sys-libs/libcap/libcap-2.27.ebuild
deleted file mode 100644
index 7724e169436..00000000000
--- a/sys-libs/libcap/libcap-2.27.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit multilib 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.25-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.26-no-perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-	)
-	emake "${args[@]}" "$@"
-}
-
-multilib_src_compile() {
-	tc-export AR CC RANLIB
-	local BUILD_CC
-	tc-export_build_env BUILD_CC
-
-	run_emake
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	run_emake DESTDIR="${D}" install
-
-	gen_usr_ldscript -a cap
-	if ! use static-libs ; then
-		rm "${ED%/}"/usr/$(get_libdir)/libcap.a || die
-	fi
-
-	if [[ -d "${ED%/}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED%/}"/usr/$(get_libdir)/security || die
-	fi
-
-	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/libcap-2.41.ebuild b/sys-libs/libcap/libcap-2.41.ebuild
deleted file mode 100644
index 0b09bd935e0..00000000000
--- a/sys-libs/libcap/libcap-2.41.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.39-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	run_emake DESTDIR="${D}" install
-
-	gen_usr_ldscript -a cap
-	if ! use static-libs ; then
-		# Don't remove libpsx.a!
-		# See https://bugs.gentoo.org/703912
-		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
-	fi
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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/libcap-2.42.ebuild b/sys-libs/libcap/libcap-2.42.ebuild
deleted file mode 100644
index acba4de6b6c..00000000000
--- a/sys-libs/libcap/libcap-2.42.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit multilib 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.42-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	run_emake DESTDIR="${D}" install
-
-	gen_usr_ldscript -a cap
-	if ! use static-libs ; then
-		# Don't remove libpsx.a!
-		# See https://bugs.gentoo.org/703912
-		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
-	fi
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2020-11-04 22:16 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2020-11-04 22:16 UTC (permalink / raw
  To: gentoo-commits

commit:     ea59e36e4fbe89f42909f46740b5d34c728323b9
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Nov  4 22:04:44 2020 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Nov  4 22:16:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ea59e36e

sys-libs/libcap: Bump to version 2.45

Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 +
 .../files/libcap-2.45-build-system-fixes.patch     | 207 +++++++++++++++++++++
 sys-libs/libcap/libcap-2.45.ebuild                 |  89 +++++++++
 3 files changed, 297 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 745cc38b3c8..e622eb3894b 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,2 +1,3 @@
 DIST libcap-2.43.tar.xz 125284 BLAKE2B bde36f8397f4adb74760eb403daa06bee1b8f45ddc253cc3c3ef1f6e95d0e4c76d0f2e6fa3335a8bc451f18ac7128c96230f6aba9ae0320fa4f9d669e7b4f715 SHA512 817add571fb2c54ad2a39974e6545b8fc8d855ecdcf2e00b2cc10e583802c49dfea2d8bca484c89ecd574fdacfc46565b51e3064a4407cf1985defb913240d45
 DIST libcap-2.44.tar.xz 125568 BLAKE2B 758b756648d27e7fa81024e33712a77f2b676fe1aa0519c232412d1468afb6b982d5ab54162e2f46ebba5dbcb962d5779e5b15550c938aca52e499d406990a6f SHA512 1bb323ca362923bd6bd0e2e4639cf8726975165a620a243b31e797056439eb7efb2bfbc8e5521636783a86c7415b2037b1638c98747b79183ca7d3d42a04ff20
+DIST libcap-2.45.tar.xz 127608 BLAKE2B 61b422ad3a53b9f1e2e2fb253794ac5eef652e6592ffe5b0c4d7eb98c6683ebf08342bb2cbd1e4792cec206639c56bc3bafb983a990523ee3a1814686b57edf1 SHA512 32ddc303eeb1bf6a4b6cc81b0cb0c49544c58697735925b661a0cdfa18e4096fdbaed1a340c09b8060b09302dea332b216e9bdaf246e4c45f91211afc4752138

diff --git a/sys-libs/libcap/files/libcap-2.45-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.45-build-system-fixes.patch
new file mode 100644
index 00000000000..4b22ed096e1
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.45-build-system-fixes.patch
@@ -0,0 +1,207 @@
+From 4e74abfe7309302b4aa6c90f9e54647cb5e0146d Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 4 Nov 2020 22:46:20 +0100
+Subject: [PATCH] build system fixes
+
+This touches up the homebrewed build system to work much better "out of the
+box" for people.  Specifically:
+        - allow toolchain vars to be set via environment
+        - CC / BUILD_CC / AR / RANLIB
+        - CFLAGS / CPPFLAGS / LDFLAGS
+        - split CPPFLAGS out of CFLAGS
+        - break -fPIC out of global CFLAGS and only use where needed
+        - use LDLIBS for libraries, not LDFLAGS
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.24 to libcap-2.25
+Forward ported from libcap-2.25 to libcap-2.28
+Forward ported from libcap-2.28 to libcap-2.29
+Forward ported from libcap-2.29 to libcap-2.33
+Forward ported from libcap-2.33 to libcap-2.34
+Forward ported from libcap-2.34 to libcap-2.37
+Forward ported from libcap-2.37 to libcap-2.39
+Forward ported from libcap-2.39 to libcap-2.42
+Forward ported from libcap-2.42 to libcap-2.44
+Forward ported from libcap-2.44 to libcap-2.45
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules       | 12 +++++++-----
+ Makefile         |  1 -
+ libcap/Makefile  |  7 ++++---
+ pam_cap/Makefile |  8 +++++---
+ progs/Makefile   |  2 +-
+ tests/Makefile   |  6 ++++--
+ 6 files changed, 21 insertions(+), 15 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index cc6f95b..31d9db5 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -52,7 +52,6 @@ GOMAJOR=0
+ # Compilation specifics
+ 
+ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
+ 
+ CC := $(CROSS_COMPILE)gcc
+ DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+@@ -60,7 +59,7 @@ COPTS ?= -O2
+ CFLAGS ?= $(COPTS) $(DEFINES)
+ BUILD_CC ?= $(CC)
+ BUILD_COPTS ?= -O2
+-BUILD_CFLAGS ?= $(BUILD_COPTS) $(DEFINES) $(IPATH)
++BUILD_CFLAGS ?= $(CFLAGS)
+ AR := $(CROSS_COMPILE)ar
+ RANLIB := $(CROSS_COMPILE)ranlib
+ DEBUG = -g #-DDEBUG
+@@ -76,10 +75,13 @@ LIBPSXLIB := -L$(topdir)/libcap -lpsx $(PSXLINKFLAGS)
+ 
+ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
+ 
+-SYSTEM_HEADERS = /usr/include
++LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
++CPPFLAGS += $(LIBCAP_CPPFLAGS)
++BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
+ INCS=$(topdir)/libcap/include/sys/capability.h
+ LDFLAGS += -L$(topdir)/libcap
+-CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
++CPPFLAGS += -Dlinux
++CFLAGS += $(WARNINGS) $(DEBUG)
+ INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+ 
+ # SHARED tracks whether or not the SHARED libraries (libcap.so,
+@@ -104,7 +106,7 @@ PTHREADS ?= yes
+ 
+ ifeq ($(PTHREADS),yes)
+ GO := go
+-GOLANG := $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
++GOLANG ?= $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
+ ifeq ($(GOLANG),yes)
+ GOROOT := $(shell $(GO) env GOROOT)
+ GOCGO := $(shell if [ "$(shell $(GO) env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
+diff --git a/Makefile b/Makefile
+index 8e8d5f3..580c48f 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 $@
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 230be39..7d0bcfb 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -25,6 +25,7 @@ MINCAPLIBNAME=$(MAJCAPLIBNAME).$(MINOR)
+ PSXOBJS=$(addsuffix .o, $(PSXFILES))
+ MAJPSXLIBNAME=$(PSXLIBNAME).$(VERSION)
+ MINPSXLIBNAME=$(MAJPSXLIBNAME).$(MINOR)
++CFLAGS += -fPIC
+ 
+ all: pcs $(STACAPLIBNAME)
+ ifeq ($(SHARED),yes)
+@@ -66,7 +67,7 @@ libpsx.pc: libpsx.pc.in
+ 		$< >$@
+ 
+ _makenames: _makenames.c cap_names.list.h
+-	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
++	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+ 
+ cap_names.h: _makenames
+ 	./_makenames > cap_names.h
+@@ -105,10 +106,10 @@ $(PSXLIBNAME) $(MAJPSXLIBNAME) $(MINPSXLIBNAME): $(PSXOBJS)
+ endif
+ 
+ %.o: %.c $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
+-	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
+ 
+ cap_test: cap_test.c libcap.h
+ 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index 56604fd..2da4674 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -3,6 +3,8 @@
+ topdir=$(shell pwd)/..
+ include ../Make.Rules
+ 
++CFLAGS += -fPIC
++
+ all: pam_cap.so
+ 	$(MAKE) testlink
+ 
+@@ -16,16 +18,16 @@ install: all
+ # written (and you know why it fails), email me and explain why. Thanks!
+ 
+ pam_cap.so: pam_cap.o
+-	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
++	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ pam_cap.o: pam_cap.c
+-	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
++	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ test_pam_cap: test_pam_cap.c pam_cap.c
+ 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
+ 
+ testlink: test.c pam_cap.o
+-	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
+ 
+ test: pam_cap.so
+ 	make testlink
+diff --git a/progs/Makefile b/progs/Makefile
+index 1d7fc7a..64dbe86 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -28,7 +28,7 @@ $(BUILD): %: %.o $(DEPS)
+ 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
+ 
+ %.o: %.c $(INCS)
+-	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@
++	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+diff --git a/tests/Makefile b/tests/Makefile
+index fc39fee..3668825 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -13,6 +13,8 @@ ifeq ($(PTHREADS),yes)
+ 	make psx_test libcap_psx_test libcap_psx_launch_test
+ endif
+ 
++CFLAGS += -fPIC
++
+ install: all
+ 
+ ifeq ($(DYNAMIC),yes)
+@@ -62,13 +64,13 @@ run_psx_test: psx_test
+ 	./psx_test
+ 
+ psx_test: psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS)
+ 
+ run_libcap_psx_test: libcap_psx_test
+ 	./libcap_psx_test
+ 
+ libcap_psx_test: libcap_psx_test.c $(DEPS)
+-	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
++	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
+ 
+ # privileged
+ run_libcap_launch_test: libcap_launch_test noop
+-- 
+2.29.2
+

diff --git a/sys-libs/libcap/libcap-2.45.ebuild b/sys-libs/libcap/libcap-2.45.ebuild
new file mode 100644
index 00000000000..f96270520ed
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.45.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib 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"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable.  #604802
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
+PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}
+	${PDEPEND}
+	sys-kernel/linux-headers"
+
+# Requires test suite being run as root (via sudo)
+RESTRICT="test"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.45-build-system-fixes.patch
+	"${FILESDIR}"/${PN}-2.38-no_perl.patch
+	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
+	"${FILESDIR}"/${PN}-2.21-include.patch
+)
+
+src_prepare() {
+	default
+	multilib_copy_sources
+}
+
+run_emake() {
+	local args=(
+		exec_prefix="${EPREFIX}"
+		lib_prefix="${EPREFIX}/usr"
+		lib="$(get_libdir)"
+		prefix="${EPREFIX}/usr"
+		PAM_CAP="$(usex pam yes no)"
+		DYNAMIC=yes
+		GOLANG=no
+		CC="$(tc-getCC)"
+		AR="$(tc-getAR)"
+		RANLIB="$(tc-getRANLIB)"
+	)
+	emake "${args[@]}" "$@"
+}
+
+src_configure() {
+	tc-export AR CC RANLIB
+	tc-export_build_env BUILD_CC
+	multilib-minimal_src_configure
+}
+
+multilib_src_compile() {
+	run_emake
+}
+
+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
+
+	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
+		rm -r "${ED}"/usr/$(get_libdir)/security || die
+	fi
+
+	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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-05-30 10:54 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2021-05-30 10:54 UTC (permalink / raw
  To: gentoo-commits

commit:     e4d012e535d80dcfd8c0135ff538764586fe8af8
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun May 30 10:54:09 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun May 30 10:54:34 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4d012e5

sys-libs/libcap: Revbump to install capsh binary again

Closes: https://bugs.gentoo.org/793026
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 .../files/libcap-2.50-install_capsh_again.patch    | 38 ++++++++++++++++++++++
 .../{libcap-2.50.ebuild => libcap-2.50-r1.ebuild}  |  1 +
 2 files changed, 39 insertions(+)

diff --git a/sys-libs/libcap/files/libcap-2.50-install_capsh_again.patch b/sys-libs/libcap/files/libcap-2.50-install_capsh_again.patch
new file mode 100644
index 00000000000..0ae7520dc7b
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.50-install_capsh_again.patch
@@ -0,0 +1,38 @@
+From 1f8d32942be54850a3a89c7b58ba5613b5525c58 Mon Sep 17 00:00:00 2001
+From: "Andrew G. Morgan" <morgan@kernel.org>
+Date: Fri, 28 May 2021 13:41:17 -0700
+Subject: [PATCH] Make capsh an installed binary again
+
+Bug report from Jan Palus:
+
+  https://bugzilla.kernel.org/show_bug.cgi?id=213261
+
+Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
+---
+ progs/Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/progs/Makefile b/progs/Makefile
+index 313dc4d..3c3dc97 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -32,14 +32,14 @@ $(BUILD): %: %.o $(DEPS)
+ 
+ install: all
+ 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
+-	for p in $(PROGS) ; do \
++	for p in $(PROGS) capsh ; do \
+ 		install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \
+ 	done
+ ifeq ($(RAISE_SETFCAP),yes)
+ 	$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
+ endif
+ 
+-test: $(PROGS)
++test: $(PROGS) capsh
+ 
+ capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh
+ 	./mkcapshdoc.sh > $@
+-- 
+2.32.0.rc2
+

diff --git a/sys-libs/libcap/libcap-2.50.ebuild b/sys-libs/libcap/libcap-2.50-r1.ebuild
similarity index 97%
rename from sys-libs/libcap/libcap-2.50.ebuild
rename to sys-libs/libcap/libcap-2.50-r1.ebuild
index 20f0382faa4..2745eb56bf9 100644
--- a/sys-libs/libcap/libcap-2.50.ebuild
+++ b/sys-libs/libcap/libcap-2.50-r1.ebuild
@@ -28,6 +28,7 @@ RESTRICT="test"
 
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.50-build-system-fixes.patch
+	"${FILESDIR}"/${PN}-2.50-install_capsh_again.patch #793026
 	"${FILESDIR}"/${PN}-2.38-no_perl.patch
 	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
 	"${FILESDIR}"/${PN}-2.21-include.patch


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-06-06 15:42 David Seifert
  0 siblings, 0 replies; 22+ messages in thread
From: David Seifert @ 2021-06-06 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     53df70d1da114743aa102595785c9e6d67cfb70c
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  6 15:41:32 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Jun  6 15:41:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=53df70d1

sys-libs/libcap: drop 2.43, 2.48

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   2 -
 .../files/libcap-2.42-build-system-fixes.patch     | 200 ---------------------
 sys-libs/libcap/libcap-2.43.ebuild                 |  87 ---------
 sys-libs/libcap/libcap-2.48.ebuild                 |  89 ---------
 4 files changed, 378 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 671d87f49eb..bcb7ccd2a72 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,4 +1,2 @@
-DIST libcap-2.43.tar.xz 125284 BLAKE2B bde36f8397f4adb74760eb403daa06bee1b8f45ddc253cc3c3ef1f6e95d0e4c76d0f2e6fa3335a8bc451f18ac7128c96230f6aba9ae0320fa4f9d669e7b4f715 SHA512 817add571fb2c54ad2a39974e6545b8fc8d855ecdcf2e00b2cc10e583802c49dfea2d8bca484c89ecd574fdacfc46565b51e3064a4407cf1985defb913240d45
-DIST libcap-2.48.tar.xz 132280 BLAKE2B 43ab75b73a5297ec24467fae82378f8c7aba5356afcebfb32a695d664a4b5268526fd90a009596c0f516a626d8f4523a9b49ec3225b6a886da32e62eb5b55ea5 SHA512 3cb1e2b026c0f60d6f225c7255944d45023e59fd065b8f832739fc90d33b3347981675de12dd705c4ecbd647a494a17daf39e1d92599bcd1a83306886edadba1
 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
 DIST libcap-2.50.tar.xz 143792 BLAKE2B be83dfe1e55a4363936f53afb13edd2c1fd8c9bc27f7946bfda1eb8fb3046d0370997dcf85ba9dab7de10673527b4e8d15f104a75eaf407cba8ed0fc42465790 SHA512 6ac2df1ea9a9154e082c0595d343380ff8abed953b53c635a9297683289f2fa708eff488a42c6053e5ac556a5d90faa8709b3d98a47b2911f05bf80f2663a543

diff --git a/sys-libs/libcap/files/libcap-2.42-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.42-build-system-fixes.patch
deleted file mode 100644
index 10959cf9339..00000000000
--- a/sys-libs/libcap/files/libcap-2.42-build-system-fixes.patch
+++ /dev/null
@@ -1,200 +0,0 @@
-From 8599fc87e91b7903cfb1877983615dadcbcc1b29 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Tue, 5 May 2020 09:52:40 +0200
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-        - allow toolchain vars to be set via environment
-        - CC / BUILD_CC / AR / RANLIB
-        - CFLAGS / CPPFLAGS / LDFLAGS
-        - split CPPFLAGS out of CFLAGS
-        - break -fPIC out of global CFLAGS and only use where needed
-        - use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.24 to libcap-2.25
-Forward ported from libcap-2.25 to libcap-2.28
-Forward ported from libcap-2.28 to libcap-2.29
-Forward ported from libcap-2.29 to libcap-2.33
-Forward ported from libcap-2.33 to libcap-2.34
-Forward ported from libcap-2.34 to libcap-2.37
-Forward ported from libcap-2.37 to libcap-2.39
-Forward ported from libcap-2.39 to libcap-2.42
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- Make.Rules       | 12 +++++++-----
- Makefile         |  1 -
- libcap/Makefile  |  7 ++++---
- pam_cap/Makefile |  8 +++++---
- progs/Makefile   |  2 +-
- tests/Makefile   |  6 ++++--
- 6 files changed, 21 insertions(+), 15 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 8440e18..67fd4a6 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -52,13 +52,12 @@ GOMAJOR=0
- # Compilation specifics
- 
- KERNEL_HEADERS := $(topdir)/libcap/include/uapi
--IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
- 
- CC ?= $(CROSS_COMPILE)gcc
- DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
- CFLAGS ?= -O2 $(DEFINES)
- BUILD_CC ?= $(CC)
--BUILD_CFLAGS ?= -O2 $(DEFINES) $(IPATH)
-+BUILD_CFLAGS ?= $(CFLAGS)
- AR ?= $(CROSS_COMPILE)ar
- RANLIB ?= $(CROSS_COMPILE)ranlib
- DEBUG = -g #-DDEBUG
-@@ -73,16 +72,19 @@ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread
- 
- BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
--SYSTEM_HEADERS = /usr/include
-+LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
- 
- GO := go
--GOLANG := $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
-+GOLANG ?= $(shell if [ -n "$(shell $(GO) version 2>/dev/null)" ]; then echo yes ; else echo no ; fi)
- ifeq ($(GOLANG),yes)
- GOROOT := $(shell $(GO) env GOROOT)
- GOCGO := $(shell if [ "$(shell $(GO) env CGO_ENABLED)" = 1 ]; then echo yes ; else echo no ; fi)
-diff --git a/Makefile b/Makefile
-index 03d7748..4437468 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 $@
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 81b089e..63fe555 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -21,6 +21,7 @@ PSXOBJS=$(addsuffix .o, $(PSXFILES))
- MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-+CFLAGS += -fPIC
- 
- all: $(MINLIBNAME) $(STACAPLIBNAME) pcs $(STAPSXLIBNAME)
- 
-@@ -50,7 +51,7 @@ libpsx.pc: libpsx.pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -82,10 +83,10 @@ $(MINLIBNAME): $(CAPOBJS)
- 	ln -sf $(MAJLIBNAME) $(LIBNAME)
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- cap_test: cap_test.c libcap.h
- 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index 56604fd..2da4674 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -3,6 +3,8 @@
- topdir=$(shell pwd)/..
- include ../Make.Rules
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testlink
- 
-@@ -16,16 +18,16 @@ install: all
- # written (and you know why it fails), email me and explain why. Thanks!
- 
- pam_cap.so: pam_cap.o
--	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- test_pam_cap: test_pam_cap.c pam_cap.c
- 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
- 
- testlink: test.c pam_cap.o
--	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
- 
- test: pam_cap.so
- 	make testlink
-diff --git a/progs/Makefile b/progs/Makefile
-index 076e44f..fd13351 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -23,7 +23,7 @@ $(BUILD): %: %.o $(DEPS)
- 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
-diff --git a/tests/Makefile b/tests/Makefile
-index bfedbc2..2b9a801 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -16,19 +16,21 @@ test: run_psx_test run_libcap_psx_test
- 
- sudotest: test run_libcap_launch_test run_libcap_launch_test
- 
-+CFLAGS += -fPIC
-+
- install: all
- 
- run_psx_test: psx_test
- 	./psx_test
- 
- psx_test: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB) -Wl,-wrap,pthread_create
- 
- run_libcap_psx_test: libcap_psx_test
- 	./libcap_psx_test
- 
- libcap_psx_test: libcap_psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
- 
- run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
- 	sudo ./libcap_launch_test
--- 
-2.28.0
-

diff --git a/sys-libs/libcap/libcap-2.43.ebuild b/sys-libs/libcap/libcap-2.43.ebuild
deleted file mode 100644
index e167daea97b..00000000000
--- a/sys-libs/libcap/libcap-2.43.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.42-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-multilib_src_install() {
-	# no configure, needs explicit install line #444724#c3
-	run_emake DESTDIR="${D}" install
-
-	gen_usr_ldscript -a cap
-	if ! use static-libs ; then
-		# Don't remove libpsx.a!
-		# See https://bugs.gentoo.org/703912
-		rm "${ED}"/usr/$(get_libdir)/libcap.a || die
-	fi
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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/libcap-2.48.ebuild b/sys-libs/libcap/libcap-2.48.ebuild
deleted file mode 100644
index 9cfc5eb049e..00000000000
--- a/sys-libs/libcap/libcap-2.48.ebuild
+++ /dev/null
@@ -1,89 +0,0 @@
-# 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.48-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-		CC="$(tc-getCC)"
-		AR="$(tc-getAR)"
-		RANLIB="$(tc-getRANLIB)"
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-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
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-08-03 10:27 Lars Wendler
  0 siblings, 0 replies; 22+ messages in thread
From: Lars Wendler @ 2021-08-03 10:27 UTC (permalink / raw
  To: gentoo-commits

commit:     d8418bfa288bf449d141c37dcaef5f8772b64691
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  3 10:26:34 2021 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Aug  3 10:26:34 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8418bfa

sys-libs/libcap: Removed old

Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |  1 -
 .../files/libcap-2.50-install_capsh_again.patch    | 38 ---------
 sys-libs/libcap/libcap-2.50-r1.ebuild              | 90 ----------------------
 3 files changed, 129 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index e253c7f74e2..787ee81d3f2 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,4 +1,3 @@
 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
-DIST libcap-2.50.tar.xz 143792 BLAKE2B be83dfe1e55a4363936f53afb13edd2c1fd8c9bc27f7946bfda1eb8fb3046d0370997dcf85ba9dab7de10673527b4e8d15f104a75eaf407cba8ed0fc42465790 SHA512 6ac2df1ea9a9154e082c0595d343380ff8abed953b53c635a9297683289f2fa708eff488a42c6053e5ac556a5d90faa8709b3d98a47b2911f05bf80f2663a543
 DIST libcap-2.51.tar.xz 145440 BLAKE2B 9f004e28891fbbb3552016e2e9250eab38935b6b40ad9e808a64ab07eecb52c5fa9032caed0baab719df8afe9aeec98403d10b05336bebe15a50b64020e5afc2 SHA512 3b4a97ef864a2ce2f87056ebc282223b0c71ca71c539744dc629ffe7905ca5fdde937ca70c34ec84406fe54863d39abf32775818a5e5a6fdf3069706b1723a88
 DIST libcap-2.52.tar.xz 158720 BLAKE2B 0696ae00a485df019f5441efe1d71676ddf294f1116e7fc3f352ad0595f9d4830f2e4fac1f98353016de36a4866f9d018f53419970ccd114c6df0faa556bcea3 SHA512 95d9e0f81fd955c42a0f299163a4402f00e9e7a2b392dfbabe613abea4babba2730576e76c9b612665a0bb8bd88aa98bf28ea3eb5582b5c06cd1137594a59893

diff --git a/sys-libs/libcap/files/libcap-2.50-install_capsh_again.patch b/sys-libs/libcap/files/libcap-2.50-install_capsh_again.patch
deleted file mode 100644
index 0ae7520dc7b..00000000000
--- a/sys-libs/libcap/files/libcap-2.50-install_capsh_again.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 1f8d32942be54850a3a89c7b58ba5613b5525c58 Mon Sep 17 00:00:00 2001
-From: "Andrew G. Morgan" <morgan@kernel.org>
-Date: Fri, 28 May 2021 13:41:17 -0700
-Subject: [PATCH] Make capsh an installed binary again
-
-Bug report from Jan Palus:
-
-  https://bugzilla.kernel.org/show_bug.cgi?id=213261
-
-Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
----
- progs/Makefile | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/progs/Makefile b/progs/Makefile
-index 313dc4d..3c3dc97 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -32,14 +32,14 @@ $(BUILD): %: %.o $(DEPS)
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
--	for p in $(PROGS) ; do \
-+	for p in $(PROGS) capsh ; do \
- 		install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \
- 	done
- ifeq ($(RAISE_SETFCAP),yes)
- 	$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
- endif
- 
--test: $(PROGS)
-+test: $(PROGS) capsh
- 
- capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh
- 	./mkcapshdoc.sh > $@
--- 
-2.32.0.rc2
-

diff --git a/sys-libs/libcap/libcap-2.50-r1.ebuild b/sys-libs/libcap/libcap-2.50-r1.ebuild
deleted file mode 100644
index 2745eb56bf9..00000000000
--- a/sys-libs/libcap/libcap-2.50-r1.ebuild
+++ /dev/null
@@ -1,90 +0,0 @@
-# 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"
-
-# While the build system optionally uses gperf, we don't DEPEND on it because
-# the build automatically falls back when it's unavailable.  #604802
-RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}]"
-PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
-DEPEND="${RDEPEND}
-	${PDEPEND}
-	sys-kernel/linux-headers"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.50-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.50-install_capsh_again.patch #793026
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-		CC="$(tc-getCC)"
-		AR="$(tc-getAR)"
-		RANLIB="$(tc-getRANLIB)"
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-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
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-09-04 17:35 David Seifert
  0 siblings, 0 replies; 22+ messages in thread
From: David Seifert @ 2021-09-04 17:35 UTC (permalink / raw
  To: gentoo-commits

commit:     946b3346ce16ceea321f33c27b2e09164850756f
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  4 17:34:21 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sat Sep  4 17:34:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=946b3346

sys-libs/libcap: drop 2.51-r1, 2.52-r1, 2.55-r1

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   3 -
 .../files/libcap-2.50-build-system-fixes.patch     | 209 ------------------
 .../files/libcap-2.52-build-system-fixes.patch     | 219 -------------------
 .../files/libcap-2.55-build-system-fixes.patch     | 241 ---------------------
 sys-libs/libcap/libcap-2.51-r1.ebuild              |  87 --------
 sys-libs/libcap/libcap-2.52-r1.ebuild              |  84 -------
 sys-libs/libcap/libcap-2.55-r1.ebuild              |  84 -------
 7 files changed, 927 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 594609befb8..9e6e421def2 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,5 +1,2 @@
 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
-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.50-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.50-build-system-fixes.patch
deleted file mode 100644
index 45b24421c8a..00000000000
--- a/sys-libs/libcap/files/libcap-2.50-build-system-fixes.patch
+++ /dev/null
@@ -1,209 +0,0 @@
-From 1f2465ec2b9dccd9823a54938722dc4e5edb8105 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 4 Nov 2020 22:46:20 +0100
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-        - allow toolchain vars to be set via environment
-        - CC / BUILD_CC / AR / RANLIB
-        - CFLAGS / CPPFLAGS / LDFLAGS
-        - split CPPFLAGS out of CFLAGS
-        - break -fPIC out of global CFLAGS and only use where needed
-        - use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.24 to libcap-2.25
-Forward ported from libcap-2.25 to libcap-2.28
-Forward ported from libcap-2.28 to libcap-2.29
-Forward ported from libcap-2.29 to libcap-2.33
-Forward ported from libcap-2.33 to libcap-2.34
-Forward ported from libcap-2.34 to libcap-2.37
-Forward ported from libcap-2.37 to libcap-2.39
-Forward ported from libcap-2.39 to libcap-2.42
-Forward ported from libcap-2.42 to libcap-2.44
-Forward ported from libcap-2.44 to libcap-2.45
-Forward ported from libcap-2.45 to libcap-2.48
-Forward ported from libcap-2.48 to libcap-2.50
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- Make.Rules       | 10 ++++++----
- Makefile         |  1 -
- libcap/Makefile  |  7 ++++---
- pam_cap/Makefile |  8 +++++---
- progs/Makefile   |  4 ++--
- tests/Makefile   |  6 ++++--
- 6 files changed, 21 insertions(+), 15 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 98284e2..a797347 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -52,7 +52,6 @@ GOMAJOR=1
- # Compilation specifics
- 
- KERNEL_HEADERS := $(topdir)/libcap/include/uapi
--IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
- 
- CC := $(CROSS_COMPILE)gcc
- DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-@@ -60,7 +59,7 @@ COPTS ?= -O2
- CFLAGS ?= $(COPTS) $(DEFINES)
- BUILD_CC ?= $(CC)
- BUILD_COPTS ?= -O2
--BUILD_CFLAGS ?= $(BUILD_COPTS) $(DEFINES) $(IPATH)
-+BUILD_CFLAGS ?= $(CFLAGS)
- AR := $(CROSS_COMPILE)ar
- RANLIB := $(CROSS_COMPILE)ranlib
- DEBUG = -g #-DDEBUG
-@@ -76,10 +75,13 @@ LIBPSXLIB := -L$(topdir)/libcap -lpsx $(PSXLINKFLAGS)
- 
- BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
--SYSTEM_HEADERS = /usr/include
-+LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- 
- # SHARED tracks whether or not the SHARED libraries (libcap.so,
-diff --git a/Makefile b/Makefile
-index bfc2089..2b06c9a 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 $@
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 9563d88..4b42f01 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -25,6 +25,7 @@ MINCAPLIBNAME=$(MAJCAPLIBNAME).$(MINOR)
- PSXOBJS=$(addsuffix .o, $(PSXFILES))
- MAJPSXLIBNAME=$(PSXLIBNAME).$(VERSION)
- MINPSXLIBNAME=$(MAJPSXLIBNAME).$(MINOR)
-+CFLAGS += -fPIC
- 
- all: pcs $(STACAPLIBNAME)
- ifeq ($(SHARED),yes)
-@@ -66,7 +67,7 @@ libpsx.pc: libpsx.pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -105,10 +106,10 @@ $(PSXLIBNAME) $(MAJPSXLIBNAME) $(MINPSXLIBNAME): $(PSXOBJS) include/sys/psx_sysc
- endif
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- cap_test: cap_test.c libcap.h
- 	$(CC) $(CFLAGS) $(IPATH) $< -o $@
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index 56604fd..2da4674 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -3,6 +3,8 @@
- topdir=$(shell pwd)/..
- include ../Make.Rules
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testlink
- 
-@@ -16,16 +18,16 @@ install: all
- # written (and you know why it fails), email me and explain why. Thanks!
- 
- pam_cap.so: pam_cap.o
--	$(LD) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(LD) $(CFLAGS) -o pam_cap.so $< $(LIBCAPLIB) $(LDFLAGS)
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- test_pam_cap: test_pam_cap.c pam_cap.c
- 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
- 
- testlink: test.c pam_cap.o
--	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
- 
- test: pam_cap.so
- 	make testlink
-diff --git a/progs/Makefile b/progs/Makefile
-index 289186e..313dc4d 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -28,7 +28,7 @@ $(BUILD): %: %.o $(DEPS)
- 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
-@@ -46,7 +46,7 @@ capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh
- 	diff -u capshdoc.h $@ || (rm $@ ; exit 1)
- 
- capsh: capsh.c capshdoc.h.cf $(DEPS)
--	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- tcapsh-static: capsh.c capshdoc.h.cf $(DEPS)
- 	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) --static
-diff --git a/tests/Makefile b/tests/Makefile
-index 3a917c4..07eb2d5 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -13,6 +13,8 @@ ifeq ($(PTHREADS),yes)
- 	$(MAKE) psx_test libcap_psx_test libcap_psx_launch_test
- endif
- 
-+CFLAGS += -fPIC
-+
- install: all
- 
- ifeq ($(DYNAMIC),yes)
-@@ -63,13 +65,13 @@ run_psx_test: psx_test
- 	./psx_test
- 
- psx_test: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS)
- 
- run_libcap_psx_test: libcap_psx_test
- 	./libcap_psx_test
- 
- libcap_psx_test: libcap_psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
- 
- # privileged
- uns_test: uns_test.c $(DEPS)
--- 
-2.32.0.rc1
-

diff --git a/sys-libs/libcap/files/libcap-2.52-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.52-build-system-fixes.patch
deleted file mode 100644
index 2d6b441c485..00000000000
--- a/sys-libs/libcap/files/libcap-2.52-build-system-fixes.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From 0e977b8595d4e8690bd3f3a816c9ec407dca5ba6 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 4 Nov 2020 22:46:20 +0100
-Subject: [PATCH] build system fixes
-
-This touches up the homebrewed build system to work much better "out of the
-box" for people.  Specifically:
-        - allow toolchain vars to be set via environment
-        - CC / BUILD_CC / AR / RANLIB
-        - CFLAGS / CPPFLAGS / LDFLAGS
-        - split CPPFLAGS out of CFLAGS
-        - break -fPIC out of global CFLAGS and only use where needed
-        - use LDLIBS for libraries, not LDFLAGS
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.24 to libcap-2.25
-Forward ported from libcap-2.25 to libcap-2.28
-Forward ported from libcap-2.28 to libcap-2.29
-Forward ported from libcap-2.29 to libcap-2.33
-Forward ported from libcap-2.33 to libcap-2.34
-Forward ported from libcap-2.34 to libcap-2.37
-Forward ported from libcap-2.37 to libcap-2.39
-Forward ported from libcap-2.39 to libcap-2.42
-Forward ported from libcap-2.42 to libcap-2.44
-Forward ported from libcap-2.44 to libcap-2.45
-Forward ported from libcap-2.45 to libcap-2.48
-Forward ported from libcap-2.48 to libcap-2.50
-Forward ported from libcap-2.50 to libcap-2.52
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
- Make.Rules       | 10 ++++++----
- Makefile         |  1 -
- libcap/Makefile  |  7 ++++---
- pam_cap/Makefile | 10 ++++++----
- progs/Makefile   |  4 ++--
- tests/Makefile   |  6 ++++--
- 6 files changed, 22 insertions(+), 16 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 8f7906c..fea4c78 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -52,18 +52,13 @@ GOMAJOR=1
- # Compilation specifics
- 
- KERNEL_HEADERS := $(topdir)/libcap/include/uapi
--IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
- 
--CC := $(CROSS_COMPILE)gcc
- DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
- COPTS ?= -O2
- CFLAGS ?= $(COPTS) $(DEFINES)
- BUILD_CC ?= $(CC)
- BUILD_COPTS ?= -O2
--BUILD_CFLAGS ?= $(BUILD_COPTS) $(DEFINES) $(IPATH)
--AR := $(CROSS_COMPILE)ar
--RANLIB := $(CROSS_COMPILE)ranlib
--OBJCOPY := $(CROSS_COMPILE)objcopy
-+BUILD_CFLAGS ?= $(CFLAGS)
- DEBUG = -g #-DDEBUG
- WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-@@ -77,10 +72,13 @@
- 
- BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
--SYSTEM_HEADERS = /usr/include
-+LIBCAP_CPPFLAGS = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include $(DEFINES)
-+CPPFLAGS += $(LIBCAP_CPPFLAGS)
-+BUILD_CPPFLAGS += $(LIBCAP_CPPFLAGS)
- INCS=$(topdir)/libcap/include/sys/capability.h
- LDFLAGS += -L$(topdir)/libcap
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- 
- # SHARED tracks whether or not the SHARED libraries (libcap.so,
-diff --git a/Makefile b/Makefile
-index 984d502..a917238 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 $@
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 47cf8f4..5125ffb 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -32,6 +32,7 @@ MINCAPLIBNAME=$(MAJCAPLIBNAME).$(MINOR)
- PSXOBJS=$(addsuffix .o, $(PSXFILES))
- MAJPSXLIBNAME=$(PSXLIBNAME).$(VERSION)
- MINPSXLIBNAME=$(MAJPSXLIBNAME).$(MINOR)
-+CFLAGS += -fPIC
- 
- all: pcs $(STACAPLIBNAME)
- ifeq ($(SHARED),yes)
-@@ -73,7 +74,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
- 		$< >$@
- 
- _makenames: _makenames.c cap_names.list.h
--	$(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-+	$(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
- 
- cap_names.h: _makenames
- 	./_makenames > cap_names.h
-@@ -125,10 +126,10 @@ $(PSXLIBNAME) $(MAJPSXLIBNAME) $(MINPSXLIBNAME): $(PSXOBJS) include/sys/psx_sysc
- endif
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(IPATH) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- cap_test: cap_test.c libcap.h $(CAPOBJS)
- 	$(CC) $(CFLAGS) $(IPATH) $< $(CAPOBJS) -o $@
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index a4c4891..a15feae 100644
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -3,6 +3,8 @@
- topdir=$(shell pwd)/..
- include ../Make.Rules
- 
-+CFLAGS += -fPIC
-+
- all: pam_cap.so
- 	$(MAKE) testlink
- 
-@@ -19,13 +21,13 @@ install: all
- 	$(MAKE) -C ../libcap loader.txt
- 
- execable.o: execable.c ../libcap/execable.h ../libcap/loader.txt
--	$(CC) $(CFLAGS) $(IPATH) -DLIBCAP_VERSION=\"libcap-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" -c execable.c -o $@
-+	$(CC) $(CFLAGS) $(LDFLAGS) $(CPPFLAGS) -DLIBCAP_VERSION=\"libcap-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" -c execable.c -o $@
- 
- pam_cap.so: pam_cap.o execable.o
--	$(LD) -o pam_cap.so $+ $(LIBCAPLIB) $(LDFLAGS) --entry=__so_start
-+	$(LD) $(CFLAGS) -o pam_cap.so $+ $(LIBCAPLIB) $(LDFLAGS) --entry=__so_start
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(IPATH) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- ../libcap/libcap.a:
- 	$(MAKE) -C ../libcap libcap.a
-@@ -34,7 +36,7 @@ test_pam_cap: test_pam_cap.c pam_cap.c ../libcap/libcap.a
- 	$(CC) $(CFLAGS) $(IPATH) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
- 
- testlink: test.c pam_cap.o
--	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
- 
- test: testlink test_pam_cap pam_cap.so
- 	$(MAKE) testlink
-diff --git a/progs/Makefile b/progs/Makefile
-index 3e82862..dba7e8f 100644
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -28,7 +28,7 @@ $(BUILD): %: %.o $(DEPS)
- 	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- %.o: %.c $(INCS)
--	$(CC) $(IPATH) $(CFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
-@@ -46,7 +46,7 @@ capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh
- 	diff -u capshdoc.h $@ || (rm $@ ; exit 1)
- 
- capsh: capsh.c capshdoc.h.cf $(DEPS)
--	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CAPSH_SHELL) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
- 
- tcapsh-static: capsh.c capshdoc.h.cf $(DEPS)
- 	$(CC) $(IPATH) $(CAPSH_SHELL) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS) --static
-diff --git a/tests/Makefile b/tests/Makefile
-index 3a917c4..07eb2d5 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -13,6 +13,8 @@ ifeq ($(PTHREADS),yes)
- 	$(MAKE) psx_test libcap_psx_test libcap_psx_launch_test
- endif
- 
-+CFLAGS += -fPIC
-+
- install: all
- 
- ifeq ($(DYNAMIC),yes)
-@@ -63,13 +65,13 @@ run_psx_test: psx_test
- 	./psx_test
- 
- psx_test: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS)
- 
- run_libcap_psx_test: libcap_psx_test
- 	./libcap_psx_test
- 
- libcap_psx_test: libcap_psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
- 
- # privileged
- uns_test: uns_test.c $(DEPS)
--- 
-2.32.0
-

diff --git a/sys-libs/libcap/files/libcap-2.55-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.55-build-system-fixes.patch
deleted file mode 100644
index 501649c272d..00000000000
--- a/sys-libs/libcap/files/libcap-2.55-build-system-fixes.patch
+++ /dev/null
@@ -1,241 +0,0 @@
-From abedd3c42100a636ae14a5c860ee2ed236af66ab Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Mon, 30 Aug 2021 07:04:15 +0100
-Subject: [PATCH] Build system fixes
-
-Summary:
-- Respect tool choices: CC/AR/OBJCOPY/RANLIB
-- Respect *FLAGS: CFLAGS/CPPFLAGS
-- Use existing make process to spawn new jobs
-- Only build tests conditionally (when we're going to run them)
-
-Much smaller version of patches from before thanks
-to upstream incorporating some of our changes.
-
-See < 2.55 patches for some more context/history; the
-original patch was from Mike Frysinger <vapier@gentoo.org>
-and was forward-ported by Lars Wendler <polynomial-c@gentoo.org>.
-
-Bug: https://bugs.gentoo.org/808807 (given this is where discussion occurred)
-Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214085
-Signed-off-by: Sam James <sam@gentoo.org>
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -64,24 +64,20 @@ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
- LIBCAP_INCLUDES = -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
- DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
- 
--CC := $(CROSS_COMPILE)gcc
- LD=$(CC) -Wl,-x -shared
- SUDO := sudo
- COPTS ?= -O2
--CFLAGS ?= $(COPTS) $(DEFINES)
-+CFLAGS ?= $(COPTS)
- LDFLAGS ?= #-g
--CPPFLAGS += $(LIBCAP_INCLUDES)
-+CPPFLAGS += $(LIBCAP_INCLUDES) $(DEFINES)
- 
- BUILD_CC ?= $(CC)
- BUILD_LD ?= $(BUILD_CC) -Wl,-x -shared
- BUILD_COPTS ?= $(COPTS)
--BUILD_CFLAGS ?= $(BUILD_COPTS) $(DEFINES)
-+BUILD_CFLAGS ?= $(CFLAGS)
- BUILD_LDFLAGS ?= $(LDFLAGS)
- BUILD_CPPFLAGS += $(LIBCAP_INCLUDES)
- 
--AR := $(CROSS_COMPILE)ar
--RANLIB := $(CROSS_COMPILE)ranlib
--OBJCOPY := $(CROSS_COMPILE)objcopy
- DEBUG = -g #-DDEBUG
- WARNINGS=-Wall -Wwrite-strings \
-         -Wpointer-arith -Wcast-qual -Wcast-align \
-@@ -95,7 +91,8 @@ BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
- 
- SYSTEM_HEADERS = /usr/include
- INCS=$(topdir)/libcap/include/sys/capability.h
--CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
-+CPPFLAGS += -Dlinux
-+CFLAGS += $(WARNINGS) $(DEBUG)
- INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
- 
- # SHARED tracks whether or not the SHARED libraries (libcap.so,
---- 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 $@
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -111,7 +111,7 @@ loader.txt: empty
- 	$(OBJCOPY) --dump-section .interp=$@ $< /dev/null
- 
- cap_magic.o: execable.h execable.c loader.txt
--	$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBRARY_VERSION=\"$(LIBTITLE)-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat loader.txt)\" -c execable.c -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBRARY_VERSION=\"$(LIBTITLE)-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat loader.txt)\" $(LDFLAGS) -c execable.c -o $@
- 
- $(CAPLIBNAME) $(MAJCAPLIBNAME) $(MINCAPLIBNAME): $(CAPOBJS) $(CAPMAGICOBJ)
- 	$(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJCAPLIBNAME) -o $(MINCAPLIBNAME) $^ $(MAGIC)
-@@ -119,22 +119,22 @@ $(CAPLIBNAME) $(MAJCAPLIBNAME) $(MINCAPLIBNAME): $(CAPOBJS) $(CAPMAGICOBJ)
- 	ln -sf $(MAJCAPLIBNAME) $(CAPLIBNAME)
- 
- psx_magic.o: execable.h execable.c loader.txt
--	$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBRARY_VERSION=\"$(PSXTITLE)-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat loader.txt)\" -c execable.c -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBRARY_VERSION=\"$(PSXTITLE)-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat loader.txt)\" $(LDFLAGS) -c execable.c -o $@
- 
- $(PSXLIBNAME) $(MAJPSXLIBNAME) $(MINPSXLIBNAME): $(PSXOBJS) include/sys/psx_syscall.h $(PSXMAGICOBJ)
--	$(LD) $(CFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJPSXLIBNAME) -o $(MINPSXLIBNAME) $(PSXOBJS) $(PSXMAGICOBJ) $(MAGIC) $(PSXLINKFLAGS)
-+	$(LD) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -Wl,-soname,$(MAJPSXLIBNAME) -o $(MINPSXLIBNAME) $(PSXOBJS) $(PSXMAGICOBJ) $(MAGIC) $(PSXLINKFLAGS)
- 	ln -sf $(MINPSXLIBNAME) $(MAJPSXLIBNAME)
- 	ln -sf $(MAJPSXLIBNAME) $(PSXLIBNAME)
- endif
- 
- %.o: %.c $(INCLS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c $< -o $@
- 
- cap_text.o: cap_text.c $(USE_GPERF_OUTPUT) $(INCLS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(INCLUDE_GPERF_OUTPUT) -c $< -o $@
- 
- cap_test: cap_test.c libcap.h $(CAPOBJS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $< $(CAPOBJS) -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< $(CAPOBJS) -o $@
- 
- libcapsotest: $(CAPLIBNAME)
- 	./$(CAPLIBNAME)
---- a/pam_cap/Makefile
-+++ b/pam_cap/Makefile
-@@ -17,10 +17,10 @@ install: all
- 	$(MAKE) -C ../libcap loader.txt
- 
- execable.o: execable.c ../libcap/execable.h ../libcap/loader.txt
--	$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBCAP_VERSION=\"libcap-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" -c execable.c -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBCAP_VERSION=\"libcap-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" $(LDFLAGS) -c execable.c -o $@
- 
- pam_cap.so: pam_cap.o execable.o pam_cap_linkopts
--	cat pam_cap_linkopts | xargs -e $(LD) -o $@ pam_cap.o execable.o $(LIBCAPLIB) $(LDFLAGS)
-+	cat pam_cap_linkopts | xargs -e $(LD) $(LDFLAGS) -o $@ pam_cap.o execable.o $(LIBCAPLIB)
- 
- # Some distributions force link everything at compile time, and don't
- # take advantage of libpam's dlopen runtime options to resolve ill
-@@ -51,21 +51,21 @@ pam_cap_linkopts: lazylink.so
- 	./lazylink.so || echo "-lpam" >> $@
- 
- lazylink.so: lazylink.c ../libcap/execable.h ../libcap/loader.txt
--	$(LD) -o $@ $(CFLAGS) $(CPPFLAGS) lazylink.c -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" $(LDFLAGS) -Wl,-e,__so_start
-+	$(LD) -o $@ $(CFLAGS) $(CPPFLAGS) -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" $(LDFLAGS) lazylink.c -Wl,-e,__so_start
- endif
- endif
- 
- pam_cap.o: pam_cap.c
--	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c $< -o $@
- 
- ../libcap/libcap.a:
- 	$(MAKE) -C ../libcap libcap.a
- 
- test_pam_cap: test_pam_cap.c pam_cap.c ../libcap/libcap.a
--	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ test_pam_cap.c $(LIBCAPLIB) --static
- 
- testlink: test.c pam_cap.o
--	$(CC) $(CFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB)
- 
- test: testlink test_pam_cap pam_cap.so
- 	$(MAKE) testlink
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -22,16 +22,16 @@ DEPS = ../libcap/libcap.a
- endif
- 
- ../libcap/libcap.a:
--	make -C ../libcap libcap.a
-+	$(MAKE) -C ../libcap libcap.a
- 
- ../libcap/libcap.so:
--	make -C ../libcap libcap.so
-+	$(MAKE) -C ../libcap libcap.so
- 
- $(BUILD): %: %.o $(DEPS)
--	$(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBCAPLIB)
- 
- %.o: %.c $(INCS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -c $< -o $@
- 
- install: all
- 	mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
-@@ -49,10 +49,10 @@ capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh
- 	diff -u capshdoc.h $@ || (rm $@ ; exit 1)
- 
- capsh: capsh.c capshdoc.h.cf $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $(CAPSH_SHELL) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(CAPSH_SHELL) -o $@ $< $(LIBCAPLIB)
- 
- tcapsh-static: capsh.c capshdoc.h.cf $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $(CAPSH_SHELL) -o $@ $< $(LIBCAPLIB) --static
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(CAPSH_SHELL) -o $@ $< $(LIBCAPLIB) --static
- 
- uns_test: ../tests/uns_test.c
- 	$(MAKE) -C ../tests uns_test
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -66,17 +66,17 @@ run_psx_test: psx_test
- 	./psx_test
- 
- psx_test: psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB)
- 
- run_libcap_psx_test: libcap_psx_test
- 	./libcap_psx_test
- 
- libcap_psx_test: libcap_psx_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB)
- 
- # privileged
- uns_test: uns_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB)
- 
- run_uns_test: uns_test
- 	echo exit | $(SUDO) ./uns_test
-@@ -88,13 +88,13 @@ run_libcap_psx_launch_test: libcap_psx_launch_test ../progs/tcapsh-static
- 	$(SUDO) ./libcap_psx_launch_test
- 
- libcap_launch_test: libcap_launch_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB)
- 
- # This varies only slightly from the above insofar as it currently
- # only links in the pthreads fork support. TODO() we need to change
- # the source to do something interesting with pthreads.
- libcap_psx_launch_test: libcap_launch_test.c $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) -DWITH_PTHREADS $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) -DWITH_PTHREADS $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) $(LIBPSXLIB)
- 
- 
- # This test demonstrates that libpsx is needed to secure multithreaded
-@@ -109,12 +109,12 @@ exploit.o: exploit.c
- 	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
- 
- exploit: exploit.o $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) -lpthread $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBCAPLIB) -lpthread
- 
- # Note, for some reason, the order of libraries is important to avoid
- # the exploit working for dynamic linking.
- noexploit: exploit.o $(DEPS)
--	$(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LIBCAPLIB) $(LDFLAGS)
-+	$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $< -o $@ $(LINKEXTRA) $(LIBPSXLIB) $(LIBCAPLIB)
- 
- # This one runs in a chroot with no shared library files.
- noop: noop.c

diff --git a/sys-libs/libcap/libcap-2.51-r1.ebuild b/sys-libs/libcap/libcap-2.51-r1.ebuild
deleted file mode 100644
index c4a5075d066..00000000000
--- a/sys-libs/libcap/libcap-2.51-r1.ebuild
+++ /dev/null
@@ -1,87 +0,0 @@
-# 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"
-
-# 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"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.50-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-		CC="$(tc-getCC)"
-		AR="$(tc-getAR)"
-		RANLIB="$(tc-getRANLIB)"
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-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
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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/libcap-2.52-r1.ebuild b/sys-libs/libcap/libcap-2.52-r1.ebuild
deleted file mode 100644
index 7a79484719d..00000000000
--- a/sys-libs/libcap/libcap-2.52-r1.ebuild
+++ /dev/null
@@ -1,84 +0,0 @@
-# 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"
-
-# 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"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.52-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC OBJCOPY RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-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
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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/libcap-2.55-r1.ebuild b/sys-libs/libcap/libcap-2.55-r1.ebuild
deleted file mode 100644
index 0f5cb32668e..00000000000
--- a/sys-libs/libcap/libcap-2.55-r1.ebuild
+++ /dev/null
@@ -1,84 +0,0 @@
-# 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"
-
-# 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"
-
-# Requires test suite being run as root (via sudo)
-RESTRICT="test"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.55-build-system-fixes.patch
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.21-include.patch
-)
-
-src_prepare() {
-	default
-	multilib_copy_sources
-}
-
-run_emake() {
-	local args=(
-		exec_prefix="${EPREFIX}"
-		lib_prefix="${EPREFIX}/usr"
-		lib="$(get_libdir)"
-		prefix="${EPREFIX}/usr"
-		PAM_CAP="$(usex pam yes no)"
-		DYNAMIC=yes
-		GOLANG=no
-	)
-	emake "${args[@]}" "$@"
-}
-
-src_configure() {
-	tc-export AR CC OBJCOPY RANLIB
-	tc-export_build_env BUILD_CC
-	multilib-minimal_src_configure
-}
-
-multilib_src_compile() {
-	run_emake
-}
-
-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
-
-	if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then
-		rm -r "${ED}"/usr/$(get_libdir)/security || die
-	fi
-
-	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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-09-05  9:51 David Seifert
  0 siblings, 0 replies; 22+ messages in thread
From: David Seifert @ 2021-09-05  9:51 UTC (permalink / raw
  To: gentoo-commits

commit:     72b75e511e958de407ff6172fe52d93fcdc5c83c
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Sep  5 09:51:43 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Sep  5 09:51:43 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72b75e51

sys-libs/libcap: update patch for 2.56

* all build system changes are now upstreamed

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../files/libcap-2.56-build-system-fixes.patch     | 233 +++++++++++++++++++--
 sys-libs/libcap/libcap-2.56.ebuild                 |   1 +
 2 files changed, 216 insertions(+), 18 deletions(-)

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
index bd026b15632..572bde97e2c 100644
--- a/sys-libs/libcap/files/libcap-2.56-build-system-fixes.patch
+++ b/sys-libs/libcap/files/libcap-2.56-build-system-fixes.patch
@@ -1,22 +1,26 @@
-From 35989c0ae0073009b1f9c0338410162a11d399fc Mon Sep 17 00:00:00 2001
+From 3249c2696468bc82ec45f4fcabddc390473a45da Mon Sep 17 00:00:00 2001
 From: David Seifert <soap@gentoo.org>
-Date: Fri, 3 Sep 2021 09:41:26 +0200
-Subject: [PATCH] Build system fixes
+Date: Sat, 4 Sep 2021 10:39:34 +0200
+Subject: [PATCH 1/3] Build system fixes
 
 Summary:
-- Always respect CFLAGS
-- Only build tests conditionally (when we're going to run them)
+- Always keep $(WARNINGS) when overriding CFLAGS
+
+Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
 ---
- Make.Rules | 3 ++-
- Makefile   | 1 -
- 2 files changed, 2 insertions(+), 2 deletions(-)
+ Make.Rules | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/Make.Rules b/Make.Rules
-index 3eeb098..04dd8dc 100644
+index 3eeb098..00f2a03 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       \
+@@ -78,10 +78,11 @@ OBJCOPY := $(CROSS_COMPILE)objcopy
+ 
+ DEBUG = # -g -DDEBUG
+ WARNINGS=-Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wcast-align \
+-        -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs       \
++	-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs       \
  	-Winline -Wshadow
  COPTS ?= -O2
 -CFLAGS ?= $(COPTS) $(WARNINGS) $(DEBUG)
@@ -25,18 +29,211 @@ index 3eeb098..04dd8dc 100644
  CPPFLAGS += -Dlinux $(DEFINES) $(LIBCAP_INCLUDES)
  LDFLAGS ?= # -g
  
+-- 
+2.33.0
+
+
+From 99799844ad9272d43892881d1090369e6032aec2 Mon Sep 17 00:00:00 2001
+From: "Andrew G. Morgan" <morgan@kernel.org>
+Date: Sat, 4 Sep 2021 11:42:24 -0700
+Subject: [PATCH 2/3] Don't build the tests/binaries until we want to run them
+
+Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
+---
+ tests/Makefile | 8 +++-----
+ 1 file changed, 3 insertions(+), 5 deletions(-)
+
+diff --git a/tests/Makefile b/tests/Makefile
+index dd78432..ecb7d1b 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -8,12 +8,10 @@ include ../Make.Rules
+ #
+ 
+ all:
+-	$(MAKE) libcap_launch_test uns_test
+-ifeq ($(PTHREADS),yes)
+-	$(MAKE) psx_test libcap_psx_test libcap_psx_launch_test
+-endif
++	@echo leave test building to test target
+ 
+-install: all
++install:
++	@echo nothing to install from tests
+ 
+ ifeq ($(DYNAMIC),yes)
+ LINKEXTRA=-Wl,-rpath,../libcap
+-- 
+2.33.0
+
+
+From 5ef14d07420c299ecd8de96928a5d1ce1e232df3 Mon Sep 17 00:00:00 2001
+From: "Andrew G. Morgan" <morgan@kernel.org>
+Date: Sat, 4 Sep 2021 14:05:11 -0700
+Subject: [PATCH 3/3] Refactor top level Makefile to reduce redundant building
+
+Make build a bit quicker for folk that don't want to run tests.
+
+Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
+---
+ Makefile         | 28 +++++-----------------------
+ doc/Makefile     |  6 ++++++
+ go/Makefile      |  5 +++--
+ libcap/Makefile  |  3 +++
+ pam_cap/Makefile |  2 +-
+ progs/Makefile   |  5 +++--
+ 6 files changed, 21 insertions(+), 28 deletions(-)
+
 diff --git a/Makefile b/Makefile
-index 1c195dd..3f71b12 100644
+index 1c195dd..9ee11c8 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -17,7 +17,6 @@ ifeq ($(GOLANG),yes)
- 	$(MAKE) -C go $@
- 	rm -f cap/go.sum
- endif
--	$(MAKE) -C tests $@
+@@ -8,7 +8,7 @@ include Make.Rules
+ # flags
+ #
+ 
+-all install clean: %: %-here
++all test sudotest install clean: %: %-here
+ 	$(MAKE) -C libcap $@
+ ifneq ($(PAM_CAP),no)
+ 	$(MAKE) -C pam_cap $@
+@@ -20,10 +20,13 @@ endif
+ 	$(MAKE) -C tests $@
  	$(MAKE) -C progs $@
  	$(MAKE) -C doc $@
- 	$(MAKE) -C kdebug $@
+-	$(MAKE) -C kdebug $@
+ 
+ all-here:
+ 
++test-here:
++
++sudotest-here:
++
+ install-here:
+ 
+ clean-here:
+@@ -41,30 +44,9 @@ distclean: clean
+ release: distclean
+ 	cd .. && ln -s libcap libcap-$(VERSION).$(MINOR) && tar cvf libcap-$(VERSION).$(MINOR).tar --exclude patches libcap-$(VERSION).$(MINOR)/* && rm libcap-$(VERSION).$(MINOR)
+ 
+-test: all
+-	$(MAKE) -C libcap $@
+-	$(MAKE) -C tests $@
+-ifneq ($(PAM_CAP),no)
+-	$(MAKE) -C pam_cap $@
+-endif
+-ifeq ($(GOLANG),yes)
+-	$(MAKE) -C go $@
+-endif
+-	$(MAKE) -C progs $@
+-
+ ktest: all
+ 	$(MAKE) -C kdebug test
+ 
+-sudotest: all
+-	$(MAKE) -C tests $@
+-ifneq ($(PAM_CAP),no)
+-	$(MAKE) -C pam_cap $@
+-endif
+-ifeq ($(GOLANG),yes)
+-	$(MAKE) -C go $@
+-endif
+-	$(MAKE) -C progs $@
+-
+ distcheck:
+ 	./distcheck.sh
+ 	$(MAKE) DYNAMIC=no COPTS="-D_FORTIFY_SOURCE=2 -O1 -g" clean test
+diff --git a/doc/Makefile b/doc/Makefile
+index e2802dc..9614180 100644
+--- a/doc/Makefile
++++ b/doc/Makefile
+@@ -32,6 +32,12 @@ MANS = $(MAN1S) $(MAN3S) $(MAN8S)
+ 
+ all: $(MANS)
+ 
++test:
++	@echo no doc tests available
++
++sudotest:
++	@echo no doc sudotests available
++
+ .PHONY: html
+ html:
+ 	mkdir -p html
+diff --git a/go/Makefile b/go/Makefile
+index 5af5321..2b2061b 100644
+--- a/go/Makefile
++++ b/go/Makefile
+@@ -14,8 +14,9 @@ IMPORTDIR=kernel.org/pub/linux/libs/security/libcap
+ PKGDIR=pkg/$(GOOSARCH)/$(IMPORTDIR)
+ 
+ DEPS=../libcap/libcap.a ../libcap/libpsx.a
++TESTS=compare-cap try-launching psx-signals
+ 
+-all: PSXGOPACKAGE CAPGOPACKAGE web setid gowns captree compare-cap try-launching psx-signals
++all: PSXGOPACKAGE CAPGOPACKAGE web setid gowns captree
+ 
+ $(DEPS):
+ 	$(MAKE) -C ../libcap all
+@@ -93,7 +94,7 @@ endif
+ b210613: b210613.go CAPGOPACKAGE
+ 	CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GO) build -mod=vendor $<
+ 
+-test: all
++test: all $(TESTS)
+ 	CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) $(GO) test -mod=vendor $(IMPORTDIR)/psx
+ 	CC="$(CC)" CGO_ENABLED="$(CGO_REQUIRED)" $(CGO_LDFLAGS_ALLOW) $(GO) test -mod=vendor $(IMPORTDIR)/cap
+ 	LD_LIBRARY_PATH=../libcap ./compare-cap
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 4b96a0c..84340f2 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -148,6 +148,9 @@ ifeq ($(PTHREADS),yes)
+ endif
+ endif
+ 
++sudotest:
++	@echo no sudotests for libcap
++
+ install: install-static
+ ifeq ($(SHARED),yes)
+ 	$(MAKE) install-shared
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index b245307..a000978 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -72,7 +72,7 @@ test: testlink test_pam_cap pam_cap.so
+ 	LD_LIBRARY_PATH=../libcap ./pam_cap.so --help
+ 	@echo "module can be run as an executable!"
+ 
+-sudotest: test test_pam_cap
++sudotest: test_pam_cap
+ 	$(SUDO) ./test_pam_cap root 0x0 0x0 0x0 config=./capability.conf
+ 	$(SUDO) ./test_pam_cap root 0x0 0x0 0x0 config=./sudotest.conf
+ 	$(SUDO) ./test_pam_cap alpha 0x0 0x0 0x0 config=./capability.conf
+diff --git a/progs/Makefile b/progs/Makefile
+index 2f887c8..e2bd7fe 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -42,7 +42,8 @@ ifeq ($(RAISE_SETFCAP),yes)
+ 	$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
+ endif
+ 
+-test: $(PROGS) capsh
++test:
++	@echo "no program tests without privilege, try 'make sudotest'"
+ 
+ capshdoc.h.cf: capshdoc.h ./mkcapshdoc.sh
+ 	./mkcapshdoc.sh > $@
+@@ -60,7 +61,7 @@ uns_test: ../tests/uns_test.c
+ 	$(MAKE) -C ../tests uns_test
+ 	cp ../tests/uns_test .
+ 
+-sudotest: test tcapsh-static uns_test
++sudotest: tcapsh-static uns_test
+ 	$(SUDO) $(LDPATH) ./quicktest.sh
+ 
+ clean:
 -- 
 2.33.0
 

diff --git a/sys-libs/libcap/libcap-2.56.ebuild b/sys-libs/libcap/libcap-2.56.ebuild
index ef97a68d05a..0298367e447 100644
--- a/sys-libs/libcap/libcap-2.56.ebuild
+++ b/sys-libs/libcap/libcap-2.56.ebuild
@@ -23,6 +23,7 @@ DEPEND="${PDEPEND}
 BDEPEND="tools? ( dev-lang/go )"
 
 PATCHES=(
+	# backport, remove on bump
 	"${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


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-09-11 23:52 Sam James
  0 siblings, 0 replies; 22+ messages in thread
From: Sam James @ 2021-09-11 23:52 UTC (permalink / raw
  To: gentoo-commits

commit:     db1bc68b2aeba14deebf61e49174fde9612868df
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 11 23:51:44 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 11 23:52:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=db1bc68b

sys-libs/libcap: add 2.57

Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |  1 +
 .../libcap/files/libcap-2.57-parallel-make.patch   | 29 +++++++
 sys-libs/libcap/libcap-2.57.ebuild                 | 90 ++++++++++++++++++++++
 3 files changed, 120 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 9e6e421def2..fcbd62a9743 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,2 +1,3 @@
 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
 DIST libcap-2.56.tar.xz 167056 BLAKE2B 97d1cf6196bcbcb48e335f810385ca2b36e7c3e234a1f99172fe00419ecc4af7337f208e107f012e5ffd46c1b6207a9d4515f3a677a924dd26ed8a699a080a5a SHA512 8a5c6c99458b0996c9599e00648e99e53b222ddf429535c475099c1af02796331b864fbfae767c16cfb7f2899cf0beaf74095e26a52988361ea1400f012f30c8
+DIST libcap-2.57.tar.xz 167740 BLAKE2B e0c004f3d11caf824d907315e6102707bb34c0ef3e9d430f23c191d711f073267ef6dc44463e2ce8041b8d13658b0c20560f7f3c6387f770ff9e66b81ff9f5d3 SHA512 5c70b3c6a1248ca0de92538614f0d0d516d72f6f25b135c92738c377b67533662e6fd6b0b61cb051ec99f406387d3334fcc7ddb54789626e4c387bcf46ebffbf

diff --git a/sys-libs/libcap/files/libcap-2.57-parallel-make.patch b/sys-libs/libcap/files/libcap-2.57-parallel-make.patch
new file mode 100644
index 00000000000..612044bcfb0
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.57-parallel-make.patch
@@ -0,0 +1,29 @@
+https://git.kernel.org/pub/scm/libs/libcap/libcap.git/patch/?id=893c134ca5cd6fc33ac19d8dbb9d985067d2e66b
+
+From: "Andrew G. Morgan" <morgan@kernel.org>
+Date: Fri, 10 Sep 2021 16:11:57 -0700
+Subject: Another missing dependency for make -j13
+
+One more missing dependency for pam_cap.so building.
+
+Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -19,7 +19,11 @@ install: all
+ execable.o: execable.c ../libcap/execable.h ../libcap/loader.txt
+ 	$(CC) $(CFLAGS) $(CPPFLAGS) -DLIBCAP_VERSION=\"libcap-$(VERSION).$(MINOR)\" -DSHARED_LOADER=\"$(shell cat ../libcap/loader.txt)\" -c execable.c -o $@
+ 
+-pam_cap.so: pam_cap.o execable.o pam_cap_linkopts
++LIBCAP:
++	$(MAKE) -C ../libcap all
++	touch $@
++
++pam_cap.so: pam_cap.o execable.o pam_cap_linkopts LIBCAP
+ 	cat pam_cap_linkopts | xargs -e $(LD) $(LDFLAGS) -o $@ pam_cap.o execable.o $(LIBCAPLIB)
+ 
+ # Some distributions force link everything at compile time, and don't
+@@ -83,3 +87,4 @@ sudotest: test_pam_cap
+ 
+ clean:
+ 	rm -f *.o *.so testlink lazylink.so test_pam_cap pam_cap_linkopts *~
++	rm -f LIBCAP

diff --git a/sys-libs/libcap/libcap-2.57.ebuild b/sys-libs/libcap/libcap-2.57.ebuild
new file mode 100644
index 00000000000..ca29aacc3bb
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.57.ebuild
@@ -0,0 +1,90 @@
+# 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=(
+	# Backported patch, drop on > 2.57
+	"${FILESDIR}"/${PN}-2.57-parallel-make.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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-11-21 23:37 David Seifert
  0 siblings, 0 replies; 22+ messages in thread
From: David Seifert @ 2021-11-21 23:37 UTC (permalink / raw
  To: gentoo-commits

commit:     2fcd58b2c05b0bedd594dbaabd99e7d5f30644de
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 21 23:37:35 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Nov 21 23:37:35 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2fcd58b2

sys-libs/libcap: add 2.61

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |  1 +
 ....61-ignore-RAISE_SETFCAP-install-failures.patch | 24 ++++++
 sys-libs/libcap/files/libcap-2.61-no_perl.patch    | 62 +++++++++++++++
 sys-libs/libcap/libcap-2.61.ebuild                 | 90 ++++++++++++++++++++++
 4 files changed, 177 insertions(+)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 4f4e42436180..a96b565578d0 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,2 +1,3 @@
 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
 DIST libcap-2.60.tar.xz 170744 BLAKE2B 858b5133a5cb2f3b30dab569a6c9f2097034318c90419fa2372e0b28c891160f5e84b54b302b2d98664df8f7c44df78eb3cb4e47b328cecd4c27e7ab223045ae SHA512 f2ff0d81df7251c05decda706ccc6463ce58df6a3c542fe479328dce5416f77aa5c6a09a1ab05a1d1a3638e6dae5c0e546aaa4824843a570700a8927fb7f73e6
+DIST libcap-2.61.tar.xz 173892 BLAKE2B 50874d3510ab2476aaceb775314d98744736aacd7364a23827756caa160c101e8bc890b7c33b5e19df8b30bb6b3b1c2be323e4b6a963f97e9ee557e86b4f13a0 SHA512 40096bf511d1c45e36f5d7f24e49c709528f3f01fcadd47b6ac40a7e8d5f1705b29b4cc56356b030639f67d0641b9f4e7c19449c3c7f4f77a4070c35745b465c

diff --git a/sys-libs/libcap/files/libcap-2.61-ignore-RAISE_SETFCAP-install-failures.patch b/sys-libs/libcap/files/libcap-2.61-ignore-RAISE_SETFCAP-install-failures.patch
new file mode 100644
index 000000000000..25f853b2a982
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.61-ignore-RAISE_SETFCAP-install-failures.patch
@@ -0,0 +1,24 @@
+From 8dfcdcfdcb9c462a05566aa8d3c6eca871f0ddbf Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 10 Feb 2016 09:52:45 +0100
+Subject: [PATCH] ignore RAISE_SETFCAP install failures
+
+While the new RAISE_SETFCAP feature is nifty, its failure to run (often
+due to the fs not supporting it) shouldn't impair the default install.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.20 to libcap-2.25
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -39,7 +39,7 @@
+ 		install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \
+ 	done
+ ifeq ($(RAISE_SETFCAP),yes)
+-	$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
++	-$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
+ endif
+ 
+ test:

diff --git a/sys-libs/libcap/files/libcap-2.61-no_perl.patch b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
new file mode 100644
index 000000000000..deda35db8e31
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
@@ -0,0 +1,62 @@
+From 3f76418eaf73896489129c529fac021e4f3a03c0 Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier@gentoo.org>
+Date: Wed, 21 Nov 2018 11:00:54 +0100
+Subject: [PATCH] use awk/sed instead of perl for creating header files
+
+More systems should have awk/sed than perl.
+
+Signed-off-by: Mike Frysinger <vapier@gentoo.org>
+
+Forward ported from libcap-2.22 to libcap-2.26
+and incorporated the gperf-3.1 fix provided by Mike Gilbert
+<floppym@gentoo.org>
+Forward ported from libcap-2.26 to libcap-2.28
+Forward ported from libcap-2.28 to libcap-2.38
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -20,6 +20,8 @@
+ 
+ # Always build libcap sources this way:
+ CFLAGS += -fPIC
++AWK = awk
++SED = sed
+ 
+ # The linker magic needed to build a dynamic library as independently
+ # executable
+@@ -82,17 +84,27 @@
+ 	./_makenames > cap_names.h
+ 
+ $(GPERF_OUTPUT): cap_names.list.h
+-	perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
+-	sed -e 's/unsigned int len/size_t len/' -i $@
++	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%%\n"; \
++	$(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
++	gperf \
++		--ignore-case \
++		--language=ANSI-C \
++		--includes \
++		--readonly \
++		--null-strings \
++		--global-table \
++		--hash-function-name=__cap_hash_name \
++		--lookup-function-name="__cap_lookup_name" \
++		-c -t -m20 $(INDENT) > $@
+ 
+-# Intention is that libcap keeps up with torvalds' tree, as reflected
+-# by this maintained version of the kernel header. libcap dynamically
+-# trims the meaning of "all" capabilities down to that of the running
+-# kernel as of 2.30.
+ UAPI_HEADER := $(topdir)/libcap/include/uapi/linux/capability.h
+ cap_names.list.h: Makefile $(UAPI_HEADER)
+ 	@echo "=> making $@ from $(UAPI_HEADER)"
+-	perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(UAPI_HEADER) | fgrep -v 0x > $@
++	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $(UAPI_HEADER) > $@
++
++cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
++	@echo "=> making $@ from $<"
++	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
+ 
+ $(STACAPLIBNAME): $(CAPOBJS)
+ 	$(AR) rcs $@ $^

diff --git a/sys-libs/libcap/libcap-2.61.ebuild b/sys-libs/libcap/libcap-2.61.ebuild
new file mode 100644
index 000000000000..d7182a35dc5b
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.61.ebuild
@@ -0,0 +1,90 @@
+# 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="
+	sys-apps/diffutils
+	tools? ( dev-lang/go )"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.61-no_perl.patch
+	"${FILESDIR}"/${PN}-2.61-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
+}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-11-28 14:02 David Seifert
  0 siblings, 0 replies; 22+ messages in thread
From: David Seifert @ 2021-11-28 14:02 UTC (permalink / raw
  To: gentoo-commits

commit:     73fd546a43034e66b7eac249a047e504fa903dd6
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 28 14:01:52 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Nov 28 14:01:52 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73fd546a

sys-libs/libcap: drop 2.60, 2.60-r1

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |   1 -
 .../files/libcap-2.60-libcap-alignment.patch       | 105 ---------------------
 sys-libs/libcap/libcap-2.60-r1.ebuild              |  90 ------------------
 sys-libs/libcap/libcap-2.60.ebuild                 |  88 -----------------
 4 files changed, 284 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index a96b565578d0..b783ac2f611d 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,2 @@
 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
-DIST libcap-2.60.tar.xz 170744 BLAKE2B 858b5133a5cb2f3b30dab569a6c9f2097034318c90419fa2372e0b28c891160f5e84b54b302b2d98664df8f7c44df78eb3cb4e47b328cecd4c27e7ab223045ae SHA512 f2ff0d81df7251c05decda706ccc6463ce58df6a3c542fe479328dce5416f77aa5c6a09a1ab05a1d1a3638e6dae5c0e546aaa4824843a570700a8927fb7f73e6
 DIST libcap-2.61.tar.xz 173892 BLAKE2B 50874d3510ab2476aaceb775314d98744736aacd7364a23827756caa160c101e8bc890b7c33b5e19df8b30bb6b3b1c2be323e4b6a963f97e9ee557e86b4f13a0 SHA512 40096bf511d1c45e36f5d7f24e49c709528f3f01fcadd47b6ac40a7e8d5f1705b29b4cc56356b030639f67d0641b9f4e7c19449c3c7f4f77a4070c35745b465c

diff --git a/sys-libs/libcap/files/libcap-2.60-libcap-alignment.patch b/sys-libs/libcap/files/libcap-2.60-libcap-alignment.patch
deleted file mode 100644
index 6081c7dc76e6..000000000000
--- a/sys-libs/libcap/files/libcap-2.60-libcap-alignment.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-https://bugs.gentoo.org/820071
-https://git.kernel.org/pub/scm/libs/libcap/libcap.git/patch/?id=c234bf90839f19e0332b586335411cb626a25a18
-https://git.kernel.org/pub/scm/libs/libcap/libcap.git/patch/?id=e9414f540a82b5348a12cfaddff229241564e1f3
-
-From: "Andrew G. Morgan" <morgan@kernel.org>
-Date: Sat, 13 Nov 2021 20:38:18 -0800
-Subject: Work around a __i386__ compilation issue for runnable .so files.
-
-This was reported by Sam James and debugged with respect to:
-
-  https://bugs.gentoo.org/show_bug.cgi?id=820071
-
-Modern versions of glibc employ SSE instructions that require the
-stack to be aligned to 16 bytes in order to execute movaps and
-friends to stack stored memory. The ABI for x86_64 requires this
-alignment so we'd not seen this issue before being cc:d into the
-bug.
-
-Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
---- a/libcap/execable.h
-+++ b/libcap/execable.h
-@@ -74,20 +74,26 @@ static void __execable_parse_args(int *argc_p, char ***argv_p)
-  * Note, to avoid any runtime confusion, SO_MAIN is a void static
-  * function.
-  */
-+#if defined(__i386__)
-+#define __SO_FORCE_ARG_ALIGNMENT  __attribute__((force_align_arg_pointer))
-+#else
-+#define __SO_FORCE_ARG_ALIGNMENT
-+#endif /* def __i386 */
- 
--#define SO_MAIN						        \
--static void __execable_main(int, char**);                       \
--extern void __so_start(void);		                	\
--void __so_start(void)                                           \
--{                                                               \
--    int argc;                                                   \
--    char **argv;                                                \
--    __execable_parse_args(&argc, &argv);                        \
-+#define SO_MAIN							\
-+static void __execable_main(int, char**);			\
-+extern void __so_start(void);					\
-+__SO_FORCE_ARG_ALIGNMENT					\
-+void __so_start(void)						\
-+{								\
-+    int argc;							\
-+    char **argv;						\
-+    __execable_parse_args(&argc, &argv);			\
-     __execable_main(argc, argv);				\
--    if (argc != 0) {                                            \
--	free(argv[0]);                                          \
--	free(argv);                                             \
--    }                                                           \
--    exit(0);                                                    \
--}                                                               \
-+    if (argc != 0) {						\
-+	free(argv[0]);						\
-+	free(argv);						\
-+    }								\
-+    exit(0);							\
-+}								\
- static void __execable_main
-
-From: "Andrew G. Morgan" <morgan@kernel.org>
-Date: Sun, 14 Nov 2021 20:38:30 -0800
-Subject: Work around musl not hard-coding the ABI for Linux x86_64.
-
-There seems to be a subtle difference between glibc and musl over
-whether or not a runnable *.so needs to start out with its stack
-aligned to 16 bytes or not. Since Linux ABIs for x86 (both 32 and
-64 bit varieties) require 16 byte alignment, just force it on both
-these architectures.
-
-This addresses:
-
-  https://bugzilla.kernel.org/show_bug.cgi?id=215009
-
-Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
---- a/libcap/execable.h
-+++ b/libcap/execable.h
-@@ -71,15 +71,19 @@ static void __execable_parse_args(int *argc_p, char ***argv_p)
- }
- 
- /*
-- * Note, to avoid any runtime confusion, SO_MAIN is a void static
-- * function.
-+ * Linux x86 ABI requires the stack be 16 byte aligned. Keep things
-+ * simple and just force it.
-  */
--#if defined(__i386__)
-+#if defined(__i386__) || defined(__x86_64__)
- #define __SO_FORCE_ARG_ALIGNMENT  __attribute__((force_align_arg_pointer))
- #else
- #define __SO_FORCE_ARG_ALIGNMENT
--#endif /* def __i386 */
-+#endif /* def some x86 */
- 
-+/*
-+ * Note, to avoid any runtime confusion, SO_MAIN is a void static
-+ * function.
-+ */
- #define SO_MAIN							\
- static void __execable_main(int, char**);			\
- extern void __so_start(void);					\
-cgit 1.2.3-1.el7

diff --git a/sys-libs/libcap/libcap-2.60-r1.ebuild b/sys-libs/libcap/libcap-2.60-r1.ebuild
deleted file mode 100644
index 35fb94d44a0f..000000000000
--- a/sys-libs/libcap/libcap-2.60-r1.ebuild
+++ /dev/null
@@ -1,90 +0,0 @@
-# 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="sys-apps/diffutils
-	tools? ( dev-lang/go )"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.38-no_perl.patch
-	"${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.60-libcap-alignment.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/libcap-2.60.ebuild b/sys-libs/libcap/libcap-2.60.ebuild
deleted file mode 100644
index ea1e6af49768..000000000000
--- a/sys-libs/libcap/libcap-2.60.ebuild
+++ /dev/null
@@ -1,88 +0,0 @@
-# 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.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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-11-28 14:02 David Seifert
  0 siblings, 0 replies; 22+ messages in thread
From: David Seifert @ 2021-11-28 14:02 UTC (permalink / raw
  To: gentoo-commits

commit:     f251acb661ae11a7e25d66082f45d994fdc2f0e5
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 28 14:01:53 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Sun Nov 28 14:01:53 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f251acb6

sys-libs/libcap: clean up patches

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/libcap/files/libcap-2.61-Wformat.patch | 25 +++++++++++++++++++++++++
 sys-libs/libcap/files/libcap-2.61-no_perl.patch | 13 ++++---------
 sys-libs/libcap/libcap-2.61.ebuild              |  1 +
 3 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/sys-libs/libcap/files/libcap-2.61-Wformat.patch b/sys-libs/libcap/files/libcap-2.61-Wformat.patch
new file mode 100644
index 000000000000..e0046de58770
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.61-Wformat.patch
@@ -0,0 +1,25 @@
+From 9fd3e7ac5870f84c73ac777d9a14480227ad7f00 Mon Sep 17 00:00:00 2001
+From: David Seifert <soap@gentoo.org>
+Date: Sun, 28 Nov 2021 14:14:42 +0100
+Subject: [PATCH] Fix `-Wformat` on 32-bit platforms
+
+---
+ libcap/cap_test.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcap/cap_test.c b/libcap/cap_test.c
+index b7fb2c5..39df261 100644
+--- a/libcap/cap_test.c
++++ b/libcap/cap_test.c
+@@ -124,7 +124,7 @@ static int test_short_bits(void)
+     }
+     if (strlen(tmp) > __CAP_NAME_SIZE) {
+ 	printf("cap_to_text buffer size reservation needs fixing (%ld > %d)\n",
+-	       strlen(tmp), __CAP_NAME_SIZE);
++	       (long int)strlen(tmp), __CAP_NAME_SIZE);
+ 	result = -1;
+     }
+     free(tmp);
+-- 
+2.34.1
+

diff --git a/sys-libs/libcap/files/libcap-2.61-no_perl.patch b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
index deda35db8e31..3d42a4dc6135 100644
--- a/sys-libs/libcap/files/libcap-2.61-no_perl.patch
+++ b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
@@ -25,7 +25,7 @@ Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
  
  # The linker magic needed to build a dynamic library as independently
  # executable
-@@ -82,17 +84,27 @@
+@@ -82,8 +84,18 @@
  	./_makenames > cap_names.h
  
  $(GPERF_OUTPUT): cap_names.list.h
@@ -44,19 +44,14 @@ Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
 +		--lookup-function-name="__cap_lookup_name" \
 +		-c -t -m20 $(INDENT) > $@
  
--# Intention is that libcap keeps up with torvalds' tree, as reflected
--# by this maintained version of the kernel header. libcap dynamically
--# trims the meaning of "all" capabilities down to that of the running
--# kernel as of 2.30.
+ # Intention is that libcap keeps up with torvalds' tree, as reflected
+ # by this maintained version of the kernel header. libcap dynamically
+@@ -92,7 +104,7 @@
  UAPI_HEADER := $(topdir)/libcap/include/uapi/linux/capability.h
  cap_names.list.h: Makefile $(UAPI_HEADER)
  	@echo "=> making $@ from $(UAPI_HEADER)"
 -	perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(UAPI_HEADER) | fgrep -v 0x > $@
 +	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $(UAPI_HEADER) > $@
-+
-+cap_names.list.h: $(KERNEL_HEADERS)/linux/capability.h Makefile
-+	@echo "=> making $@ from $<"
-+	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $< > $@
  
  $(STACAPLIBNAME): $(CAPOBJS)
  	$(AR) rcs $@ $^

diff --git a/sys-libs/libcap/libcap-2.61.ebuild b/sys-libs/libcap/libcap-2.61.ebuild
index d7182a35dc5b..28b28501b9d6 100644
--- a/sys-libs/libcap/libcap-2.61.ebuild
+++ b/sys-libs/libcap/libcap-2.61.ebuild
@@ -27,6 +27,7 @@ BDEPEND="
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.61-no_perl.patch
 	"${FILESDIR}"/${PN}-2.61-ignore-RAISE_SETFCAP-install-failures.patch
+	"${FILESDIR}"/${PN}-2.61-Wformat.patch
 )
 
 QA_FLAGS_IGNORED="sbin/captree" # go binaries don't use LDFLAGS


^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/
@ 2021-12-30 18:12 David Seifert
  0 siblings, 0 replies; 22+ messages in thread
From: David Seifert @ 2021-12-30 18:12 UTC (permalink / raw
  To: gentoo-commits

commit:     a83ded83c6ef3e65901a7f41c726203b33aa7c2c
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 30 18:12:08 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Dec 30 18:12:08 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a83ded83

sys-libs/libcap: drop 2.61

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 sys-libs/libcap/Manifest                           |  1 -
 sys-libs/libcap/files/libcap-2.61-Wformat.patch    | 25 ------
 ....61-ignore-RAISE_SETFCAP-install-failures.patch | 24 ------
 sys-libs/libcap/files/libcap-2.61-no_perl.patch    | 57 -------------
 sys-libs/libcap/libcap-2.61.ebuild                 | 98 ----------------------
 5 files changed, 205 deletions(-)

diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 4ec6770eefde..17b8bc94ee64 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,2 @@
 DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
-DIST libcap-2.61.tar.xz 173892 BLAKE2B 50874d3510ab2476aaceb775314d98744736aacd7364a23827756caa160c101e8bc890b7c33b5e19df8b30bb6b3b1c2be323e4b6a963f97e9ee557e86b4f13a0 SHA512 40096bf511d1c45e36f5d7f24e49c709528f3f01fcadd47b6ac40a7e8d5f1705b29b4cc56356b030639f67d0641b9f4e7c19449c3c7f4f77a4070c35745b465c
 DIST libcap-2.62.tar.xz 174772 BLAKE2B e3c86a5b88b9be932802ec8612f79e5f04912bf3e66f673eae2add85362292f4737c544d21b9e5adfd1a7a33c073568301b6532cdf0ea6c8b834d895b84323f1 SHA512 61ac004920c5cd3382a5443db2eacfc2041b7a8c0814b27084c1d111125639fe3950dea4325d0f7fb6bfb0d5de114452c3a62230cc958edb05ffdb83b213f9b3

diff --git a/sys-libs/libcap/files/libcap-2.61-Wformat.patch b/sys-libs/libcap/files/libcap-2.61-Wformat.patch
deleted file mode 100644
index e0046de58770..000000000000
--- a/sys-libs/libcap/files/libcap-2.61-Wformat.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 9fd3e7ac5870f84c73ac777d9a14480227ad7f00 Mon Sep 17 00:00:00 2001
-From: David Seifert <soap@gentoo.org>
-Date: Sun, 28 Nov 2021 14:14:42 +0100
-Subject: [PATCH] Fix `-Wformat` on 32-bit platforms
-
----
- libcap/cap_test.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/libcap/cap_test.c b/libcap/cap_test.c
-index b7fb2c5..39df261 100644
---- a/libcap/cap_test.c
-+++ b/libcap/cap_test.c
-@@ -124,7 +124,7 @@ static int test_short_bits(void)
-     }
-     if (strlen(tmp) > __CAP_NAME_SIZE) {
- 	printf("cap_to_text buffer size reservation needs fixing (%ld > %d)\n",
--	       strlen(tmp), __CAP_NAME_SIZE);
-+	       (long int)strlen(tmp), __CAP_NAME_SIZE);
- 	result = -1;
-     }
-     free(tmp);
--- 
-2.34.1
-

diff --git a/sys-libs/libcap/files/libcap-2.61-ignore-RAISE_SETFCAP-install-failures.patch b/sys-libs/libcap/files/libcap-2.61-ignore-RAISE_SETFCAP-install-failures.patch
deleted file mode 100644
index 25f853b2a982..000000000000
--- a/sys-libs/libcap/files/libcap-2.61-ignore-RAISE_SETFCAP-install-failures.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 8dfcdcfdcb9c462a05566aa8d3c6eca871f0ddbf Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 10 Feb 2016 09:52:45 +0100
-Subject: [PATCH] ignore RAISE_SETFCAP install failures
-
-While the new RAISE_SETFCAP feature is nifty, its failure to run (often
-due to the fs not supporting it) shouldn't impair the default install.
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.20 to libcap-2.25
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -39,7 +39,7 @@
- 		install -m 0755 $$p $(FAKEROOT)$(SBINDIR) ; \
- 	done
- ifeq ($(RAISE_SETFCAP),yes)
--	$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
-+	-$(FAKEROOT)$(SBINDIR)/setcap cap_setfcap=i $(FAKEROOT)$(SBINDIR)/setcap
- endif
- 
- test:

diff --git a/sys-libs/libcap/files/libcap-2.61-no_perl.patch b/sys-libs/libcap/files/libcap-2.61-no_perl.patch
deleted file mode 100644
index 3d42a4dc6135..000000000000
--- a/sys-libs/libcap/files/libcap-2.61-no_perl.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 3f76418eaf73896489129c529fac021e4f3a03c0 Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Wed, 21 Nov 2018 11:00:54 +0100
-Subject: [PATCH] use awk/sed instead of perl for creating header files
-
-More systems should have awk/sed than perl.
-
-Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-
-Forward ported from libcap-2.22 to libcap-2.26
-and incorporated the gperf-3.1 fix provided by Mike Gilbert
-<floppym@gentoo.org>
-Forward ported from libcap-2.26 to libcap-2.28
-Forward ported from libcap-2.28 to libcap-2.38
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -20,6 +20,8 @@
- 
- # Always build libcap sources this way:
- CFLAGS += -fPIC
-+AWK = awk
-+SED = sed
- 
- # The linker magic needed to build a dynamic library as independently
- # executable
-@@ -82,8 +84,18 @@
- 	./_makenames > cap_names.h
- 
- $(GPERF_OUTPUT): cap_names.list.h
--	perl -e 'print "struct __cap_token_s { const char *name; int index; };\n%{\nconst struct __cap_token_s *__cap_lookup_name(const char *, size_t);\n%}\n%%\n"; while ($$l = <>) { $$l =~ s/[\{\"]//g; $$l =~ s/\}.*// ; print $$l; }' < $< | gperf --ignore-case --language=ANSI-C --readonly --null-strings --global-table --hash-function-name=__cap_hash_name --lookup-function-name="__cap_lookup_name" -c -t -m20 $(INDENT) > $@
--	sed -e 's/unsigned int len/size_t len/' -i $@
-+	(printf "%b" "struct __cap_token_s { const char *name; int index; };\n%%\n"; \
-+	$(SED) -e 's:["{}]::g' -e 's:,$$::' $<) | \
-+	gperf \
-+		--ignore-case \
-+		--language=ANSI-C \
-+		--includes \
-+		--readonly \
-+		--null-strings \
-+		--global-table \
-+		--hash-function-name=__cap_hash_name \
-+		--lookup-function-name="__cap_lookup_name" \
-+		-c -t -m20 $(INDENT) > $@
- 
- # Intention is that libcap keeps up with torvalds' tree, as reflected
- # by this maintained version of the kernel header. libcap dynamically
-@@ -92,7 +104,7 @@
- UAPI_HEADER := $(topdir)/libcap/include/uapi/linux/capability.h
- cap_names.list.h: Makefile $(UAPI_HEADER)
- 	@echo "=> making $@ from $(UAPI_HEADER)"
--	perl -e 'while ($$l=<>) { if ($$l =~ /^\#define[ \t](CAP[_A-Z]+)[ \t]+([0-9]+)\s+$$/) { $$tok=$$1; $$val=$$2; $$tok =~ tr/A-Z/a-z/; print "{\"$$tok\",$$val},\n"; } }' $(UAPI_HEADER) | fgrep -v 0x > $@
-+	$(AWK) '($$0 ~ /^#define[[:space:]]+CAP[_A-Z]+[[:space:]]+[0-9]+[[:space:]]*$$/) { printf "{\"%s\",%s},\n", tolower($$2), $$3 }' $(UAPI_HEADER) > $@
- 
- $(STACAPLIBNAME): $(CAPOBJS)
- 	$(AR) rcs $@ $^

diff --git a/sys-libs/libcap/libcap-2.61.ebuild b/sys-libs/libcap/libcap-2.61.ebuild
deleted file mode 100644
index ad5ca82adcb8..000000000000
--- a/sys-libs/libcap/libcap-2.61.ebuild
+++ /dev/null
@@ -1,98 +0,0 @@
-# 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
-
-if [[ ${PV} == *9999 ]]; then
-	inherit git-r3
-	EGIT_REPO_URI="https://git.kernel.org/pub/scm/libs/libcap/libcap.git"
-else
-	SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
-
-	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
-fi
-
-DESCRIPTION="POSIX 1003.1e capabilities"
-HOMEPAGE="https://sites.google.com/site/fullycapable/"
-
-# it's available under either of the licenses
-LICENSE="|| ( GPL-2 BSD )"
-SLOT="0"
-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="
-	sys-apps/diffutils
-	tools? ( dev-lang/go )"
-
-PATCHES=(
-	"${FILESDIR}"/${PN}-2.61-no_perl.patch
-	"${FILESDIR}"/${PN}-2.61-ignore-RAISE_SETFCAP-install-failures.patch
-	"${FILESDIR}"/${PN}-2.61-Wformat.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
-}


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2021-12-30 18:12 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-06 15:42 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/files/, sys-libs/libcap/ David Seifert
  -- strict thread matches above, loose matches on Subject: below --
2021-12-30 18:12 David Seifert
2021-11-28 14:02 David Seifert
2021-11-28 14:02 David Seifert
2021-11-21 23:37 David Seifert
2021-09-11 23:52 Sam James
2021-09-05  9:51 David Seifert
2021-09-04 17:35 David Seifert
2021-08-03 10:27 Lars Wendler
2021-05-30 10:54 Lars Wendler
2020-11-04 22:16 Lars Wendler
2020-09-18 10:30 Lars Wendler
2020-08-02 17:14 Lars Wendler
2020-07-20 13:50 Lars Wendler
2020-07-13  9:10 Lars Wendler
2020-07-04 21:45 Lars Wendler
2020-06-04 17:45 Lars Wendler
2020-03-04 10:04 Lars Wendler
2019-12-10 10:29 Lars Wendler
2019-05-03 16:10 Lars Wendler
2017-02-01 14:42 Tony Vroon
2016-03-30 23:48 Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox