1 |
commit: 66bea220735842af03e40bfe276f9e0864c54a7f |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Dec 28 17:58:00 2019 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Dec 28 18:02:24 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=66bea220 |
7 |
|
8 |
sys-libs/libcap: Separate libpsx stuff into own pkgconfig file |
9 |
|
10 |
Bug: https://bugs.gentoo.org/703932 |
11 |
Package-Manager: Portage-2.3.84, Repoman-2.3.20 |
12 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
13 |
|
14 |
sys-devel/gettext/gettext-0.20.1.ebuild | 3 +- |
15 |
.../files/libcap-2.29-libpsx_pkgconfig.patch | 88 ++++++++++++++++++++++ |
16 |
sys-libs/libcap/libcap-2.29-r2.ebuild | 85 +++++++++++++++++++++ |
17 |
3 files changed, 175 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/sys-devel/gettext/gettext-0.20.1.ebuild b/sys-devel/gettext/gettext-0.20.1.ebuild |
20 |
index 251b2681eb3..7de04392413 100644 |
21 |
--- a/sys-devel/gettext/gettext-0.20.1.ebuild |
22 |
+++ b/sys-devel/gettext/gettext-0.20.1.ebuild |
23 |
@@ -5,7 +5,7 @@ |
24 |
|
25 |
EAPI=7 |
26 |
|
27 |
-inherit mono-env libtool java-pkg-opt-2 multilib-minimal |
28 |
+inherit epunt-cxx mono-env libtool java-pkg-opt-2 multilib-minimal |
29 |
|
30 |
DESCRIPTION="GNU locale utilities" |
31 |
HOMEPAGE="https://www.gnu.org/software/gettext/" |
32 |
@@ -70,6 +70,7 @@ src_prepare() { |
33 |
|
34 |
default |
35 |
|
36 |
+ epunt_cxx |
37 |
elibtoolize |
38 |
} |
39 |
|
40 |
|
41 |
diff --git a/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch b/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch |
42 |
new file mode 100644 |
43 |
index 00000000000..413b27908b4 |
44 |
--- /dev/null |
45 |
+++ b/sys-libs/libcap/files/libcap-2.29-libpsx_pkgconfig.patch |
46 |
@@ -0,0 +1,88 @@ |
47 |
+From e13e5b24fb98dc3ec2f76bc51ed0d714460e75d8 Mon Sep 17 00:00:00 2001 |
48 |
+From: Lars Wendler <polynomial-c@g.o> |
49 |
+Date: Sat, 28 Dec 2019 18:48:35 +0100 |
50 |
+Subject: [PATCH] USe separate libpsx.pc file instead of libcap.pc |
51 |
+ |
52 |
+pkgconfig fails to parse current libcap.pc file but pkgconf succeeds |
53 |
+ |
54 |
+Gentoo-bug: https://bugs.gentoo.org/703932 |
55 |
+--- |
56 |
+ libcap/Makefile | 12 +++++++++++- |
57 |
+ libcap/libcap.pc.in | 7 ------- |
58 |
+ libcap/libpsx.pc.in | 12 ++++++++++++ |
59 |
+ 3 files changed, 23 insertions(+), 8 deletions(-) |
60 |
+ create mode 100644 libcap/libpsx.pc.in |
61 |
+ |
62 |
+diff --git a/libcap/Makefile b/libcap/Makefile |
63 |
+index 949cfad..5795458 100644 |
64 |
+--- a/libcap/Makefile |
65 |
++++ b/libcap/Makefile |
66 |
+@@ -22,7 +22,7 @@ MAJLIBNAME=$(LIBNAME).$(VERSION) |
67 |
+ MINLIBNAME=$(MAJLIBNAME).$(MINOR) |
68 |
+ GPERF_OUTPUT = _caps_output.gperf |
69 |
+ |
70 |
+-all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc $(STAPSXLIBNAME) |
71 |
++all: $(MINLIBNAME) $(STACAPLIBNAME) libcap.pc libpsx.pc $(STAPSXLIBNAME) |
72 |
+ |
73 |
+ ifeq ($(BUILD_GPERF),yes) |
74 |
+ USE_GPERF_OUTPUT = $(GPERF_OUTPUT) |
75 |
+@@ -38,6 +38,15 @@ libcap.pc: libcap.pc.in |
76 |
+ -e 's,@deps@,$(DEPS),' \ |
77 |
+ $< >$@ |
78 |
+ |
79 |
++libpsx.pc: libpsx.pc.in |
80 |
++ sed -e 's,@prefix@,$(prefix),' \ |
81 |
++ -e 's,@exec_prefix@,$(exec_prefix),' \ |
82 |
++ -e 's,@libdir@,$(LIBDIR),' \ |
83 |
++ -e 's,@includedir@,$(inc_prefix)/include,' \ |
84 |
++ -e 's,@VERSION@,$(VERSION).$(MINOR),' \ |
85 |
++ -e 's,@deps@,$(DEPS),' \ |
86 |
++ $< >$@ |
87 |
++ |
88 |
+ _makenames: _makenames.c cap_names.list.h |
89 |
+ $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@ |
90 |
+ |
91 |
+@@ -86,6 +95,7 @@ ifeq ($(FAKEROOT),) |
92 |
+ endif |
93 |
+ mkdir -p -m 0755 $(FAKEROOT)$(PKGCONFIGDIR) |
94 |
+ install -m 0644 libcap.pc $(FAKEROOT)$(PKGCONFIGDIR)/libcap.pc |
95 |
++ install -m 0644 libpsx.pc $(FAKEROOT)$(PKGCONFIGDIR)/libpsx.pc |
96 |
+ ifeq ($(GOLANG),yes) |
97 |
+ mkdir -p -m 0755 $(FAKEROOT)$(GOPKGDIR)/libcap/cap |
98 |
+ install -m 0644 src/libcap/cap/* $(FAKEROOT)$(GOPKGDIR)/libcap/cap/ |
99 |
+diff --git a/libcap/libcap.pc.in b/libcap/libcap.pc.in |
100 |
+index 3d6b273..69cd231 100644 |
101 |
+--- a/libcap/libcap.pc.in |
102 |
++++ b/libcap/libcap.pc.in |
103 |
+@@ -9,10 +9,3 @@ Version: @VERSION@ |
104 |
+ Libs: -L${libdir} -lcap |
105 |
+ Libs.private: @deps@ |
106 |
+ Cflags: -I${includedir} |
107 |
+- |
108 |
+-Name: libpsx |
109 |
+-Description: libpsx - linux posix syscall API for pthreads |
110 |
+-Version: @VERSION@ |
111 |
+-Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create |
112 |
+-Libs.private: @deps@ |
113 |
+-Cflags: -I${includedir} |
114 |
+diff --git a/libcap/libpsx.pc.in b/libcap/libpsx.pc.in |
115 |
+new file mode 100644 |
116 |
+index 0000000..8677a86 |
117 |
+--- /dev/null |
118 |
++++ b/libcap/libpsx.pc.in |
119 |
+@@ -0,0 +1,12 @@ |
120 |
++prefix=@prefix@ |
121 |
++exec_prefix=@exec_prefix@ |
122 |
++libdir=@libdir@ |
123 |
++includedir=@includedir@ |
124 |
++ |
125 |
++Name: libpsx |
126 |
++Description: libpsx - linux posix syscall API for pthreads |
127 |
++Version: @VERSION@ |
128 |
++Libs: -L${libdir} -lpsx -lpthread -Wl,-wrap,pthread_create |
129 |
++Libs.private: @deps@ |
130 |
++Cflags: -I${includedir} |
131 |
++Requires: libcap |
132 |
+-- |
133 |
+2.24.1 |
134 |
+ |
135 |
|
136 |
diff --git a/sys-libs/libcap/libcap-2.29-r2.ebuild b/sys-libs/libcap/libcap-2.29-r2.ebuild |
137 |
new file mode 100644 |
138 |
index 00000000000..267e188040d |
139 |
--- /dev/null |
140 |
+++ b/sys-libs/libcap/libcap-2.29-r2.ebuild |
141 |
@@ -0,0 +1,85 @@ |
142 |
+# Copyright 1999-2019 Gentoo Authors |
143 |
+# Distributed under the terms of the GNU General Public License v2 |
144 |
+ |
145 |
+EAPI=7 |
146 |
+ |
147 |
+inherit multilib multilib-minimal toolchain-funcs pam usr-ldscript |
148 |
+ |
149 |
+DESCRIPTION="POSIX 1003.1e capabilities" |
150 |
+HOMEPAGE="http://www.friedhoff.org/posixfilecaps.html" |
151 |
+SRC_URI="https://www.kernel.org/pub/linux/libs/security/linux-privs/libcap2/${P}.tar.xz" |
152 |
+ |
153 |
+# it's available under either of the licenses |
154 |
+LICENSE="|| ( GPL-2 BSD )" |
155 |
+SLOT="0" |
156 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux" |
157 |
+IUSE="pam static-libs" |
158 |
+ |
159 |
+# While the build system optionally uses gperf, we don't DEPEND on it because |
160 |
+# the build automatically falls back when it's unavailable. #604802 |
161 |
+RDEPEND=">=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] |
162 |
+ pam? ( sys-libs/pam[${MULTILIB_USEDEP}] )" |
163 |
+DEPEND="${RDEPEND} |
164 |
+ sys-kernel/linux-headers" |
165 |
+ |
166 |
+# Requires test suite being run as root (via sudo) |
167 |
+RESTRICT="test" |
168 |
+ |
169 |
+PATCHES=( |
170 |
+ "${FILESDIR}"/${PN}-2.29-build-system-fixes.patch |
171 |
+ "${FILESDIR}"/${PN}-2.28-no_perl.patch |
172 |
+ "${FILESDIR}"/${PN}-2.25-ignore-RAISE_SETFCAP-install-failures.patch |
173 |
+ "${FILESDIR}"/${PN}-2.21-include.patch |
174 |
+ "${FILESDIR}"/${PN}-2.29-libpsx_pkgconfig.patch |
175 |
+) |
176 |
+ |
177 |
+src_prepare() { |
178 |
+ default |
179 |
+ multilib_copy_sources |
180 |
+} |
181 |
+ |
182 |
+run_emake() { |
183 |
+ local args=( |
184 |
+ exec_prefix="${EPREFIX}" |
185 |
+ lib_prefix="${EPREFIX}/usr" |
186 |
+ lib="$(get_libdir)" |
187 |
+ prefix="${EPREFIX}/usr" |
188 |
+ PAM_CAP="$(usex pam yes no)" |
189 |
+ DYNAMIC=yes |
190 |
+ GOLANG=no |
191 |
+ ) |
192 |
+ emake "${args[@]}" "$@" |
193 |
+} |
194 |
+ |
195 |
+multilib_src_compile() { |
196 |
+ tc-export AR CC RANLIB |
197 |
+ local BUILD_CC |
198 |
+ tc-export_build_env BUILD_CC |
199 |
+ |
200 |
+ run_emake |
201 |
+} |
202 |
+ |
203 |
+multilib_src_install() { |
204 |
+ # no configure, needs explicit install line #444724#c3 |
205 |
+ run_emake DESTDIR="${D}" install |
206 |
+ |
207 |
+ gen_usr_ldscript -a cap |
208 |
+ if ! use static-libs ; then |
209 |
+ # Don't remove libpsx.a! |
210 |
+ # See https://bugs.gentoo.org/703912 |
211 |
+ rm "${ED}"/usr/$(get_libdir)/libcap.a || die |
212 |
+ fi |
213 |
+ |
214 |
+ if [[ -d "${ED}"/usr/$(get_libdir)/security ]] ; then |
215 |
+ rm -r "${ED}"/usr/$(get_libdir)/security || die |
216 |
+ fi |
217 |
+ |
218 |
+ if use pam; then |
219 |
+ dopammod pam_cap/pam_cap.so |
220 |
+ dopamsecurity '' pam_cap/capability.conf |
221 |
+ fi |
222 |
+} |
223 |
+ |
224 |
+multilib_src_install_all() { |
225 |
+ dodoc CHANGELOG README doc/capability.notes |
226 |
+} |