Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:musl commit in: sys-apps/attr/, sys-apps/attr/files/
Date: Wed, 22 Jan 2014 17:10:07
Message-Id: 1390405952.4a4389ddacf2d3d39825a40e7b8c4c5e5d662f11.blueness@gentoo
1 commit: 4a4389ddacf2d3d39825a40e7b8c4c5e5d662f11
2 Author: layman <layman <AT> localhost>
3 AuthorDate: Tue Jan 21 22:39:38 2014 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 22 15:52:32 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=4a4389dd
7
8 sys-apps/attr: ifdef __cplusplus
9
10 ---
11 sys-apps/attr/attr-2.4.46-r99.ebuild | 55 +++++++
12 sys-apps/attr/files/attr-2.4.44-gettext.patch | 63 ++++++++
13 sys-apps/attr/files/attr-2.4.46-config-shell.patch | 53 ++++++
14 .../attr/files/attr-2.4.46-generic-syscalls.patch | 180 +++++++++++++++++++++
15 .../attr/files/attr-2.4.46-ifdef_cplusplus.patch | 24 +++
16 sys-apps/attr/metadata.xml | 5 +
17 6 files changed, 380 insertions(+)
18
19 diff --git a/sys-apps/attr/attr-2.4.46-r99.ebuild b/sys-apps/attr/attr-2.4.46-r99.ebuild
20 new file mode 100644
21 index 0000000..b70a258
22 --- /dev/null
23 +++ b/sys-apps/attr/attr-2.4.46-r99.ebuild
24 @@ -0,0 +1,55 @@
25 +# Copyright 1999-2014 Gentoo Foundation
26 +# Distributed under the terms of the GNU General Public License v2
27 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/attr/attr-2.4.46-r2.ebuild,v 1.13 2014/01/17 04:23:10 vapier Exp $
28 +
29 +EAPI="4"
30 +
31 +inherit eutils toolchain-funcs
32 +
33 +DESCRIPTION="Extended attributes tools"
34 +HOMEPAGE="http://savannah.nongnu.org/projects/attr"
35 +SRC_URI="mirror://nongnu/${PN}/${P}.src.tar.gz"
36 +
37 +LICENSE="LGPL-2.1"
38 +SLOT="0"
39 +KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
40 +IUSE="nls static-libs"
41 +
42 +DEPEND="nls? ( sys-devel/gettext )
43 + sys-devel/autoconf"
44 +RDEPEND=""
45 +
46 +src_prepare() {
47 + epatch "${FILESDIR}"/${PN}-2.4.44-gettext.patch
48 + epatch "${FILESDIR}"/${PN}-2.4.46-config-shell.patch #366671
49 + epatch "${FILESDIR}"/${PN}-2.4.46-generic-syscalls.patch #460702
50 + epatch "${FILESDIR}"/${PN}-2.4.46-ifdef_cplusplus.patch
51 + sed -i \
52 + -e "/^PKG_DOC_DIR/s:@pkg_name@:${PF}:" \
53 + -e '/HAVE_ZIPPED_MANPAGES/s:=.*:=false:' \
54 + include/builddefs.in \
55 + || die "failed to update builddefs"
56 + strip-linguas -u po
57 +}
58 +
59 +src_configure() {
60 + unset PLATFORM #184564
61 + export OPTIMIZER=${CFLAGS}
62 + export DEBUG=-DNDEBUG
63 +
64 + econf \
65 + $(use_enable nls gettext) \
66 + --enable-shared $(use_enable static-libs static) \
67 + --libexecdir="${EPREFIX}"/usr/$(get_libdir) \
68 + --bindir="${EPREFIX}"/bin
69 +}
70 +
71 +src_install() {
72 + emake DIST_ROOT="${D}" install install-lib install-dev || die
73 + use static-libs || find "${D}" -name '*.la' -delete
74 + # the man-pages packages provides the man2 files
75 + rm -r "${ED}"/usr/share/man/man2
76 +
77 + # we install attr into /bin, so we need the shared lib with it
78 + gen_usr_ldscript -a attr
79 +}
80
81 diff --git a/sys-apps/attr/files/attr-2.4.44-gettext.patch b/sys-apps/attr/files/attr-2.4.44-gettext.patch
82 new file mode 100644
83 index 0000000..49c2d32
84 --- /dev/null
85 +++ b/sys-apps/attr/files/attr-2.4.44-gettext.patch
86 @@ -0,0 +1,63 @@
87 +--- include/gettext.h
88 ++++ include/gettext.h
89 +@@ -0,0 +1,10 @@
90 ++#include <config.h>
91 ++#ifdef ENABLE_GETTEXT
92 ++# include <libintl.h>
93 ++# define _(x) gettext(x)
94 ++#else
95 ++# define _(x) (x)
96 ++# define textdomain(d) do { } while (0)
97 ++# define bindtextdomain(d,dir) do { } while (0)
98 ++#endif
99 ++#include <locale.h>
100 +--- attr/attr.c
101 ++++ attr/attr.c
102 +@@ -26,6 +26,7 @@
103 + #include <errno.h>
104 + #include <string.h>
105 + #include <locale.h>
106 ++#include "gettext.h"
107 +
108 + #include <attr/attributes.h>
109 + #include "config.h"
110 +--- libattr/attr_copy_file.c.orig 2007-09-20 02:51:37.000000000 -0400
111 ++++ libattr/attr_copy_file.c 2007-09-20 02:51:51.000000000 -0400
112 +@@ -19,6 +19,7 @@
113 +
114 + #if defined (HAVE_CONFIG_H)
115 + #include "config.h"
116 ++#include "gettext.h"
117 + #endif
118 +
119 + #include <sys/types.h>
120 +--- libattr/attr_copy_fd.c.orig 2007-09-20 02:52:23.000000000 -0400
121 ++++ libattr/attr_copy_fd.c 2007-09-20 02:52:31.000000000 -0400
122 +@@ -19,6 +19,7 @@
123 +
124 + #if defined (HAVE_CONFIG_H)
125 + #include "config.h"
126 ++#include "gettext.h"
127 + #endif
128 +
129 + #include <sys/types.h>
130 +--- getfattr/getfattr.c.orig 2007-09-20 02:52:49.000000000 -0400
131 ++++ getfattr/getfattr.c 2007-09-20 02:52:59.000000000 -0400
132 +@@ -30,6 +30,7 @@
133 + #include <regex.h>
134 + #include <ftw.h>
135 + #include <locale.h>
136 ++#include "gettext.h"
137 +
138 + #include <attr/xattr.h>
139 + #include "config.h"
140 +--- setfattr/setfattr.c.orig 2007-09-20 02:53:12.000000000 -0400
141 ++++ setfattr/setfattr.c 2007-09-20 02:53:20.000000000 -0400
142 +@@ -28,6 +28,7 @@
143 + #include <getopt.h>
144 + #include <locale.h>
145 + #include <ctype.h>
146 ++#include "gettext.h"
147 +
148 + #include <attr/xattr.h>
149 + #include "config.h"
150
151 diff --git a/sys-apps/attr/files/attr-2.4.46-config-shell.patch b/sys-apps/attr/files/attr-2.4.46-config-shell.patch
152 new file mode 100644
153 index 0000000..b6660e6
154 --- /dev/null
155 +++ b/sys-apps/attr/files/attr-2.4.46-config-shell.patch
156 @@ -0,0 +1,53 @@
157 +https://bugs.gentoo.org/366671
158 +
159 +From 10bfb16245ec4b55c1f5b6dc5554913bc9b13c9c Mon Sep 17 00:00:00 2001
160 +From: Mike Frysinger <vapier@g.o>
161 +Date: Mon, 16 May 2011 01:59:52 -0400
162 +Subject: [PATCH] use SHELL from configure
163 +
164 +If /bin/sh is not a functional enough shell, configure will select a
165 +SHELL of /bin/bash or better. But the current build helpers always
166 +hardcode /bin/sh, so if libtool itself configures itself for /bin/bash,
167 +things will fail when it attempts to do:
168 + SHELL = /bin/sh
169 + LIBTOOL = $(SHELL) .../libtool
170 + ...
171 + eval: 1: base_compile+= -pipe: not found
172 + ...
173 +
174 +So rather than hardcoding SHELL to /bin/sh, set it to @SHELL@ and let
175 +configure find a good value for us.
176 +
177 +Signed-off-by: Mike Frysinger <vapier@g.o>
178 +---
179 + include/builddefs.in | 1 +
180 + include/buildmacros | 1 -
181 + 2 files changed, 1 insertions(+), 1 deletions(-)
182 +
183 +diff --git a/include/builddefs.in b/include/builddefs.in
184 +index d054a56..434ce95 100644
185 +--- a/include/builddefs.in
186 ++++ b/include/builddefs.in
187 +@@ -46,6 +46,7 @@ MAKE = @make@
188 + ECHO = @echo@
189 + SORT = @sort@
190 + LN_S = @LN_S@
191 ++SHELL = @SHELL@
192 + LIBTOOL = @LIBTOOL@
193 + MAKEDEPEND = @makedepend@
194 +
195 +diff --git a/include/buildmacros b/include/buildmacros
196 +index ab89182..8efb32e 100644
197 +--- a/include/buildmacros
198 ++++ b/include/buildmacros
199 +@@ -42,7 +42,6 @@ OBJECTS = $(ASFILES:.s=.o) \
200 +
201 + INSTALL = $(TOPDIR)/include/install-sh -o $(PKG_USER) -g $(PKG_GROUP)
202 +
203 +-SHELL = /bin/sh
204 + IMAGES_DIR = $(TOPDIR)/all-images
205 + DIST_DIR = $(TOPDIR)/dist
206 +
207 +--
208 +1.7.5.rc3
209 +
210
211 diff --git a/sys-apps/attr/files/attr-2.4.46-generic-syscalls.patch b/sys-apps/attr/files/attr-2.4.46-generic-syscalls.patch
212 new file mode 100644
213 index 0000000..d12fcd2
214 --- /dev/null
215 +++ b/sys-apps/attr/files/attr-2.4.46-generic-syscalls.patch
216 @@ -0,0 +1,180 @@
217 +http://lists.nongnu.org/archive/html/acl-devel/2012-12/msg00000.html
218 +https://bugs.gentoo.org/460702
219 +
220 +--- a/libattr/syscalls.c
221 ++++ b/libattr/syscalls.c
222 +@@ -23,172 +23,10 @@
223 +
224 + #include <errno.h>
225 + #include <unistd.h>
226 ++#include <sys/syscall.h>
227 +
228 +-#if defined (__i386__)
229 ++#if defined (__NR_setxattr)
230 + # define HAVE_XATTR_SYSCALLS 1
231 +-# define __NR_setxattr 226
232 +-# define __NR_lsetxattr 227
233 +-# define __NR_fsetxattr 228
234 +-# define __NR_getxattr 229
235 +-# define __NR_lgetxattr 230
236 +-# define __NR_fgetxattr 231
237 +-# define __NR_listxattr 232
238 +-# define __NR_llistxattr 233
239 +-# define __NR_flistxattr 234
240 +-# define __NR_removexattr 235
241 +-# define __NR_lremovexattr 236
242 +-# define __NR_fremovexattr 237
243 +-#elif defined (__sparc__)
244 +-# define HAVE_XATTR_SYSCALLS 1
245 +-# define __NR_setxattr 169
246 +-# define __NR_lsetxattr 170
247 +-# define __NR_fsetxattr 171
248 +-# define __NR_getxattr 172
249 +-# define __NR_lgetxattr 173
250 +-# define __NR_fgetxattr 177
251 +-# define __NR_listxattr 178
252 +-# define __NR_llistxattr 179
253 +-# define __NR_flistxattr 180
254 +-# define __NR_removexattr 181
255 +-# define __NR_lremovexattr 182
256 +-# define __NR_fremovexattr 186
257 +-#elif defined (__ia64__)
258 +-# define HAVE_XATTR_SYSCALLS 1
259 +-# define __NR_setxattr 1217
260 +-# define __NR_lsetxattr 1218
261 +-# define __NR_fsetxattr 1219
262 +-# define __NR_getxattr 1220
263 +-# define __NR_lgetxattr 1221
264 +-# define __NR_fgetxattr 1222
265 +-# define __NR_listxattr 1223
266 +-# define __NR_llistxattr 1224
267 +-# define __NR_flistxattr 1225
268 +-# define __NR_removexattr 1226
269 +-# define __NR_lremovexattr 1227
270 +-# define __NR_fremovexattr 1228
271 +-#elif defined (__powerpc__)
272 +-# define HAVE_XATTR_SYSCALLS 1
273 +-# define __NR_setxattr 209
274 +-# define __NR_lsetxattr 210
275 +-# define __NR_fsetxattr 211
276 +-# define __NR_getxattr 212
277 +-# define __NR_lgetxattr 213
278 +-# define __NR_fgetxattr 214
279 +-# define __NR_listxattr 215
280 +-# define __NR_llistxattr 216
281 +-# define __NR_flistxattr 217
282 +-# define __NR_removexattr 218
283 +-# define __NR_lremovexattr 219
284 +-# define __NR_fremovexattr 220
285 +-#elif defined (__x86_64__)
286 +-# define HAVE_XATTR_SYSCALLS 1
287 +-# define __NR_setxattr 188
288 +-# define __NR_lsetxattr 189
289 +-# define __NR_fsetxattr 190
290 +-# define __NR_getxattr 191
291 +-# define __NR_lgetxattr 192
292 +-# define __NR_fgetxattr 193
293 +-# define __NR_listxattr 194
294 +-# define __NR_llistxattr 195
295 +-# define __NR_flistxattr 196
296 +-# define __NR_removexattr 197
297 +-# define __NR_lremovexattr 198
298 +-# define __NR_fremovexattr 199
299 +-#elif defined (__s390__)
300 +-# define HAVE_XATTR_SYSCALLS 1
301 +-# define __NR_setxattr 224
302 +-# define __NR_lsetxattr 225
303 +-# define __NR_fsetxattr 226
304 +-# define __NR_getxattr 227
305 +-# define __NR_lgetxattr 228
306 +-# define __NR_fgetxattr 229
307 +-# define __NR_listxattr 230
308 +-# define __NR_llistxattr 231
309 +-# define __NR_flistxattr 232
310 +-# define __NR_removexattr 233
311 +-# define __NR_lremovexattr 234
312 +-# define __NR_fremovexattr 235
313 +-#elif defined (__arm__)
314 +-# define HAVE_XATTR_SYSCALLS 1
315 +-# if defined(__ARM_EABI__) || defined(__thumb__)
316 +-# define __NR_SYSCALL_BASE 0
317 +-# else
318 +-# define __NR_SYSCALL_BASE 0x900000
319 +-# endif
320 +-# define __NR_setxattr (__NR_SYSCALL_BASE+226)
321 +-# define __NR_lsetxattr (__NR_SYSCALL_BASE+227)
322 +-# define __NR_fsetxattr (__NR_SYSCALL_BASE+228)
323 +-# define __NR_getxattr (__NR_SYSCALL_BASE+229)
324 +-# define __NR_lgetxattr (__NR_SYSCALL_BASE+230)
325 +-# define __NR_fgetxattr (__NR_SYSCALL_BASE+231)
326 +-# define __NR_listxattr (__NR_SYSCALL_BASE+232)
327 +-# define __NR_llistxattr (__NR_SYSCALL_BASE+233)
328 +-# define __NR_flistxattr (__NR_SYSCALL_BASE+234)
329 +-# define __NR_removexattr (__NR_SYSCALL_BASE+235)
330 +-# define __NR_lremovexattr (__NR_SYSCALL_BASE+236)
331 +-# define __NR_fremovexattr (__NR_SYSCALL_BASE+237)
332 +-#elif defined (__mips64)
333 +-# define HAVE_XATTR_SYSCALLS 1
334 +-# ifdef __LP64__ /* mips64 using n64 ABI */
335 +-# define __NR_Linux 5000
336 +-# else /* mips64 using n32 ABI */
337 +-# define __NR_Linux 6000
338 +-# endif
339 +-# define __NR_setxattr (__NR_Linux + 180)
340 +-# define __NR_lsetxattr (__NR_Linux + 181)
341 +-# define __NR_fsetxattr (__NR_Linux + 182)
342 +-# define __NR_getxattr (__NR_Linux + 183)
343 +-# define __NR_lgetxattr (__NR_Linux + 184)
344 +-# define __NR_fgetxattr (__NR_Linux + 185)
345 +-# define __NR_listxattr (__NR_Linux + 186)
346 +-# define __NR_llistxattr (__NR_Linux + 187)
347 +-# define __NR_flistxattr (__NR_Linux + 188)
348 +-# define __NR_removexattr (__NR_Linux + 189)
349 +-# define __NR_lremovexattr (__NR_Linux + 190)
350 +-# define __NR_fremovexattr (__NR_Linux + 191)
351 +-#elif defined (__mips__) /* mips32, or mips64 using o32 ABI */
352 +-# define HAVE_XATTR_SYSCALLS 1
353 +-# define __NR_Linux 4000
354 +-# define __NR_setxattr (__NR_Linux + 224)
355 +-# define __NR_lsetxattr (__NR_Linux + 225)
356 +-# define __NR_fsetxattr (__NR_Linux + 226)
357 +-# define __NR_getxattr (__NR_Linux + 227)
358 +-# define __NR_lgetxattr (__NR_Linux + 228)
359 +-# define __NR_fgetxattr (__NR_Linux + 229)
360 +-# define __NR_listxattr (__NR_Linux + 230)
361 +-# define __NR_llistxattr (__NR_Linux + 231)
362 +-# define __NR_flistxattr (__NR_Linux + 232)
363 +-# define __NR_removexattr (__NR_Linux + 233)
364 +-# define __NR_lremovexattr (__NR_Linux + 234)
365 +-# define __NR_fremovexattr (__NR_Linux + 235)
366 +-#elif defined (__alpha__)
367 +-# define HAVE_XATTR_SYSCALLS 1
368 +-# define __NR_setxattr 382
369 +-# define __NR_lsetxattr 383
370 +-# define __NR_fsetxattr 384
371 +-# define __NR_getxattr 385
372 +-# define __NR_lgetxattr 386
373 +-# define __NR_fgetxattr 387
374 +-# define __NR_listxattr 388
375 +-# define __NR_llistxattr 389
376 +-# define __NR_flistxattr 390
377 +-# define __NR_removexattr 391
378 +-# define __NR_lremovexattr 392
379 +-# define __NR_fremovexattr 393
380 +-#elif defined (__mc68000__)
381 +-# define HAVE_XATTR_SYSCALLS 1
382 +-# define __NR_setxattr 223
383 +-# define __NR_lsetxattr 224
384 +-# define __NR_fsetxattr 225
385 +-# define __NR_getxattr 226
386 +-# define __NR_lgetxattr 227
387 +-# define __NR_fgetxattr 228
388 +-# define __NR_listxattr 229
389 +-# define __NR_llistxattr 230
390 +-# define __NR_flistxattr 231
391 +-# define __NR_removexattr 232
392 +-# define __NR_lremovexattr 233
393 +-# define __NR_fremovexattr 234
394 + #else
395 + # warning "Extended attribute syscalls undefined for this architecture"
396 + # define HAVE_XATTR_SYSCALLS 0
397
398 diff --git a/sys-apps/attr/files/attr-2.4.46-ifdef_cplusplus.patch b/sys-apps/attr/files/attr-2.4.46-ifdef_cplusplus.patch
399 new file mode 100644
400 index 0000000..7b01afe
401 --- /dev/null
402 +++ b/sys-apps/attr/files/attr-2.4.46-ifdef_cplusplus.patch
403 @@ -0,0 +1,24 @@
404 +diff -Naur attr-2.4.46.orig/include/xattr.h attr-2.4.46/include/xattr.h
405 +--- attr-2.4.46.orig/include/xattr.h 2014-01-21 22:14:56.418790180 +0000
406 ++++ attr-2.4.46/include/xattr.h 2014-01-21 22:14:19.626788123 +0000
407 +@@ -31,7 +31,11 @@
408 + #define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
409 +
410 +
411 ++#ifdef __cpluplus
412 + __BEGIN_DECLS
413 ++#else
414 ++#define __THROW
415 ++#endif
416 +
417 + extern int setxattr (const char *__path, const char *__name,
418 + const void *__value, size_t __size, int __flags) __THROW;
419 +@@ -58,6 +62,8 @@
420 + extern int lremovexattr (const char *__path, const char *__name) __THROW;
421 + extern int fremovexattr (int __filedes, const char *__name) __THROW;
422 +
423 ++#ifdef __cpluplus
424 + __END_DECLS
425 ++#endif
426 +
427 + #endif /* __XATTR_H__ */
428
429 diff --git a/sys-apps/attr/metadata.xml b/sys-apps/attr/metadata.xml
430 new file mode 100644
431 index 0000000..96a2d58
432 --- /dev/null
433 +++ b/sys-apps/attr/metadata.xml
434 @@ -0,0 +1,5 @@
435 +<?xml version="1.0" encoding="UTF-8"?>
436 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
437 +<pkgmetadata>
438 +<herd>base-system</herd>
439 +</pkgmetadata>