* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2016-02-10 9:05 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2016-02-10 9:05 UTC (permalink / raw
To: gentoo-commits
commit: 27252e02d69e9b62a06cb48c72d36dfdf8567fea
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 10 09:01:37 2016 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Feb 10 09:05:24 2016 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27252e02
sys-libs/libcap: Bump to version 2.25
Package-Manager: portage-2.2.27
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.25-build-system-fixes.patch | 153 +++++++++++++++++++++
....25-ignore-RAISE_SETFCAP-install-failures.patch | 33 +++++
sys-libs/libcap/libcap-2.25.ebuild | 75 ++++++++++
4 files changed, 262 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 7ed006c..ba24d96 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,2 +1,3 @@
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.25-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch
new file mode 100644
index 0000000..c33fffd
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.25-build-system-fixes.patch
@@ -0,0 +1,153 @@
+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.25-ignore-RAISE_SETFCAP-install-failures.patch b/sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch
new file mode 100644
index 0000000..0f73736
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch
@@ -0,0 +1,33 @@
+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>
+---
+ progs/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/progs/Makefile b/progs/Makefile
+index c094a24..4a6db38 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -27,7 +27,7 @@ install: all
+ 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
+
+ clean:
+--
+2.7.1
+
diff --git a/sys-libs/libcap/libcap-2.25.ebuild b/sys-libs/libcap/libcap-2.25.ebuild
new file mode 100644
index 0000000..cb60459
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.25.ebuild
@@ -0,0 +1,75 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 ~arm-linux ~ia64-linux ~x86-linux"
+IUSE="pam static-libs"
+
+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
+)
+
+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_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}"
+
+ multilib_is_native_abi && 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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2017-02-09 16:04 Mike Frysinger
0 siblings, 0 replies; 24+ messages in thread
From: Mike Frysinger @ 2017-02-09 16:04 UTC (permalink / raw
To: gentoo-commits
commit: 36aff20510b51dfc55d85f1eac4a40eb9295e333
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Feb 9 16:00:02 2017 +0000
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Feb 9 16:04:18 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36aff205
sys-libs/libcap: document gperf logic a bit more
sys-libs/libcap/files/libcap-2.25-gperf.patch | 9 ++++++---
sys-libs/libcap/libcap-2.25.ebuild | 2 ++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/sys-libs/libcap/files/libcap-2.25-gperf.patch b/sys-libs/libcap/files/libcap-2.25-gperf.patch
index aa67a19db5..86e930f6a4 100644
--- a/sys-libs/libcap/files/libcap-2.25-gperf.patch
+++ b/sys-libs/libcap/files/libcap-2.25-gperf.patch
@@ -1,6 +1,9 @@
-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
+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
diff --git a/sys-libs/libcap/libcap-2.25.ebuild b/sys-libs/libcap/libcap-2.25.ebuild
index ad5bb12955..08611ed07c 100644
--- a/sys-libs/libcap/libcap-2.25.ebuild
+++ b/sys-libs/libcap/libcap-2.25.ebuild
@@ -16,6 +16,8 @@ SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-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}
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2018-07-04 8:43 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2018-07-04 8:43 UTC (permalink / raw
To: gentoo-commits
commit: 43afb45707470ff350717d6854fa5fe709293cc0
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 4 08:41:21 2018 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Jul 4 08:43:36 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=43afb457
sys-libs/libcap: EAPI-6 revbump.
Package-Manager: Portage-2.3.41, Repoman-2.3.9
sys-libs/libcap/files/libcap-2.21-include.patch | 4 +-
sys-libs/libcap/libcap-2.25-r1.ebuild | 73 +++++++++++++++++++++++++
2 files changed, 75 insertions(+), 2 deletions(-)
diff --git a/sys-libs/libcap/files/libcap-2.21-include.patch b/sys-libs/libcap/files/libcap-2.21-include.patch
index 2a534246ee0..8ea6545659e 100644
--- a/sys-libs/libcap/files/libcap-2.21-include.patch
+++ b/sys-libs/libcap/files/libcap-2.21-include.patch
@@ -1,5 +1,5 @@
---- libcap/libcap.h.org 2011-06-15 07:25:58.912480899 +0200
-+++ libcap/libcap.h 2011-06-15 07:26:16.421329661 +0200
+--- a/libcap/libcap.h
++++ b/libcap/libcap.h
@@ -13,6 +13,7 @@
#include <stdlib.h>
#include <string.h>
diff --git a/sys-libs/libcap/libcap-2.25-r1.ebuild b/sys-libs/libcap/libcap-2.25-r1.ebuild
new file mode 100644
index 00000000000..8fd1ee61e27
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.25-r1.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit 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 ~arm-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() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ sed -i \
+ -e "/^PAM_CAP/s:=.*:=$(multilib_native_usex pam yes no):" \
+ -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
+ if ! use static-libs ; then
+ rm "${ED%/}"/usr/$(get_libdir)/libcap.a || die
+ fi
+
+ if multilib_is_native_abi && use pam; then
+ dopammod pam_cap/pam_cap.so
+ dopamsecurity '' pam_cap/capability.conf
+ fi
+}
+
+multilib_src_install_all() {
+ rm -r "${ED%/}"/usr/$(get_libdir)/security || die
+ dodoc CHANGELOG README doc/capability.notes
+}
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2018-11-21 10:22 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2018-11-21 10:22 UTC (permalink / raw
To: gentoo-commits
commit: 59f6430683709e7a024158fc5bdb73c7552bbb9d
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 21 10:21:49 2018 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Nov 21 10:21:49 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=59f64306
sys-libs/libcap: Bump to version 2.26
Closes: https://bugs.gentoo.org/660608
Package-Manager: Portage-2.3.52, 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.26-no-perl.patch | 61 +++++++++++++++++++
sys-libs/libcap/libcap-2.26.ebuild | 78 +++++++++++++++++++++++++
3 files changed, 140 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index cdffcfa42f2..d2c104bfab3 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1 +1,2 @@
DIST libcap-2.25.tar.xz 63672 BLAKE2B 205790dea83f15b585e5151814ea520ab1545661d18fa57f36e8c8e597a7c0f0ff1d7b5ccffc36e313eb28606f1e71678233a06896e29cb28e5559b190dd47ed SHA512 c3ab491885292adc171cde542b96f1295e84132febb50112a46575c3bde3a3eb6fcf733f7a756b4b656e013c0abb5ed6571db24799f8c0b23d8f759f992864f9
+DIST libcap-2.26.tar.xz 67172 BLAKE2B 9d1952bd03e1bba5ffa225a5088b8d841c2007219bbb9524f979ac65e472bf932db496acf93984fa77fe42e71d45b85cd603ca461a071fb4742526dfbc5f66eb SHA512 1c2d59f007226405a924950b2c2090393527e06f0692a84e6463e33915a070df61a9070b8f30a624d5630ddd39290eac117e5d440577d1edd48510195b9d12f0
diff --git a/sys-libs/libcap/files/libcap-2.26-no-perl.patch b/sys-libs/libcap/files/libcap-2.26-no-perl.patch
new file mode 100644
index 00000000000..55ee34ee71f
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.26-no-perl.patch
@@ -0,0 +1,61 @@
+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/libcap-2.26.ebuild b/sys-libs/libcap/libcap-2.26.ebuild
new file mode 100644
index 00000000000..3a944d5dc0c
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.26.ebuild
@@ -0,0 +1,78 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit 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"
+
+# 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
+}
+
+multilib_src_configure() {
+ sed -i \
+ -e "/^PAM_CAP/s:=.*:=$(multilib_native_usex pam yes no):" \
+ -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
+ 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 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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2019-12-12 15:05 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2019-12-12 15:05 UTC (permalink / raw
To: gentoo-commits
commit: ec45d4f4887db75d749bf8b871bbb768ebd79561
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 12 15:05:35 2019 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Dec 12 15:05:44 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ec45d4f4
sys-libs/libcap: Revbump to adjust build system fixes
Package-Manager: Portage-2.3.81, Repoman-2.3.20
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
.../files/libcap-2.28-build-system-fixes.patch | 18 +++++-----
| 39 ----------------------
.../{libcap-2.28.ebuild => libcap-2.28-r1.ebuild} | 1 -
3 files changed, 10 insertions(+), 48 deletions(-)
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
index 03455febade..ae0f2a36f6d 100644
--- a/sys-libs/libcap/files/libcap-2.28-build-system-fixes.patch
+++ b/sys-libs/libcap/files/libcap-2.28-build-system-fixes.patch
@@ -1,4 +1,4 @@
-From f65164072879ebb6b1fd6cc79a6b77804150bcc4 Mon Sep 17 00:00:00 2001
+From 9ce6d2ab1060c362178aba57b68bedca2d39cfe9 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
@@ -19,21 +19,20 @@ Forward ported from libcap-2.25 to libcap-2.28
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
---
- Make.Rules | 28 +++++++++++++++-------------
+ Make.Rules | 30 ++++++++++++++++++------------
libcap/Makefile | 7 ++++---
pam_cap/Makefile | 8 +++++---
progs/Makefile | 2 +-
- 4 files changed, 25 insertions(+), 20 deletions(-)
+ 4 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/Make.Rules b/Make.Rules
-index ab4f17c..f97021d 100644
+index ab4f17c..1b659ea 100644
--- a/Make.Rules
+++ b/Make.Rules
-@@ -45,36 +45,38 @@ MINOR=28
-
+@@ -46,35 +46,41 @@ MINOR=28
# Compilation specifics
--KERNEL_HEADERS := $(topdir)/libcap/include/uapi
+ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
-IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
-
-CC := gcc
@@ -42,10 +41,13 @@ index ab4f17c..f97021d 100644
-BUILD_CFLAGS := $(CFLAGS) $(IPATH)
-AR := ar
-RANLIB := ranlib
++IPATH += -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
++
+CC ?= gcc
+CFLAGS ?= -O2
+BUILD_CC ?= $(CC)
+BUILD_CFLAGS ?= $(CFLAGS)
++BUILD_CFLAGS += $(IPATH)
+AR ?= ar
+RANLIB ?= ranlib
DEBUG = -g #-DDEBUG
@@ -159,5 +161,5 @@ index 0786ad3..3abbbd9 100644
install: all
mkdir -p -m 0755 $(FAKEROOT)$(SBINDIR)
--
-2.24.0
+2.24.1
diff --git a/sys-libs/libcap/files/libcap-2.28-header_location.patch b/sys-libs/libcap/files/libcap-2.28-header_location.patch
deleted file mode 100644
index 8b0678cab75..00000000000
--- a/sys-libs/libcap/files/libcap-2.28-header_location.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-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/libcap-2.28.ebuild b/sys-libs/libcap/libcap-2.28-r1.ebuild
similarity index 97%
rename from sys-libs/libcap/libcap-2.28.ebuild
rename to sys-libs/libcap/libcap-2.28-r1.ebuild
index ab870aa7e15..679cf0b9f26 100644
--- a/sys-libs/libcap/libcap-2.28.ebuild
+++ b/sys-libs/libcap/libcap-2.28-r1.ebuild
@@ -30,7 +30,6 @@ PATCHES=(
"${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() {
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2019-12-26 12:27 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2019-12-26 12:27 UTC (permalink / raw
To: gentoo-commits
commit: cf039d78914f2c618d37117d57ab42de325c0b08
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 26 12:27:36 2019 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Dec 26 12:27:48 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf039d78
sys-libs/libcap: Bump to version 2.29
Package-Manager: Portage-2.3.83, Repoman-2.3.20
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.29-build-system-fixes.patch | 200 +++++++++++++++++++++
sys-libs/libcap/libcap-2.29.ebuild | 82 +++++++++
3 files changed, 283 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 6b6121dd497..caa90c1b57d 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +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.28.tar.xz 94244 BLAKE2B 9416ca78da0b985c25682746b5f5d052835d29ed40e2ffb2f70e3e59753423c91176a41f7d32b28d75800ccfccc5ed446050985a44471f0d0cc4cc9e0ef69661 SHA512 e693ac97483f575bb8a3f4d50262082e6d0d4906f2df48a4f52db4dde21014fcdc683d40712294c7c59d1be21740276bd20b486afee53815dc49e57a9938c5eb
+DIST libcap-2.29.tar.xz 97432 BLAKE2B 5e6de66350e79228b02b00737ce6e4be0982b88cb5e68cf89d33e46191f3444db5139b3fd241ec574204823d6c8a4862d1ea5a34845cff8d6789483cf5dd18fa SHA512 400a6883037bbc1f00847e2fcfb940d733784adec857969069972a3d5120dde6b554326ba6dd652670d854308433c66147944dda8b8b344ca249cef73ea866ef
diff --git a/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch
new file mode 100644
index 00000000000..910163c2612
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch
@@ -0,0 +1,200 @@
+From 449b6cb6226086c136dd108d11471d99692812b7 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
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules | 27 +++++++++++++++------------
+ libcap/Makefile | 7 ++++---
+ pam_cap/Makefile | 8 +++++---
+ progs/Makefile | 2 +-
+ tests/Makefile | 8 +++++---
+ 5 files changed, 30 insertions(+), 22 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index e7641e7..32c57df 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -47,35 +47,38 @@ MINOR=29
+ # 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
++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 949cfad..a7f80ce 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 $(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 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 95e4ca6..dcb89ae 100644
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -16,6 +16,8 @@ test: run_psx_test run_libcap_psx_test
+
+ sudotest: 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
+
+ clean:
+ rm -f psx_test psx_test_wrap libcap_psx_test
+--
+2.24.1
+
diff --git a/sys-libs/libcap/libcap-2.29.ebuild b/sys-libs/libcap/libcap-2.29.ebuild
new file mode 100644
index 00000000000..567940f4c71
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.29.ebuild
@@ -0,0 +1,82 @@
+# 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.29-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
+ 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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2019-12-28 9:41 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2019-12-28 9:41 UTC (permalink / raw
To: gentoo-commits
commit: 85e0c20c96c6260e927eef41fe0aae42fcf11cb6
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sat Dec 28 09:41:03 2019 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sat Dec 28 09:41:03 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=85e0c20c
sys-libs/libcap: Don't remove libpsx.a or -lpsx fails for consumers
Attempt to fix build with LTO
Bug: https://bugs.gentoo.org/702516
Closes: https://bugs.gentoo.org/703912
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
.../libcap/files/libcap-2.29-build-system-fixes.patch | 17 +++++++++++++++--
.../{libcap-2.29.ebuild => libcap-2.29-r1.ebuild} | 4 +++-
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch
index 910163c2612..a7751f429fd 100644
--- a/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch
+++ b/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch
@@ -1,4 +1,4 @@
-From 449b6cb6226086c136dd108d11471d99692812b7 Mon Sep 17 00:00:00 2001
+From 907626b63794199163778761fb56a5c89aa33e35 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
@@ -21,11 +21,12 @@ Forward ported from libcap-2.28 to libcap-2.29
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 +++++---
- 5 files changed, 30 insertions(+), 22 deletions(-)
+ 6 files changed, 30 insertions(+), 23 deletions(-)
diff --git a/Make.Rules b/Make.Rules
index e7641e7..32c57df 100644
@@ -82,6 +83,18 @@ index e7641e7..32c57df 100644
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 14e29ef..f0104e0 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 949cfad..a7f80ce 100644
--- a/libcap/Makefile
diff --git a/sys-libs/libcap/libcap-2.29.ebuild b/sys-libs/libcap/libcap-2.29-r1.ebuild
similarity index 94%
rename from sys-libs/libcap/libcap-2.29.ebuild
rename to sys-libs/libcap/libcap-2.29-r1.ebuild
index 567940f4c71..baec266531e 100644
--- a/sys-libs/libcap/libcap-2.29.ebuild
+++ b/sys-libs/libcap/libcap-2.29-r1.ebuild
@@ -64,7 +64,9 @@ multilib_src_install() {
gen_usr_ldscript -a cap
if ! use static-libs ; then
- rm "${ED}"/usr/$(get_libdir)/lib{cap,psx}.a || die
+ # 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
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2019-12-29 9:40 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2019-12-29 9:40 UTC (permalink / raw
To: gentoo-commits
commit: 3eb5406f9676ae7d7cd01012b1c0e2901606b19b
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 29 09:38:48 2019 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Dec 29 09:38:48 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3eb5406f
sys-libs/libcap: Revbump to fix dependencies of pkgconfig files
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
.../libcap/files/libcap-2.29-libpsx_pkgconfig.patch | 18 +++++++++---------
.../{libcap-2.29-r2.ebuild => libcap-2.29-r3.ebuild} | 0
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch b/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch
index 413b27908b4..4ebdb887aa6 100644
--- a/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch
+++ b/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch
@@ -1,15 +1,15 @@
-From e13e5b24fb98dc3ec2f76bc51ed0d714460e75d8 Mon Sep 17 00:00:00 2001
+From 8dbae11750ac0f85332355e6aab97005533dfb38 Mon Sep 17 00:00:00 2001
From: Lars Wendler <polynomial-c@gentoo.org>
Date: Sat, 28 Dec 2019 18:48:35 +0100
-Subject: [PATCH] USe separate libpsx.pc file instead of libcap.pc
+Subject: [PATCH] Use separate libpsx.pc file instead of libcap.pc
pkgconfig fails to parse current libcap.pc file but pkgconf succeeds
Gentoo-bug: https://bugs.gentoo.org/703932
---
libcap/Makefile | 12 +++++++++++-
- libcap/libcap.pc.in | 7 -------
- libcap/libpsx.pc.in | 12 ++++++++++++
+ libcap/libcap.pc.in | 8 +-------
+ libcap/libpsx.pc.in | 11 +++++++++++
3 files changed, 23 insertions(+), 8 deletions(-)
create mode 100644 libcap/libpsx.pc.in
@@ -51,10 +51,10 @@ index 949cfad..5795458 100644
mkdir -p -m 0755 $(FAKEROOT)$(GOPKGDIR)/libcap/cap
install -m 0644 src/libcap/cap/* $(FAKEROOT)$(GOPKGDIR)/libcap/cap/
diff --git a/libcap/libcap.pc.in b/libcap/libcap.pc.in
-index 3d6b273..69cd231 100644
+index 3d6b273..8358274 100644
--- a/libcap/libcap.pc.in
+++ b/libcap/libcap.pc.in
-@@ -9,10 +9,3 @@ Version: @VERSION@
+@@ -9,10 +9,4 @@ Version: @VERSION@
Libs: -L${libdir} -lcap
Libs.private: @deps@
Cflags: -I${includedir}
@@ -65,12 +65,13 @@ index 3d6b273..69cd231 100644
-Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create
-Libs.private: @deps@
-Cflags: -I${includedir}
++Requires: libpsx
diff --git a/libcap/libpsx.pc.in b/libcap/libpsx.pc.in
new file mode 100644
-index 0000000..8677a86
+index 0000000..d032b9f
--- /dev/null
+++ b/libcap/libpsx.pc.in
-@@ -0,0 +1,12 @@
+@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
@@ -82,7 +83,6 @@ index 0000000..8677a86
+Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create
+Libs.private: @deps@
+Cflags: -I${includedir}
-+Requires: libcap
--
2.24.1
diff --git a/sys-libs/libcap/libcap-2.29-r2.ebuild b/sys-libs/libcap/libcap-2.29-r3.ebuild
similarity index 100%
rename from sys-libs/libcap/libcap-2.29-r2.ebuild
rename to sys-libs/libcap/libcap-2.29-r3.ebuild
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2020-01-17 14:58 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2020-01-17 14:58 UTC (permalink / raw
To: gentoo-commits
commit: cb08def3a1c54c8afb47101ecebc31f8fc2f0e2a
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 17 14:58:37 2020 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Fri Jan 17 14:58:37 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb08def3
sys-libs/libcap: Removed old
Package-Manager: Portage-2.3.84, Repoman-2.3.20
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 2 -
.../files/libcap-2.28-build-system-fixes.patch | 196 ---------------------
.../files/libcap-2.29-libpsx_pkgconfig.patch | 88 ---------
sys-libs/libcap/libcap-2.28-r1.ebuild | 82 ---------
sys-libs/libcap/libcap-2.29-r3.ebuild | 85 ---------
5 files changed, 453 deletions(-)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index bf5f4abefab..684a23eac02 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,6 +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.28.tar.xz 94244 BLAKE2B 9416ca78da0b985c25682746b5f5d052835d29ed40e2ffb2f70e3e59753423c91176a41f7d32b28d75800ccfccc5ed446050985a44471f0d0cc4cc9e0ef69661 SHA512 e693ac97483f575bb8a3f4d50262082e6d0d4906f2df48a4f52db4dde21014fcdc683d40712294c7c59d1be21740276bd20b486afee53815dc49e57a9938c5eb
-DIST libcap-2.29.tar.xz 97432 BLAKE2B 5e6de66350e79228b02b00737ce6e4be0982b88cb5e68cf89d33e46191f3444db5139b3fd241ec574204823d6c8a4862d1ea5a34845cff8d6789483cf5dd18fa SHA512 400a6883037bbc1f00847e2fcfb940d733784adec857969069972a3d5120dde6b554326ba6dd652670d854308433c66147944dda8b8b344ca249cef73ea866ef
DIST libcap-2.30.tar.xz 98528 BLAKE2B 83892df1dc4f2a7605dbbf7332e90f1b696e16060ceba20a3fa3cdd53cb30f6a28d2bd49a4a66b7bc46221f860307de7c22cd7b2f826bad86baad6f510d01e40 SHA512 b2d843b61c3dd583b97c11ad4737b9ea5493eda6bb40da1efdb88b68c0594aeb0a2cebb0a59c749da1c6268ad1f821802d3c9e125a07c2d2457a0eb9df8c0c40
DIST libcap-2.31.tar.xz 99236 BLAKE2B c4cd5e2e105cc05b2aee2ee6435b9a28c06a91dee5cdd1baf6d94f625d89e134ad35a4493ffdfda7f3ffb0b41aa6e75a20cd705bfe9df570e82d0b6ea4e484e1 SHA512 9f0ef665a52e77356d6028abdead3c3cf75f97406ac09d60a33500222428c581d8aaa7d25d7eb9051d9c73ebfaefa7af5581430e1ecc1dfea73398a3ac7cbc3a
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
deleted file mode 100644
index 3c2ef3d2214..00000000000
--- a/sys-libs/libcap/files/libcap-2.28-build-system-fixes.patch
+++ /dev/null
@@ -1,196 +0,0 @@
-From 95e48927b0c3a5e817a41c03d977fbf2e7083940 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 | 27 +++++++++++++++------------
- libcap/Makefile | 7 ++++---
- pam_cap/Makefile | 8 +++++---
- progs/Makefile | 2 +-
- tests/Makefile | 8 +++++---
- 5 files changed, 30 insertions(+), 22 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index ab4f17c..bd8f73c 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -46,35 +46,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
-+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)
-diff --git a/tests/Makefile b/tests/Makefile
-index b16bdcd..dfed90e 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -5,6 +5,8 @@ topdir=$(shell pwd)/..
- include ../Make.Rules
- #
-
-+CFLAGS += -fPIC
-+
- all: run_psx_test run_libcap_psx_test
-
- install: all
-@@ -14,16 +16,16 @@ run_psx_test: psx_test psx_test_wrap
- ./psx_test_wrap
-
- psx_test: psx_test.c
-- $(CC) $(CFLAGS) $(IPATH) -DNOWRAP $< -o $@ $(LIBPSXLIB)
-+ $(CC) $(CFLAGS) $(CPPFLAGS) -DNOWRAP $< -o $@ $(LIBPSXLIB)
-
- psx_test_wrap: psx_test.c
-- $(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
-- $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
-+ $(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) -Wl,-wrap,pthread_create --static
-
- clean:
- rm -f psx_test psx_test_wrap libcap_psx_test
---
-2.24.1
-
diff --git a/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch b/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch
deleted file mode 100644
index 4ebdb887aa6..00000000000
--- a/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-From 8dbae11750ac0f85332355e6aab97005533dfb38 Mon Sep 17 00:00:00 2001
-From: Lars Wendler <polynomial-c@gentoo.org>
-Date: Sat, 28 Dec 2019 18:48:35 +0100
-Subject: [PATCH] Use separate libpsx.pc file instead of libcap.pc
-
-pkgconfig fails to parse current libcap.pc file but pkgconf succeeds
-
-Gentoo-bug: https://bugs.gentoo.org/703932
----
- libcap/Makefile | 12 +++++++++++-
- libcap/libcap.pc.in | 8 +-------
- libcap/libpsx.pc.in | 11 +++++++++++
- 3 files changed, 23 insertions(+), 8 deletions(-)
- create mode 100644 libcap/libpsx.pc.in
-
-diff --git a/libcap/Makefile b/libcap/Makefile
-index 949cfad..5795458 100644
---- a/libcap/Makefile
-+++ b/libcap/Makefile
-@@ -22,7 +22,7 @@ MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
-
--all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc $(STAPSXLIBNAME)
-+all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
-
- ifeq ($(BUILD_GPERF),yes)
- USE_GPERF_OUTPUT = $(GPERF_OUTPUT)
-@@ -38,6 +38,15 @@ libcap.pc: libcap.pc.in
- -e 's,@deps@,$(DEPS),' \
- $< >$@
-
-+libpsx.pc: libpsx.pc.in
-+ sed -e 's,@prefix@,$(prefix),' \
-+ -e 's,@exec_prefix@,$(exec_prefix),' \
-+ -e 's,@libdir@,$(LIBDIR),' \
-+ -e 's,@includedir@,$(inc_prefix)/include,' \
-+ -e 's,@VERSION@,$(VERSION).$(MINOR),' \
-+ -e 's,@deps@,$(DEPS),' \
-+ $< >$@
-+
- _makenames: _makenames.c cap_names.list.h
- $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
-
-@@ -86,6 +95,7 @@ ifeq ($(FAKEROOT),)
- endif
- mkdir -p -m 0755 $(FAKEROOT)$(PKGCONFIGDIR)
- install -m 0644 libcap.pc $(FAKEROOT)$(PKGCONFIGDIR)/libcap.pc
-+ install -m 0644 libpsx.pc $(FAKEROOT)$(PKGCONFIGDIR)/libpsx.pc
- ifeq ($(GOLANG),yes)
- mkdir -p -m 0755 $(FAKEROOT)$(GOPKGDIR)/libcap/cap
- install -m 0644 src/libcap/cap/* $(FAKEROOT)$(GOPKGDIR)/libcap/cap/
-diff --git a/libcap/libcap.pc.in b/libcap/libcap.pc.in
-index 3d6b273..8358274 100644
---- a/libcap/libcap.pc.in
-+++ b/libcap/libcap.pc.in
-@@ -9,10 +9,4 @@ Version: @VERSION@
- Libs: -L${libdir} -lcap
- Libs.private: @deps@
- Cflags: -I${includedir}
--
--Name: libpsx
--Description: libpsx - linux posix syscall API for pthreads
--Version: @VERSION@
--Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create
--Libs.private: @deps@
--Cflags: -I${includedir}
-+Requires: libpsx
-diff --git a/libcap/libpsx.pc.in b/libcap/libpsx.pc.in
-new file mode 100644
-index 0000000..d032b9f
---- /dev/null
-+++ b/libcap/libpsx.pc.in
-@@ -0,0 +1,11 @@
-+prefix=@prefix@
-+exec_prefix=@exec_prefix@
-+libdir=@libdir@
-+includedir=@includedir@
-+
-+Name: libpsx
-+Description: libpsx - linux posix syscall API for pthreads
-+Version: @VERSION@
-+Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create
-+Libs.private: @deps@
-+Cflags: -I${includedir}
---
-2.24.1
-
diff --git a/sys-libs/libcap/libcap-2.28-r1.ebuild b/sys-libs/libcap/libcap-2.28-r1.ebuild
deleted file mode 100644
index 40971d0ddca..00000000000
--- a/sys-libs/libcap/libcap-2.28-r1.ebuild
+++ /dev/null
@@ -1,82 +0,0 @@
-# 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="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.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
-)
-
-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
-}
diff --git a/sys-libs/libcap/libcap-2.29-r3.ebuild b/sys-libs/libcap/libcap-2.29-r3.ebuild
deleted file mode 100644
index f9b07a85181..00000000000
--- a/sys-libs/libcap/libcap-2.29-r3.ebuild
+++ /dev/null
@@ -1,85 +0,0 @@
-# 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="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.29-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.29-libpsx_pkgconfig.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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2020-05-05 8:25 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2020-05-05 8:25 UTC (permalink / raw
To: gentoo-commits
commit: 6e9aa54aa0785b630136284d92cd2b784c99862d
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue May 5 08:23:58 2020 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue May 5 08:25:27 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6e9aa54a
sys-libs/libcap: Bump to version 2.34
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.34-build-system-fixes.patch | 214 +++++++++++++++++++++
sys-libs/libcap/libcap-2.34.ebuild | 84 ++++++++
3 files changed, 299 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index e603b8d4cd1..b7274f8bc9a 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.32.tar.xz 99708 BLAKE2B cbd4676ca9ada4c4dd6dee5137c0bb16f23af5d9a224c81b476c19326f87352fb06e2e123c9431558cd22f91032064ed6de8407d5861728dd141be16957363db SHA512 e2325cf0a1d0509c49336f7e5760e5b339c889cdde8d6c359197aed711423f951ad390a2a3dd4943b03afe152ad8502ea1db9d7ef247148b93e93a3c4895a019
DIST libcap-2.33.tar.xz 111280 BLAKE2B 9a34b6e871c6175da5ef665ab7a5ed8b9889f598875f58a6e0b7aef9b6b2737f2a85bb0a6e259a730a3fcea3b8ebbec793b52ee5dec7d11fcf236dfb2148eb83 SHA512 bb5bdc1318b524ee607026038dff7c1c621f1710fa07f8c341b1f86761cb086d32b93d7a12dbe4256d4440ee984143db8659d2679330e221ce184d7048c142b4
+DIST libcap-2.34.tar.xz 111556 BLAKE2B 083599a899e5cc8942aedc3c932627d8608ea9cdc4eefe716e5fe2fb195276be26373697aa5bb3e84b801ccabb08f78c44f67ed82ea5c383a7c6a4d86f9e06b4 SHA512 6604aeab3de547e16e3c63e35cf41a5aaacf0cb52ffc818c822ada88595437986df731990d4b288eb72f9150de41fb8a93a6a727b936058e88b49b86352c4771
diff --git a/sys-libs/libcap/files/libcap-2.34-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.34-build-system-fixes.patch
new file mode 100644
index 00000000000..126e538633b
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.34-build-system-fixes.patch
@@ -0,0 +1,214 @@
+From ac790bb368d309d1d2add15bbb59559d53cb05bb 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 0fbfba0..755581d 100644
+--- a/Make.Rules
++++ b/Make.Rules
+@@ -47,36 +47,38 @@ MINOR=34
+ # 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)
+
+-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 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.26.2
+
diff --git a/sys-libs/libcap/libcap-2.34.ebuild b/sys-libs/libcap/libcap-2.34.ebuild
new file mode 100644
index 00000000000..1c62c6a414a
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.34.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 ~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.34-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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2020-05-05 8:25 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2020-05-05 8:25 UTC (permalink / raw
To: gentoo-commits
commit: 86319b7f10235c2a99b247d41f0ffdb80ba57a2c
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue May 5 08:25:16 2020 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue May 5 08:25:27 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=86319b7f
sys-libs/libcap: Removed old
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 -
.../files/libcap-2.29-build-system-fixes.patch | 213 ---------------------
sys-libs/libcap/libcap-2.32.ebuild | 84 --------
3 files changed, 298 deletions(-)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index b7274f8bc9a..553d14f6fef 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.32.tar.xz 99708 BLAKE2B cbd4676ca9ada4c4dd6dee5137c0bb16f23af5d9a224c81b476c19326f87352fb06e2e123c9431558cd22f91032064ed6de8407d5861728dd141be16957363db SHA512 e2325cf0a1d0509c49336f7e5760e5b339c889cdde8d6c359197aed711423f951ad390a2a3dd4943b03afe152ad8502ea1db9d7ef247148b93e93a3c4895a019
DIST libcap-2.33.tar.xz 111280 BLAKE2B 9a34b6e871c6175da5ef665ab7a5ed8b9889f598875f58a6e0b7aef9b6b2737f2a85bb0a6e259a730a3fcea3b8ebbec793b52ee5dec7d11fcf236dfb2148eb83 SHA512 bb5bdc1318b524ee607026038dff7c1c621f1710fa07f8c341b1f86761cb086d32b93d7a12dbe4256d4440ee984143db8659d2679330e221ce184d7048c142b4
DIST libcap-2.34.tar.xz 111556 BLAKE2B 083599a899e5cc8942aedc3c932627d8608ea9cdc4eefe716e5fe2fb195276be26373697aa5bb3e84b801ccabb08f78c44f67ed82ea5c383a7c6a4d86f9e06b4 SHA512 6604aeab3de547e16e3c63e35cf41a5aaacf0cb52ffc818c822ada88595437986df731990d4b288eb72f9150de41fb8a93a6a727b936058e88b49b86352c4771
diff --git a/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch
deleted file mode 100644
index a7751f429fd..00000000000
--- a/sys-libs/libcap/files/libcap-2.29-build-system-fixes.patch
+++ /dev/null
@@ -1,213 +0,0 @@
-From 907626b63794199163778761fb56a5c89aa33e35 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
-
-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 e7641e7..32c57df 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -47,35 +47,38 @@ MINOR=29
- # 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
-+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 14e29ef..f0104e0 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 949cfad..a7f80ce 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 $(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 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 95e4ca6..dcb89ae 100644
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -16,6 +16,8 @@ test: run_psx_test run_libcap_psx_test
-
- sudotest: 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
-
- clean:
- rm -f psx_test psx_test_wrap libcap_psx_test
---
-2.24.1
-
diff --git a/sys-libs/libcap/libcap-2.32.ebuild b/sys-libs/libcap/libcap-2.32.ebuild
deleted file mode 100644
index 0f7d52538c1..00000000000
--- a/sys-libs/libcap/libcap-2.32.ebuild
+++ /dev/null
@@ -1,84 +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}]
- 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.29-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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2020-07-06 18:17 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2020-07-06 18:17 UTC (permalink / raw
To: gentoo-commits
commit: 204842b30798d4bf9ede39f2718fac59aae6de11
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 6 18:16:27 2020 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jul 6 18:17:19 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=204842b3
sys-libs/libcap: Bump to version 2.38
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 | 3 +-
sys-libs/libcap/files/libcap-2.38-no_perl.patch | 71 ++++++++++++++++++
sys-libs/libcap/libcap-2.38.ebuild | 87 ++++++++++++++++++++++
4 files changed, 161 insertions(+), 1 deletion(-)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index a31123b5958..4970055027d 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.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
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
index 797ac62dd1f..3d0a771aa5f 100644
--- a/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch
+++ b/sys-libs/libcap/files/libcap-2.37-build-system-fixes.patch
@@ -1,4 +1,4 @@
-From 16bca4a0f45a712867992dbe30aa51558c78d424 Mon Sep 17 00:00:00 2001
+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
@@ -19,6 +19,7 @@ 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>
---
diff --git a/sys-libs/libcap/files/libcap-2.38-no_perl.patch b/sys-libs/libcap/files/libcap-2.38-no_perl.patch
new file mode 100644
index 00000000000..f3e0c468c86
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.38-no_perl.patch
@@ -0,0 +1,71 @@
+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>
+---
+ libcap/Makefile | 26 +++++++++++++++++++-------
+ 1 file changed, 19 insertions(+), 7 deletions(-)
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index 3d6463d..df2526c 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) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
+
+@@ -55,17 +57,27 @@ 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 $@
++ (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 $@ $^
+--
+2.27.0
+
diff --git a/sys-libs/libcap/libcap-2.38.ebuild b/sys-libs/libcap/libcap-2.38.ebuild
new file mode 100644
index 00000000000..3f680c7722f
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.38.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.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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2020-07-13 9:10 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2020-07-13 9:10 UTC (permalink / raw
To: gentoo-commits
commit: 0ae2e4081aba7faa5341443ba9fb9527a19006f5
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 13 09:10:33 2020 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Mon Jul 13 09:10:33 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0ae2e408
sys-libs/libcap: Removed old
Package-Manager: Portage-2.3.103, Repoman-2.3.23
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 2 -
sys-libs/libcap/files/libcap-2.28-no_perl.patch | 64 ------
.../files/libcap-2.34-build-system-fixes.patch | 214 ---------------------
sys-libs/libcap/libcap-2.36.ebuild | 87 ---------
sys-libs/libcap/libcap-2.37.ebuild | 87 ---------
5 files changed, 454 deletions(-)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 12671d79f75..d3f5b9fe1f7 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,6 +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.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.28-no_perl.patch b/sys-libs/libcap/files/libcap-2.28-no_perl.patch
deleted file mode 100644
index d8a20c2e131..00000000000
--- a/sys-libs/libcap/files/libcap-2.28-no_perl.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-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/files/libcap-2.34-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.34-build-system-fixes.patch
deleted file mode 100644
index 126e538633b..00000000000
--- a/sys-libs/libcap/files/libcap-2.34-build-system-fixes.patch
+++ /dev/null
@@ -1,214 +0,0 @@
-From ac790bb368d309d1d2add15bbb59559d53cb05bb 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 0fbfba0..755581d 100644
---- a/Make.Rules
-+++ b/Make.Rules
-@@ -47,36 +47,38 @@ MINOR=34
- # 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)
-
--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 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.26.2
-
diff --git a/sys-libs/libcap/libcap-2.36.ebuild b/sys-libs/libcap/libcap-2.36.ebuild
deleted file mode 100644
index 3546067e15c..00000000000
--- a/sys-libs/libcap/libcap-2.36.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.34-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
-}
diff --git a/sys-libs/libcap/libcap-2.37.ebuild b/sys-libs/libcap/libcap-2.37.ebuild
deleted file mode 100644
index 644015ae437..00000000000
--- a/sys-libs/libcap/libcap-2.37.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.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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2020-10-08 22:53 Thomas Deutschmann
0 siblings, 0 replies; 24+ messages in thread
From: Thomas Deutschmann @ 2020-10-08 22:53 UTC (permalink / raw
To: gentoo-commits
commit: 9ee78d5bf69bf16fba7250dae355d34857d064ec
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 8 22:52:37 2020 +0000
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Oct 8 22:53:17 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9ee78d5b
sys-libs/libcap: bump to v2.44
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.44-build-system-fixes.patch | 173 +++++++++++++++++++++
sys-libs/libcap/libcap-2.44.ebuild | 90 +++++++++++
3 files changed, 264 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 4ddc3241c0b..745cc38b3c8 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1 +1,2 @@
DIST libcap-2.43.tar.xz 125284 BLAKE2B bde36f8397f4adb74760eb403daa06bee1b8f45ddc253cc3c3ef1f6e95d0e4c76d0f2e6fa3335a8bc451f18ac7128c96230f6aba9ae0320fa4f9d669e7b4f715 SHA512 817add571fb2c54ad2a39974e6545b8fc8d855ecdcf2e00b2cc10e583802c49dfea2d8bca484c89ecd574fdacfc46565b51e3064a4407cf1985defb913240d45
+DIST libcap-2.44.tar.xz 125568 BLAKE2B 758b756648d27e7fa81024e33712a77f2b676fe1aa0519c232412d1468afb6b982d5ab54162e2f46ebba5dbcb962d5779e5b15550c938aca52e499d406990a6f SHA512 1bb323ca362923bd6bd0e2e4639cf8726975165a620a243b31e797056439eb7efb2bfbc8e5521636783a86c7415b2037b1638c98747b79183ca7d3d42a04ff20
diff --git a/sys-libs/libcap/files/libcap-2.44-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.44-build-system-fixes.patch
new file mode 100644
index 00000000000..eeee8ba2ccf
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.44-build-system-fixes.patch
@@ -0,0 +1,173 @@
+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
+
+
+--- 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
+@@ -75,16 +74,19 @@ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread -Wl,-wrap,pthread_create
+
+ 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)
+--- 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
+@@ -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 $@
+--- 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
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -27,7 +27,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)
+--- a/tests/Makefile
++++ b/tests/Makefile
+@@ -24,19 +24,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
+ $(LDPATH) ./psx_test
+
+ psx_test: psx_test.c $(DEPS)
+- $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB)
+
+ run_libcap_psx_test: libcap_psx_test
+ $(LDPATH) ./libcap_psx_test
+
+ libcap_psx_test: libcap_psx_test.c $(DEPS)
+- $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
+
+ run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
+ sudo $(LDPATH) ./libcap_launch_test
diff --git a/sys-libs/libcap/libcap-2.44.ebuild b/sys-libs/libcap/libcap-2.44.ebuild
new file mode 100644
index 00000000000..50d850b8a01
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.44.ebuild
@@ -0,0 +1,90 @@
+# 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.44-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
+ 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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2020-12-13 14:06 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2020-12-13 14:06 UTC (permalink / raw
To: gentoo-commits
commit: 15cbdee407c54505197ce5a9dfcf4a4c93804523
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 13 14:06:49 2020 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Dec 13 14:06:49 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15cbdee4
sys-libs/libcap: Removed old
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 -
.../files/libcap-2.44-build-system-fixes.patch | 173 ---------------------
sys-libs/libcap/libcap-2.44.ebuild | 90 -----------
3 files changed, 264 deletions(-)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index fd76508f924..7947640a9a3 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,4 +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
DIST libcap-2.46.tar.xz 129296 BLAKE2B 22df1dcf37a920e831c47edad62df2b3e35b5360605ed24bdb9199ac8ba1fd30cd20492f8a9eae25232cc042cbef9a89a3649e0d06412b84c58f12e7795844bc SHA512 6dcb249aac78efde959a986e7f06a364b2e6e57dd40b14e791d5a56012df485b2395dee0228f4cc3e1cddb2a4e3dcb9c1d83d5331ed084f23a46848494933845
diff --git a/sys-libs/libcap/files/libcap-2.44-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.44-build-system-fixes.patch
deleted file mode 100644
index eeee8ba2ccf..00000000000
--- a/sys-libs/libcap/files/libcap-2.44-build-system-fixes.patch
+++ /dev/null
@@ -1,173 +0,0 @@
-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
-
-
---- 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
-@@ -75,16 +74,19 @@ LIBPSXLIB := -L$(topdir)/libcap -lpsx -lpthread -Wl,-wrap,pthread_create
-
- 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)
---- 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
-@@ -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 $@
---- 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
---- a/progs/Makefile
-+++ b/progs/Makefile
-@@ -27,7 +27,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)
---- a/tests/Makefile
-+++ b/tests/Makefile
-@@ -24,19 +24,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
- $(LDPATH) ./psx_test
-
- psx_test: psx_test.c $(DEPS)
-- $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBPSXLIB)
-+ $(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBPSXLIB)
-
- run_libcap_psx_test: libcap_psx_test
- $(LDPATH) ./libcap_psx_test
-
- libcap_psx_test: libcap_psx_test.c $(DEPS)
-- $(CC) $(CFLAGS) $(IPATH) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
-+ $(CC) $(CFLAGS) $(CPPFLAGS) $< -o $@ $(LIBCAPLIB) $(LIBPSXLIB) $(LDFLAGS)
-
- run_libcap_launch_test: libcap_launch_test libcap_psx_launch_test noop
- sudo $(LDPATH) ./libcap_launch_test
diff --git a/sys-libs/libcap/libcap-2.44.ebuild b/sys-libs/libcap/libcap-2.44.ebuild
deleted file mode 100644
index 50d850b8a01..00000000000
--- a/sys-libs/libcap/libcap-2.44.ebuild
+++ /dev/null
@@ -1,90 +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.44-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
- 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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-02-05 10:59 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2021-02-05 10:59 UTC (permalink / raw
To: gentoo-commits
commit: 7eb18730f3c700ccee7f6ff24ac44107c39a0131
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 5 10:58:42 2021 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Fri Feb 5 10:59:30 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7eb18730
sys-libs/libcap: Bump to version 2.48
Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.48-build-system-fixes.patch | 199 +++++++++++++++++++++
sys-libs/libcap/libcap-2.48.ebuild | 89 +++++++++
3 files changed, 289 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index d4c82b42888..1ed10abdfee 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,4 @@
DIST libcap-2.43.tar.xz 125284 BLAKE2B bde36f8397f4adb74760eb403daa06bee1b8f45ddc253cc3c3ef1f6e95d0e4c76d0f2e6fa3335a8bc451f18ac7128c96230f6aba9ae0320fa4f9d669e7b4f715 SHA512 817add571fb2c54ad2a39974e6545b8fc8d855ecdcf2e00b2cc10e583802c49dfea2d8bca484c89ecd574fdacfc46565b51e3064a4407cf1985defb913240d45
DIST libcap-2.46.tar.xz 129296 BLAKE2B 22df1dcf37a920e831c47edad62df2b3e35b5360605ed24bdb9199ac8ba1fd30cd20492f8a9eae25232cc042cbef9a89a3649e0d06412b84c58f12e7795844bc SHA512 6dcb249aac78efde959a986e7f06a364b2e6e57dd40b14e791d5a56012df485b2395dee0228f4cc3e1cddb2a4e3dcb9c1d83d5331ed084f23a46848494933845
DIST libcap-2.47.tar.xz 131960 BLAKE2B 745bd3ba9819a1582880dff81d94ccf198fcf3f89d776ac0ce3055535e5370a0be57c5efdf7287f99ed50189af14ee46e90805d0a324f92d394211ffc6d7002d SHA512 cfa4aaa82b7dbb76e38cd207401603582343b14eb91d6df23e0ea6698d0ec0ab2b368fe0d08208a014a1b1a68d11316ecefa45c27983f9ad95e7b8184351fad8
+DIST libcap-2.48.tar.xz 132280 BLAKE2B 43ab75b73a5297ec24467fae82378f8c7aba5356afcebfb32a695d664a4b5268526fd90a009596c0f516a626d8f4523a9b49ec3225b6a886da32e62eb5b55ea5 SHA512 3cb1e2b026c0f60d6f225c7255944d45023e59fd065b8f832739fc90d33b3347981675de12dd705c4ecbd647a494a17daf39e1d92599bcd1a83306886edadba1
diff --git a/sys-libs/libcap/files/libcap-2.48-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.48-build-system-fixes.patch
new file mode 100644
index 00000000000..a672ecedaca
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.48-build-system-fixes.patch
@@ -0,0 +1,199 @@
+From d0e5c20fda92fcc48109bce7055d5fad458579ca 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
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ Make.Rules | 10 ++++++----
+ Makefile | 1 -
+ libcap/Makefile | 7 ++++---
+ pam_cap/Makefile | 8 +++++---
+ progs/Makefile | 2 +-
+ tests/Makefile | 6 ++++--
+ 6 files changed, 20 insertions(+), 14 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index ded9014..07b716f 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,
+diff --git a/Makefile b/Makefile
+index 7150b9b..9dff1e9 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 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 1e7039d..5874624 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 ../progs/tcapsh-static
+--
+2.30.0
+
diff --git a/sys-libs/libcap/libcap-2.48.ebuild b/sys-libs/libcap/libcap-2.48.ebuild
new file mode 100644
index 00000000000..2c01dccada7
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.48.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib 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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-05-25 14:19 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2021-05-25 14:19 UTC (permalink / raw
To: gentoo-commits
commit: 149cb0b85d203efa4ec6624092355a8946b48106
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue May 25 14:18:26 2021 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue May 25 14:18:57 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=149cb0b8
sys-libs/libcap: Bump to version 2.50
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.50-build-system-fixes.patch | 209 +++++++++++++++++++++
sys-libs/libcap/libcap-2.50.ebuild | 89 +++++++++
3 files changed, 299 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 38190faf3eb..671d87f49eb 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,4 @@
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.50-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.50-build-system-fixes.patch
new file mode 100644
index 00000000000..45b24421c8a
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.50-build-system-fixes.patch
@@ -0,0 +1,209 @@
+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/libcap-2.50.ebuild b/sys-libs/libcap/libcap-2.50.ebuild
new file mode 100644
index 00000000000..20f0382faa4
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.50.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal toolchain-funcs pam usr-ldscript
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="https://sites.google.com/site/fullycapable/"
+SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
+
+# it's available under either of the licenses
+LICENSE="|| ( GPL-2 BSD )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="pam static-libs"
+
+# 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.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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-08-03 10:27 Lars Wendler
0 siblings, 0 replies; 24+ messages in thread
From: Lars Wendler @ 2021-08-03 10:27 UTC (permalink / raw
To: gentoo-commits
commit: 402af49cb7bfe976f8d9cec40208ff46203dc86c
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 3 10:25:44 2021 +0000
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Tue Aug 3 10:25:44 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=402af49c
sys-libs/libcap: Bump to version 2.52
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.52-build-system-fixes.patch | 216 +++++++++++++++++++++
sys-libs/libcap/libcap-2.52.ebuild | 89 +++++++++
3 files changed, 306 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 05e8d59113c..e253c7f74e2 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,4 @@
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.52-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.52-build-system-fixes.patch
new file mode 100644
index 00000000000..3c9bf03f397
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.52-build-system-fixes.patch
@@ -0,0 +1,216 @@
+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,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
+ OBJCOPY := $(CROSS_COMPILE)objcopy
+@@ -77,10 +76,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 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/libcap-2.52.ebuild b/sys-libs/libcap/libcap-2.52.ebuild
new file mode 100644
index 00000000000..22ae030ac60
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.52.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal toolchain-funcs pam usr-ldscript
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="https://sites.google.com/site/fullycapable/"
+SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
+
+# it's available under either of the licenses
+LICENSE="|| ( GPL-2 BSD )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="pam static-libs"
+
+# 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.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
+ 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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-08-03 14:17 David Seifert
0 siblings, 0 replies; 24+ messages in thread
From: David Seifert @ 2021-08-03 14:17 UTC (permalink / raw
To: gentoo-commits
commit: 2d5296df85f652c9c0f3dbf29aeaccedb4d43588
Author: David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 3 14:17:04 2021 +0000
Commit: David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Aug 3 14:17:04 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d5296df
sys-libs/libcap: proper passing of objcopy to build system
Should be a proper fix, not just a rough attempt, as I've tested
via moving the binary away and all looks good.
Closes: https://bugs.gentoo.org/806274
Signed-off-by: David Seifert <soap <AT> gentoo.org>
.../libcap/files/libcap-2.52-build-system-fixes.patch | 17 ++++++++++-------
sys-libs/libcap/libcap-2.52.ebuild | 3 ---
2 files changed, 10 insertions(+), 10 deletions(-)
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
index 3c9bf03f397..2d6b441c485 100644
--- a/sys-libs/libcap/files/libcap-2.52-build-system-fixes.patch
+++ b/sys-libs/libcap/files/libcap-2.52-build-system-fixes.patch
@@ -42,24 +42,27 @@ diff --git a/Make.Rules b/Make.Rules
index 8f7906c..fea4c78 100644
--- a/Make.Rules
+++ b/Make.Rules
-@@ -52,7 +52,6 @@ GOMAJOR=1
+@@ -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
+-CC := $(CROSS_COMPILE)gcc
DEFINES := -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-@@ -60,7 +59,7 @@ COPTS ?= -O2
+ 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)
- AR := $(CROSS_COMPILE)ar
- RANLIB := $(CROSS_COMPILE)ranlib
- OBJCOPY := $(CROSS_COMPILE)objcopy
-@@ -77,10 +76,13 @@ LIBPSXLIB := -L$(topdir)/libcap -lpsx $(PSXLINKFLAGS)
+ 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)
diff --git a/sys-libs/libcap/libcap-2.52.ebuild b/sys-libs/libcap/libcap-2.52.ebuild
index cd7de80ecb4..6dc8e00f317 100644
--- a/sys-libs/libcap/libcap-2.52.ebuild
+++ b/sys-libs/libcap/libcap-2.52.ebuild
@@ -47,9 +47,6 @@ run_emake() {
PAM_CAP="$(usex pam yes no)"
DYNAMIC=yes
GOLANG=no
- CC="$(tc-getCC)"
- AR="$(tc-getAR)"
- RANLIB="$(tc-getRANLIB)"
)
emake "${args[@]}" "$@"
}
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-08-30 6:12 Sam James
0 siblings, 0 replies; 24+ messages in thread
From: Sam James @ 2021-08-30 6:12 UTC (permalink / raw
To: gentoo-commits
commit: 377ecb31bade3f21c3b9648125eb00c3d23023b3
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 30 06:09:30 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 30 06:12:27 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=377ecb31
sys-libs/libcap: add 2.55 (unkeyworded)
Only significant change here is revamping
of our (previously rather large) build system
patch. See the patch itself for more details.
Much smaller version of patches from before thanks
to upstream incorporating some of our changes.
Unkeyworded for now just to give it a bit
of time to settle, as the patch is a fair
bit different to what it was before.
Bug: https://bugs.gentoo.org/808807 (given this is where discussion occurred)
Bug: https://bugzilla.kernel.org/show_bug.cgi?id=214085
Thanks-to: Andrew G. Morgan <morgan <AT> kernel.org> (for reaching out & incorporating patches)
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
.../files/libcap-2.55-build-system-fixes.patch | 119 +++++++++++++++++++++
sys-libs/libcap/libcap-2.55.ebuild | 85 +++++++++++++++
3 files changed, 205 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 787ee81d3f2..fb0ba3e19b1 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,3 +1,4 @@
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
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
new file mode 100644
index 00000000000..9bd357ed714
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.55-build-system-fixes.patch
@@ -0,0 +1,119 @@
+From 4cdf9413b7b4ff27299c14f05d7a6fa038e4d59f 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>
+---
+ Make.Rules | 13 +++++--------
+ Makefile | 1 -
+ pam_cap/Makefile | 2 +-
+ progs/Makefile | 6 +++---
+ 4 files changed, 9 insertions(+), 13 deletions(-)
+
+diff --git a/Make.Rules b/Make.Rules
+index 66207b4..1e0366e 100644
+--- 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,
+diff --git a/Makefile b/Makefile
+index 1c195dd..3f71b12 100644
+--- a/Makefile
++++ b/Makefile
+@@ -17,7 +17,6 @@ ifeq ($(GOLANG),yes)
+ $(MAKE) -C go $@
+ rm -f cap/go.sum
+ endif
+- $(MAKE) -C tests $@
+ $(MAKE) -C progs $@
+ $(MAKE) -C doc $@
+ $(MAKE) -C kdebug $@
+diff --git a/pam_cap/Makefile b/pam_cap/Makefile
+index d5da6be..0cba3e1 100644
+--- a/pam_cap/Makefile
++++ b/pam_cap/Makefile
+@@ -65,7 +65,7 @@ test_pam_cap: test_pam_cap.c pam_cap.c ../libcap/libcap.a
+ $(CC) $(CFLAGS) $(CPPFLAGS) -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 51e9a63..98fe1b0 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -22,13 +22,13 @@ 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) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
+
+ %.o: %.c $(INCS)
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+--
+2.33.0
+
diff --git a/sys-libs/libcap/libcap-2.55.ebuild b/sys-libs/libcap/libcap-2.55.ebuild
new file mode 100644
index 00000000000..b0f32594b17
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.55.ebuild
@@ -0,0 +1,85 @@
+# 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"
+# Temporarily unkeyworded for testing as the build system patch changed substantially
+#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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-08-30 21:35 Sam James
0 siblings, 0 replies; 24+ messages in thread
From: Sam James @ 2021-08-30 21:35 UTC (permalink / raw
To: gentoo-commits
commit: 0caf0b1124ce200e0cad5dc09ed141b45086717f
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 30 21:30:49 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 30 21:35:35 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0caf0b11
sys-libs/libcap: update libcap-2.55 build system patch
Mainly added in some missing LDFLAGS lines mainly (some are
redundant but I'd rather be consistent, some were not).
Bug: https://bugs.gentoo.org/808807
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/libcap-2.55-build-system-fixes.patch | 172 ++++++++++++++++++---
.../{libcap-2.55.ebuild => libcap-2.55-r1.ebuild} | 0
2 files changed, 147 insertions(+), 25 deletions(-)
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
index 9bd357ed714..501649c272d 100644
--- a/sys-libs/libcap/files/libcap-2.55-build-system-fixes.patch
+++ b/sys-libs/libcap/files/libcap-2.55-build-system-fixes.patch
@@ -1,4 +1,4 @@
-From 4cdf9413b7b4ff27299c14f05d7a6fa038e4d59f Mon Sep 17 00:00:00 2001
+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
@@ -19,15 +19,6 @@ 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>
----
- Make.Rules | 13 +++++--------
- Makefile | 1 -
- pam_cap/Makefile | 2 +-
- progs/Makefile | 6 +++---
- 4 files changed, 9 insertions(+), 13 deletions(-)
-
-diff --git a/Make.Rules b/Make.Rules
-index 66207b4..1e0366e 100644
--- a/Make.Rules
+++ b/Make.Rules
@@ -64,24 +64,20 @@ KERNEL_HEADERS := $(topdir)/libcap/include/uapi
@@ -68,8 +59,6 @@ index 66207b4..1e0366e 100644
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 1c195dd..3f71b12 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,6 @@ ifeq ($(GOLANG),yes)
@@ -80,24 +69,89 @@ index 1c195dd..3f71b12 100644
$(MAKE) -C progs $@
$(MAKE) -C doc $@
$(MAKE) -C kdebug $@
-diff --git a/pam_cap/Makefile b/pam_cap/Makefile
-index d5da6be..0cba3e1 100644
+--- 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
-@@ -65,7 +65,7 @@ test_pam_cap: test_pam_cap.c pam_cap.c ../libcap/libcap.a
- $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ test_pam_cap.c $(LIBCAPLIB) $(LDFLAGS) --static
+@@ -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) -o $@ $+ -lpam -ldl $(LIBCAPLIB) $(LDFLAGS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $+ -lpam -ldl $(LIBCAPLIB)
test: testlink test_pam_cap pam_cap.so
$(MAKE) testlink
-diff --git a/progs/Makefile b/progs/Makefile
-index 51e9a63..98fe1b0 100644
--- a/progs/Makefile
+++ b/progs/Makefile
-@@ -22,13 +22,13 @@ DEPS = ../libcap/libcap.a
+@@ -22,16 +22,16 @@ DEPS = ../libcap/libcap.a
endif
../libcap/libcap.a:
@@ -110,10 +164,78 @@ index 51e9a63..98fe1b0 100644
$(BUILD): %: %.o $(DEPS)
- $(CC) $(CFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
-+ $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $< $(LIBCAPLIB) $(LDFLAGS)
++ $(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -o $@ $< $(LIBCAPLIB)
%.o: %.c $(INCS)
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
---
-2.33.0
-
+- $(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.55.ebuild b/sys-libs/libcap/libcap-2.55-r1.ebuild
similarity index 100%
rename from sys-libs/libcap/libcap-2.55.ebuild
rename to sys-libs/libcap/libcap-2.55-r1.ebuild
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-11-20 8:29 Sam James
0 siblings, 0 replies; 24+ messages in thread
From: Sam James @ 2021-11-20 8:29 UTC (permalink / raw
To: gentoo-commits
commit: 8b27cb9d5856f9461666b7e40bc047522ab91aed
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 20 08:28:30 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 20 08:29:41 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b27cb9d
sys-libs/libcap: backport alignment fixes
This fixes a segfault in the test suite for abi_x86_32 and musl.
Closes: https://bugs.gentoo.org/820071
Thanks-to: Arsen Arsenovic <arsen <AT> aarsen.me>
Thanks-to: Andrew G. Morgan <morgan <AT> kernel.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../files/libcap-2.60-libcap-alignment.patch | 105 +++++++++++++++++++++
sys-libs/libcap/libcap-2.60-r1.ebuild | 89 +++++++++++++++++
2 files changed, 194 insertions(+)
diff --git a/sys-libs/libcap/files/libcap-2.60-libcap-alignment.patch b/sys-libs/libcap/files/libcap-2.60-libcap-alignment.patch
new file mode 100644
index 000000000000..6081c7dc76e6
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.60-libcap-alignment.patch
@@ -0,0 +1,105 @@
+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
new file mode 100644
index 000000000000..658d67d374c6
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.60-r1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal toolchain-funcs pam usr-ldscript
+
+DESCRIPTION="POSIX 1003.1e capabilities"
+HOMEPAGE="https://sites.google.com/site/fullycapable/"
+SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz"
+
+# it's available under either of the licenses
+LICENSE="|| ( GPL-2 BSD )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="pam static-libs tools"
+
+# While the build system optionally uses gperf, we don't DEPEND on it because
+# the build automatically falls back when it's unavailable. #604802
+PDEPEND="pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )"
+DEPEND="${PDEPEND}
+ sys-kernel/linux-headers"
+BDEPEND="tools? ( dev-lang/go )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.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
+}
^ permalink raw reply related [flat|nested] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2021-12-14 0:44 Sam James
0 siblings, 0 replies; 24+ messages in thread
From: Sam James @ 2021-12-14 0:44 UTC (permalink / raw
To: gentoo-commits
commit: 2b505d02486bf1c863e50adf41d33b3a260a4751
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 14 00:44:21 2021 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec 14 00:44:21 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b505d02
sys-libs/libcap: add 2.62
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 +
....62-ignore-RAISE_SETFCAP-install-failures.patch | 26 ++++++
sys-libs/libcap/libcap-2.62.ebuild | 96 ++++++++++++++++++++++
3 files changed, 123 insertions(+)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index b783ac2f611d..4ec6770eefde 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.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.62-ignore-RAISE_SETFCAP-install-failures.patch b/sys-libs/libcap/files/libcap-2.62-ignore-RAISE_SETFCAP-install-failures.patch
new file mode 100644
index 000000000000..04c59357c45f
--- /dev/null
+++ b/sys-libs/libcap/files/libcap-2.62-ignore-RAISE_SETFCAP-install-failures.patch
@@ -0,0 +1,26 @@
+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>
+diff --git a/progs/Makefile b/progs/Makefile
+index 2cb7520..6d417de 100644
+--- a/progs/Makefile
++++ b/progs/Makefile
+@@ -39,7 +39,7 @@ install: all
+ 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/libcap-2.62.ebuild b/sys-libs/libcap/libcap-2.62.ebuild
new file mode 100644
index 000000000000..811890277ff9
--- /dev/null
+++ b/sys-libs/libcap/libcap-2.62.ebuild
@@ -0,0 +1,96 @@
+# 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 )"
+
+QA_FLAGS_IGNORED="sbin/captree" # go binaries don't use LDFLAGS
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.62-ignore-RAISE_SETFCAP-install-failures.patch
+)
+
+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] 24+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
@ 2022-01-04 11:21 David Seifert
0 siblings, 0 replies; 24+ messages in thread
From: David Seifert @ 2022-01-04 11:21 UTC (permalink / raw
To: gentoo-commits
commit: b7df2466d0b3dcdfc95886cc9a3005954c3f2c2e
Author: David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Jan 4 11:20:48 2022 +0000
Commit: David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Jan 4 11:20:48 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7df2466
sys-libs/libcap: drop 2.49-r1
Signed-off-by: David Seifert <soap <AT> gentoo.org>
sys-libs/libcap/Manifest | 1 -
sys-libs/libcap/files/libcap-2.21-include.patch | 10 --
....25-ignore-RAISE_SETFCAP-install-failures.patch | 24 ---
sys-libs/libcap/files/libcap-2.38-no_perl.patch | 62 --------
.../files/libcap-2.48-build-system-fixes.patch | 175 ---------------------
sys-libs/libcap/libcap-2.49-r1.ebuild | 87 ----------
6 files changed, 359 deletions(-)
diff --git a/sys-libs/libcap/Manifest b/sys-libs/libcap/Manifest
index 17b8bc94ee64..2f5d81e1e4b5 100644
--- a/sys-libs/libcap/Manifest
+++ b/sys-libs/libcap/Manifest
@@ -1,2 +1 @@
-DIST libcap-2.49.tar.xz 139568 BLAKE2B 5746dcdf2a737e747450bd50a701ee8543277b17b7fbf1304b79f707a088ea74dc6dc79c61ff89b55b718a460a7b0814f960f44d07944a97b832b78f4e14e07f SHA512 2934a2ded1370edeb9603dbf43d8ca23a2eb5d67efc5cec5d4ba96c707a8db2702da8aa9be0cb86c5ff100d37ec96115c7777a7566ad0ab2e0b4a288bbe357d0
DIST libcap-2.62.tar.xz 174772 BLAKE2B e3c86a5b88b9be932802ec8612f79e5f04912bf3e66f673eae2add85362292f4737c544d21b9e5adfd1a7a33c073568301b6532cdf0ea6c8b834d895b84323f1 SHA512 61ac004920c5cd3382a5443db2eacfc2041b7a8c0814b27084c1d111125639fe3950dea4325d0f7fb6bfb0d5de114452c3a62230cc958edb05ffdb83b213f9b3
diff --git a/sys-libs/libcap/files/libcap-2.21-include.patch b/sys-libs/libcap/files/libcap-2.21-include.patch
deleted file mode 100644
index 8ea6545659e3..000000000000
--- a/sys-libs/libcap/files/libcap-2.21-include.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/libcap/libcap.h
-+++ b/libcap/libcap.h
-@@ -13,6 +13,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/capability.h>
-+#include <sys/prctl.h> /* prctl() */
-
- #ifndef __u8
- #define __u8 unsigned char
diff --git a/sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch b/sys-libs/libcap/files/libcap-2.25-ignore-RAISE_SETFCAP-install-failures.patch
deleted file mode 100644
index e5455cd1ebb6..000000000000
--- a/sys-libs/libcap/files/libcap-2.25-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
-@@ -27,7 +27,7 @@ install: all
- 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
-
- clean:
diff --git a/sys-libs/libcap/files/libcap-2.38-no_perl.patch b/sys-libs/libcap/files/libcap-2.38-no_perl.patch
deleted file mode 100644
index 9104484d5770..000000000000
--- a/sys-libs/libcap/files/libcap-2.38-no_perl.patch
+++ /dev/null
@@ -1,62 +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
-@@ -22,6 +22,8 @@ MAJLIBNAME=$(LIBNAME).$(VERSION)
- MINLIBNAME=$(MAJLIBNAME).$(MINOR)
- GPERF_OUTPUT = _caps_output.gperf
- CFLAGS += -fPIC
-+AWK = awk
-+SED = sed
-
- all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME)
-
-@@ -55,17 +57,27 @@ 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 $@
-+ (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/files/libcap-2.48-build-system-fixes.patch b/sys-libs/libcap/files/libcap-2.48-build-system-fixes.patch
deleted file mode 100644
index b3986e19546c..000000000000
--- a/sys-libs/libcap/files/libcap-2.48-build-system-fixes.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From d0e5c20fda92fcc48109bce7055d5fad458579ca 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
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
---- 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,
---- 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
-@@ -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 $@
---- 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
---- 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)
---- 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 ../progs/tcapsh-static
diff --git a/sys-libs/libcap/libcap-2.49-r1.ebuild b/sys-libs/libcap/libcap-2.49-r1.ebuild
deleted file mode 100644
index 993d6f47b1c0..000000000000
--- a/sys-libs/libcap/libcap-2.49-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.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] 24+ messages in thread
end of thread, other threads:[~2022-01-04 11:21 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-26 12:27 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/ Lars Wendler
-- strict thread matches above, loose matches on Subject: below --
2022-01-04 11:21 David Seifert
2021-12-14 0:44 Sam James
2021-11-20 8:29 Sam James
2021-08-30 21:35 Sam James
2021-08-30 6:12 Sam James
2021-08-03 14:17 David Seifert
2021-08-03 10:27 Lars Wendler
2021-05-25 14:19 Lars Wendler
2021-02-05 10:59 Lars Wendler
2020-12-13 14:06 Lars Wendler
2020-10-08 22:53 Thomas Deutschmann
2020-07-13 9:10 Lars Wendler
2020-07-06 18:17 Lars Wendler
2020-05-05 8:25 Lars Wendler
2020-05-05 8:25 Lars Wendler
2020-01-17 14:58 Lars Wendler
2019-12-29 9:40 Lars Wendler
2019-12-28 9:41 Lars Wendler
2019-12-12 15:05 Lars Wendler
2018-11-21 10:22 Lars Wendler
2018-07-04 8:43 Lars Wendler
2017-02-09 16:04 Mike Frysinger
2016-02-10 9:05 Lars Wendler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox