public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/
Date: Mon, 30 Aug 2021 06:12:35 +0000 (UTC)	[thread overview]
Message-ID: <1630303947.377ecb31bade3f21c3b9648125eb00c3d23023b3.sam@gentoo> (raw)

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
+}


             reply	other threads:[~2021-08-30  6:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  6:12 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-01-04 11:21 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libcap/, sys-libs/libcap/files/ 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-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-26 12:27 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1630303947.377ecb31bade3f21c3b9648125eb00c3d23023b3.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox