Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-dev:uclibc commit in: app-arch/tar/files/, app-arch/tar/
Date: Thu, 28 Nov 2013 19:27:25
Message-Id: 1385666892.bab4d804668603d12366ee3d0d5e295dbebf39b8.blueness@gentoo
1 commit: bab4d804668603d12366ee3d0d5e295dbebf39b8
2 Author: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
3 AuthorDate: Thu Nov 28 19:28:12 2013 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Thu Nov 28 19:28:12 2013 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/hardened-dev.git;a=commit;h=bab4d804
7
8 app-arch/tar: use <sys/xattr.h> if available, fixex bug #489170
9
10 ---
11 app-arch/tar/files/rmt | 8 +
12 app-arch/tar/files/tar-1.27.1-sys-attr.patch | 126 +++++++++
13 app-arch/tar/files/tar.1-1.27 | 388 +++++++++++++++++++++++++++
14 app-arch/tar/metadata.xml | 11 +
15 app-arch/tar/tar-1.27.1-r99.ebuild | 79 ++++++
16 5 files changed, 612 insertions(+)
17
18 diff --git a/app-arch/tar/files/rmt b/app-arch/tar/files/rmt
19 new file mode 100644
20 index 0000000..15ed6aa
21 --- /dev/null
22 +++ b/app-arch/tar/files/rmt
23 @@ -0,0 +1,8 @@
24 +#!/bin/sh
25 +#
26 +# This is not a mistake. This shell script (/etc/rmt) has been provided
27 +# for compatibility with other Unix-like systems, some of which have
28 +# utilities that expect to find (and execute) rmt in the /etc directory
29 +# on remote systems.
30 +#
31 +exec rmt "$@"
32
33 diff --git a/app-arch/tar/files/tar-1.27.1-sys-attr.patch b/app-arch/tar/files/tar-1.27.1-sys-attr.patch
34 new file mode 100644
35 index 0000000..d999fd9
36 --- /dev/null
37 +++ b/app-arch/tar/files/tar-1.27.1-sys-attr.patch
38 @@ -0,0 +1,126 @@
39 +From: Anthony G. Basile <blueness@g.o>
40 +
41 +The build system searches for <attr/xattr.h> and doesn't bother
42 +looking to see if setxattr(), getxattr() and friends are provided
43 +by the system libc. Worse, on successfully finding <attr/xattr.h>
44 +it then proceeds to include it but then links against libc for
45 +the *xattr() functions.
46 +
47 +This patch has the build system look for <sys/xattr.h> first and
48 +if it success, links against libc. On failing to find <sys/xattr.h>,
49 +it then search for <attr/xattr.h> and links against libattr.so. This
50 +can happen, for instance, on a uClibc system where UCLIBC_HAS_XATTR
51 +is not set, but libattr.so is present. Then the *xattr() functions
52 +must be provided by libattr.so.
53 +
54 +X-Gentoo-Bug: 489170
55 +X-Gentoo-Bug-URL: https://bugs.gentoo.org/489170
56 +
57 +diff --git a/acinclude.m4 b/acinclude.m4
58 +index d48c881..18cfd49 100644
59 +--- a/acinclude.m4
60 ++++ b/acinclude.m4
61 +@@ -37,18 +37,40 @@ AC_DEFUN([TAR_HEADERS_ATTR_XATTR_H],
62 + [], [with_xattrs=maybe]
63 + )
64 +
65 +- AC_CHECK_HEADERS([attr/xattr.h])
66 +- AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes])
67 +- if test "$ac_cv_header_attr_xattr_h" = yes; then
68 ++ # First check for <sys/xattr.h>
69 ++ AC_CHECK_HEADERS([sys/xattr.h])
70 ++ AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_sys_xattr_h" = yes])
71 ++ AM_CONDITIONAL([TAR_LIB_ATTR],[false])
72 ++ if test "$ac_cv_header_sys_xattr_h" = yes; then
73 + AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \
74 + setxattr fsetxattr lsetxattr \
75 + listxattr flistxattr llistxattr,
76 + # only when functions are present
77 +- AC_DEFINE([HAVE_ATTR_XATTR_H], [1],
78 +- [define to 1 if we have <attr/xattr.h> header])
79 ++ AC_DEFINE([HAVE_SYS_XATTR_H], [1],
80 ++ [define to 1 if we have <sys/xattr.h> header])
81 + if test "$with_xattrs" != no; then
82 + AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.])
83 + fi
84 + )
85 + fi
86 ++
87 ++ # If <sys/xattr.h> is not found, then check for <attr/xattr.h>
88 ++ if test "$ac_cv_header_sys_xattr_h" != yes; then
89 ++ AC_CHECK_HEADERS([attr/xattr.h])
90 ++ AM_CONDITIONAL([TAR_COND_XATTR_H],[test "$ac_cv_header_attr_xattr_h" = yes])
91 ++ AC_CHECK_LIB([attr],[fgetxattr])
92 ++ AM_CONDITIONAL([TAR_LIB_ATTR],[test "$ac_cv_lib_attr_fgetxattr" = yes])
93 ++ if test "$ac_cv_header_attr_xattr_h" = yes; then
94 ++ AC_CHECK_FUNCS(getxattr fgetxattr lgetxattr \
95 ++ setxattr fsetxattr lsetxattr \
96 ++ listxattr flistxattr llistxattr,
97 ++ # only when functions are present
98 ++ AC_DEFINE([HAVE_ATTR_XATTR_H], [1],
99 ++ [define to 1 if we have <attr/xattr.h> header])
100 ++ if test "$with_xattrs" != no; then
101 ++ AC_DEFINE([HAVE_XATTRS],,[Define when we have working linux xattrs.])
102 ++ fi
103 ++ )
104 ++ fi
105 ++ fi
106 + ])
107 +diff --git a/config.h.in b/config.h.in
108 +index 62023cf..c8d7c33 100644
109 +--- a/config.h.in
110 ++++ b/config.h.in
111 +@@ -973,6 +973,9 @@
112 + /* Define to 1 if you have the `lgetxattr' function. */
113 + #undef HAVE_LGETXATTR
114 +
115 ++/* Define to 1 if you have the `attr' library (-lattr). */
116 ++#undef HAVE_LIBATTR
117 ++
118 + /* Define to 1 if you have the <libintl.h> header file. */
119 + #undef HAVE_LIBINTL_H
120 +
121 +@@ -1977,6 +1980,9 @@
122 + /* Define to 1 if you have the <sys/wait.h> header file. */
123 + #undef HAVE_SYS_WAIT_H
124 +
125 ++/* define to 1 if we have <sys/xattr.h> header */
126 ++#undef HAVE_SYS_XATTR_H
127 ++
128 + /* Define if struct tm has the tm_gmtoff member. */
129 + #undef HAVE_TM_GMTOFF
130 +
131 +diff --git a/lib/xattr-at.h b/lib/xattr-at.h
132 +index 2981771..1f517d0 100644
133 +--- a/lib/xattr-at.h
134 ++++ b/lib/xattr-at.h
135 +@@ -20,7 +20,15 @@
136 + #define XATTRS_AT_H
137 +
138 + #include <sys/types.h>
139 +-#include <attr/xattr.h>
140 ++#if defined(HAVE_SYS_XATTR_H)
141 ++# include <sys/xattr.h>
142 ++#elif defined(HAVE_ATTR_XATTR_H)
143 ++# include <attr/xattr.h>
144 ++#endif
145 ++
146 ++#ifndef ENOATTR
147 ++# define ENOATTR ENODATA /* No such attribute */
148 ++#endif
149 +
150 + /* These are the dir-fd-relative variants of the functions without the
151 + "at" suffix. For example, setxattrat (AT_FDCWD, path, name, value, size,
152 +diff --git a/src/Makefile.am b/src/Makefile.am
153 +index 07c117d..d871256 100644
154 +--- a/src/Makefile.am
155 ++++ b/src/Makefile.am
156 +@@ -50,4 +50,8 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
157 +
158 + LDADD = ../lib/libtar.a ../gnu/libgnu.a $(LIBINTL) $(LIBICONV)
159 +
160 ++if TAR_LIB_ATTR
161 ++LIBADD = -lattr
162 ++endif
163 ++
164 + tar_LDADD = $(LIBS) $(LDADD) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_SELINUX)
165
166 diff --git a/app-arch/tar/files/tar.1-1.27 b/app-arch/tar/files/tar.1-1.27
167 new file mode 100644
168 index 0000000..700b569
169 --- /dev/null
170 +++ b/app-arch/tar/files/tar.1-1.27
171 @@ -0,0 +1,388 @@
172 +.\" generated by script on Mon Oct 21 08:29:21 2013
173 +.Dd Oct 21, 2013
174 +.Dt TAR 1
175 +.Sh NAME
176 +.Nm tar
177 +.Nd The GNU version of the tar archiving utility
178 +.Sh SYNOPSIS
179 +.Nm tar
180 +.Oo Fl Oc Cm A Fl \-catenate \-concatenate Cm \||\| c Fl \-create Cm \||\| d Fl \-diff \-compare Cm \||\| Fl \-delete Cm \||\| r Fl \-append Cm \||\| t Fl \-list Cm \||\| Fl \-test\-label Cm \||\| u Fl \-update Cm \||\| x Fl \-extract \-get
181 +.Op Ar options
182 +.Op Ar pathname ...
183 +.Sh DESCRIPTION
184 +.Nm Tar
185 +stores and extracts files from a tape or disk archive.
186 +.Pp
187 +The first argument to
188 +tar
189 +should be a function; either one of the letters
190 +.Cm Acdrtux ,
191 +or one of the long function names.
192 +A function letter need not be prefixed with ``\-'', and may be combined
193 +with other single-letter options.
194 +A long function name must be prefixed with
195 +.Cm \\-\\- .
196 +Some options take a parameter; with the single-letter form
197 +these must be given as separate arguments.
198 +With the long form, they may be given by appending
199 +.Cm = Ns Ar value
200 +to the option.
201 +.Sh FUNCTION LETTERS
202 +Main operation mode:
203 +.Bl -tag -width flag
204 +.It Fl A , Fl \-catenate , Fl \-concatenate
205 +append tar files to an archive
206 +.It Fl c , Fl \-create
207 +create a new archive
208 +.It Fl d , Fl \-diff , Fl \-compare
209 +find differences between archive and file system
210 +.It Fl \-delete
211 +delete from the archive (not on mag tapes!)
212 +.It Fl r , Fl \-append
213 +append files to the end of an archive
214 +.It Fl t , Fl \-list
215 +list the contents of an archive
216 +.It Fl \-test\-label
217 +test the archive volume label and exit
218 +.It Fl u , Fl \-update
219 +only append files newer than copy in archive
220 +.It Fl x , Fl \-extract , Fl \-get
221 +extract files from an archive
222 +.El
223 +.Sh OTHER OPTIONS
224 +Operation modifiers:
225 +.Bl -tag -width flag
226 +.It \-[0\-7][lmh]
227 +specify drive and density
228 +.It Fl a , Fl \-auto\-compress
229 +use archive suffix to determine the compression program
230 +.It Fl \-acls
231 +Enable the POSIX ACLs support
232 +.It Fl \-no\-acls
233 +Disable the POSIX ACLs support
234 +.It Fl \-add\-file Ns \= Ns Ar FILE
235 +add given FILE to the archive (useful if its name starts with a dash)
236 +.It Fl \-anchored
237 +patterns match file name start
238 +.It Fl \-no\-anchored
239 +patterns match after any '/' (default for exclusion)
240 +.It Fl \-atime\-preserve
241 +preserve access times on dumped files, either by restoring the times
242 +.It Fl \-no\-auto\-compress
243 +do not use archive suffix to determine the compression program
244 +.It Fl b , Fl \-blocking\-factor Ar BLOCKS
245 +BLOCKS x 512 bytes per record
246 +.It Fl B , Fl \-read\-full\-records
247 +reblock as we read (for 4.2BSD pipes)
248 +.It Fl \-backup
249 +backup before removal, choose version CONTROL
250 +.It Fl C , Fl \-directory Ar DIR
251 +change to directory DIR
252 +.It Fl \-check\-device
253 +check device numbers when creating incremental archives (default)
254 +.It Fl \-no\-check\-device
255 +do not check device numbers when creating incremental archives
256 +.It Fl \-checkpoint
257 +display progress messages every NUMBERth record (default 10)
258 +.It Fl \-checkpoint\-action Ns \= Ns Ar ACTION
259 +execute ACTION on each checkpoint
260 +.It Fl \-delay\-directory\-restore
261 +delay setting modification times and permissions of extracted
262 +.It Fl \-no\-delay\-directory\-restore
263 +cancel the effect of --delay-directory-restore option
264 +.It Fl \-exclude Ns \= Ns Ar PATTERN
265 +exclude files, given as a PATTERN
266 +.It Fl \-exclude\-backups
267 +exclude backup and lock files
268 +.It Fl \-exclude\-caches
269 +exclude contents of directories containing CACHEDIR.TAG,
270 +.It Fl \-exclude\-caches\-all
271 +exclude directories containing CACHEDIR.TAG
272 +.It Fl \-exclude\-caches\-under
273 +exclude everything under directories containing CACHEDIR.TAG
274 +.It Fl \-exclude\-tag Ns \= Ns Ar FILE
275 +exclude contents of directories containing FILE, except
276 +.It Fl \-exclude\-tag\-all Ns \= Ns Ar FILE
277 +exclude directories containing FILE
278 +.It Fl \-exclude\-tag\-under Ns \= Ns Ar FILE
279 +exclude everything under directories containing FILE
280 +.It Fl \-exclude\-vcs
281 +exclude version control system directories
282 +.It Fl f , Fl \-file Ar ARCHIVE
283 +use archive file or device ARCHIVE
284 +.It Fl F , Fl \-info\-script , Fl \-new\-volume\-script Ar NAME
285 +run script at end of each tape (implies -M)
286 +.It Fl \-force\-local
287 +archive file is local even if it has a colon
288 +.It Fl \-full\-time
289 +print file time to its full resolution
290 +.It Fl g , Fl \-listed\-incremental Ar FILE
291 +handle new GNU-format incremental backup
292 +.It Fl G , Fl \-incremental
293 +handle old GNU-format incremental backup
294 +.It Fl \-group Ns \= Ns Ar NAME
295 +force NAME as group for added files
296 +.It Fl h , Fl \-dereference
297 +follow symlinks; archive and dump the files they point to
298 +.It Fl H , Fl \-format Ar FORMAT
299 +create archive of the given formatFORMAT is one of the following:
300 +.Bl -tag -width flag
301 +.It Fl \-format=gnu
302 +GNU tar 1.13.x format
303 +.It Fl \-format=oldgnu
304 +GNU format as per tar <= 1.12
305 +.It Fl \-format=pax
306 +POSIX 1003.1-2001 (pax) format
307 +.It Fl \-format=posix
308 +same as pax
309 +.It Fl \-format=ustar
310 +POSIX 1003.1-1988 (ustar) format
311 +.It Fl \-format=v7
312 +old V7 tar format
313 +.El
314 +.It Fl \-hard\-dereference
315 +follow hard links; archive and dump the files they refer to
316 +.It Fl i , Fl \-ignore\-zeros
317 +ignore zeroed blocks in archive (means EOF)
318 +.It Fl I , Fl \-use\-compress\-program Ar PROG
319 +filter through PROG (must accept -d)
320 +.It Fl \-ignore\-case
321 +ignore case
322 +.It Fl \-no\-ignore\-case
323 +case sensitive matching (default)
324 +.It Fl \-ignore\-command\-error
325 +ignore exit codes of children
326 +.It Fl \-no\-ignore\-command\-error
327 +treat non-zero exit codes of children as error
328 +.It Fl \-ignore\-failed\-read
329 +do not exit with nonzero on unreadable files
330 +.It Fl \-index\-file Ns \= Ns Ar FILE
331 +send verbose output to FILE
332 +.It Fl j , Fl \-bzip2
333 +
334 +.It Fl J , Fl \-xz
335 +
336 +.It Fl k , Fl \-keep\-old\-files
337 +don't replace existing files when extracting,
338 +.It Fl K , Fl \-starting\-file Ar MEMBER-NAME
339 +begin at member MEMBER-NAME when reading the archive
340 +.It Fl \-keep\-directory\-symlink
341 +preserve existing symlinks to directories when extracting
342 +.It Fl \-keep\-newer\-files
343 +don't replace existing files that are newer than their archive copies
344 +.It Fl l , Fl \-check\-links
345 +print a message if not all links are dumped
346 +.It Fl L , Fl \-tape\-length Ar NUMBER
347 +change tape after writing NUMBER x 1024 bytes
348 +.It Fl \-level Ns \= Ns Ar NUMBER
349 +dump level for created listed-incremental archive
350 +.It Fl \-lzip
351 +
352 +.It Fl \-lzma
353 +
354 +.It Fl \-lzop
355 +
356 +.It Fl m , Fl \-touch
357 +don't extract file modified time
358 +.It Fl M , Fl \-multi\-volume
359 +create/list/extract multi-volume archive
360 +.It Fl \-mode Ns \= Ns Ar CHANGES
361 +force (symbolic) mode CHANGES for added files
362 +.It Fl \-mtime Ns \= Ns Ar DATE-OR-FILE
363 +set mtime for added files from DATE-OR-FILE
364 +.It Fl n , Fl \-seek
365 +archive is seekable
366 +.It Fl N , Fl \-newer , Fl \-after\-date Ar DATE-OR-FILE
367 +only store files newer than DATE-OR-FILE
368 +.It Fl \-newer\-mtime Ns \= Ns Ar DATE
369 +compare date and time when data changed only
370 +.It Fl \-null
371 +-T reads null-terminated names, disable -C
372 +.It Fl \-no\-null
373 +disable the effect of the previous --null option
374 +.It Fl \-numeric\-owner
375 +always use numbers for user/group names
376 +.It Fl O , Fl \-to\-stdout
377 +extract files to standard output
378 +.It Fl \-occurrence
379 +process only the NUMBERth occurrence of each file in the archive;
380 +.It Fl \-old\-archive , Fl \-portability
381 +same as --format=v7
382 +.It Fl \-one\-file\-system
383 +stay in local file system when creating archive
384 +.It Fl \-overwrite
385 +overwrite existing files when extracting
386 +.It Fl \-overwrite\-dir
387 +overwrite metadata of existing directories when extracting (default)
388 +.It Fl \-no\-overwrite\-dir
389 +preserve metadata of existing directories
390 +.It Fl \-owner Ns \= Ns Ar NAME
391 +force NAME as owner for added files
392 +.It Fl p , Fl \-preserve\-permissions , Fl \-same\-permissions
393 +extract information about file permissions (default for superuser)
394 +.It Fl P , Fl \-absolute\-names
395 +don't strip leading '/'s from file names
396 +.It Fl \-pax\-option Ns \= Ns Ar keyword[[:]=value][,keyword[[:]=value]]...
397 +control pax keywords
398 +.It Fl \-posix
399 +same as --format=posix
400 +.It Fl \-preserve
401 +same as both -p and -s
402 +.It Fl \-quote\-chars Ns \= Ns Ar STRING
403 +additionally quote characters from STRING
404 +.It Fl \-no\-quote\-chars Ns \= Ns Ar STRING
405 +disable quoting for characters from STRING
406 +.It Fl \-quoting\-style Ns \= Ns Ar STYLE
407 +set name quoting style; see below for valid STYLE values
408 +.It Fl R , Fl \-block\-number
409 +show block number within archive with each message
410 +.It Fl \-record\-size Ns \= Ns Ar NUMBER
411 +NUMBER of bytes per record, multiple of 512
412 +.It Fl \-recursion
413 +recurse into directories (default)
414 +.It Fl \-no\-recursion
415 +avoid descending automatically in directories
416 +.It Fl \-recursive\-unlink
417 +empty hierarchies prior to extracting directory
418 +.It Fl \-remove\-files
419 +remove files after adding them to the archive
420 +.It Fl \-restrict
421 +disable use of some potentially harmful options
422 +.It Fl \-rmt\-command Ns \= Ns Ar COMMAND
423 +use given rmt COMMAND instead of rmt
424 +.It Fl \-rsh\-command Ns \= Ns Ar COMMAND
425 +use remote COMMAND instead of rsh
426 +.It Fl s , Fl \-preserve\-order , Fl \-same\-order
427 +member arguments are listed in the same order as the
428 +.It Fl S , Fl \-sparse
429 +handle sparse files efficiently
430 +.It Fl \-same\-owner
431 +try extracting files with the same ownership as exists in the archive (default for superuser)
432 +.It Fl \-no\-same\-owner
433 +extract files as yourself (default for ordinary users)
434 +.It Fl \-no\-same\-permissions
435 +apply the user's umask when extracting permissions from the archive (default for ordinary users)
436 +.It Fl \-no\-seek
437 +archive is not seekable
438 +.It Fl \-selinux
439 +Enable the SELinux context support
440 +.It Fl \-no\-selinux
441 +Disable the SELinux context support
442 +.It Fl \-show\-defaults
443 +show tar defaults
444 +.It Fl \-show\-omitted\-dirs
445 +when listing or extracting, list each directory that does not match search criteria
446 +.It Fl \-show\-snapshot\-field\-ranges
447 +show valid ranges for snapshot-file fields
448 +.It Fl \-show\-transformed\-names , Fl \-show\-stored\-names
449 +show file or archive names after transformation
450 +.It Fl \-skip\-old\-files
451 +don't replace existing files when extracting, silently skip over them
452 +.It Fl \-sparse\-version Ns \= Ns Ar MAJOR[.MINOR]
453 +set version of the sparse format to use (implies --sparse)
454 +.It Fl \-strip\-components Ns \= Ns Ar NUMBER
455 +strip NUMBER leading components from file names on extraction
456 +.It Fl \-suffix Ns \= Ns Ar STRING
457 +backup before removal, override usual suffix ('~' unless overridden by environment variable SIMPLE_BACKUP_SUFFIX)
458 +.It Fl T , Fl \-files\-from Ar FILE
459 +get names to extract or create from FILE
460 +.It Fl \-to\-command Ns \= Ns Ar COMMAND
461 +pipe extracted files to another program
462 +.It Fl \-totals
463 +print total bytes after processing the archive;
464 +.It Fl \-transform , Fl \-xform Ar EXPRESSION
465 +use sed replace EXPRESSION to transform file names
466 +.It Fl U , Fl \-unlink\-first
467 +remove each file prior to extracting over it
468 +.It Fl \-unquote
469 +unquote filenames read with -T (default)
470 +.It Fl \-no\-unquote
471 +do not unquote filenames read with -T
472 +.It Fl \-utc
473 +print file modification times in UTC
474 +.It Fl v , Fl \-verbose
475 +verbosely list files processed
476 +.It Fl V , Fl \-label Ar TEXT
477 +create archive with volume name TEXT; at list/extract time, use TEXT as a globbing pattern for volume name
478 +.It Fl \-volno\-file Ns \= Ns Ar FILE
479 +use/update the volume number in FILE
480 +.It Fl w , Fl \-interactive , Fl \-confirmation
481 +ask for confirmation for every action
482 +.It Fl W , Fl \-verify
483 +attempt to verify the archive after writing it
484 +.It Fl \-warning Ns \= Ns Ar KEYWORD
485 +warning control
486 +.It Fl \-wildcards
487 +use wildcards (default for exclusion)
488 +.It Fl \-wildcards\-match\-slash
489 +wildcards match '/' (default for exclusion)
490 +.It Fl \-no\-wildcards\-match\-slash
491 +wildcards do not match '/'
492 +.It Fl \-no\-wildcards
493 +verbatim string matching
494 +.It Fl X , Fl \-exclude\-from Ar FILE
495 +exclude patterns listed in FILE
496 +.It Fl \-xattrs
497 +Enable extended attributes support
498 +.It Fl \-xattrs\-exclude Ns \= Ns Ar MASK
499 +specify the exclude pattern for xattr keys
500 +.It Fl \-xattrs\-include Ns \= Ns Ar MASK
501 +specify the include pattern for xattr keys
502 +.It Fl \-no\-xattrs
503 +Disable extended attributes support
504 +.It Fl z , Fl \-gzip , Fl \-gunzip Fl \-ungzip
505 +
506 +.It Fl Z , Fl \-compress , Fl \-uncompress
507 +
508 +.El
509 +.Sh ENVIRONMENT
510 +The behavior of tar is controlled by the following environment variables,
511 +among others:
512 +.Bl -tag -width Ds
513 +.It Ev SIMPLE_BACKUP_SUFFIX
514 +Backup prefix to use when extracting, if
515 +.Fl \-suffix
516 +is not specified.
517 +The backup suffix defaults to `~' if neither is specified.
518 +.It Ev TAR_OPTIONS
519 +Options to prepend to those specified on the command line, separated by
520 +whitespace. Embedded backslashes may be used to escape whitespace or
521 +backslashes within an option.
522 +.It Ev TAPE
523 +Device or file to use for the archive if
524 +.Fl \-file
525 +is not specified.
526 +If this environment variable is unset, use stdin or stdout instead.
527 +.El
528 +.Sh EXAMPLES
529 +Create archive.tar from files foo and bar.
530 +.Bd -literal -offset indent -compact
531 +tar \-cf archive.tar foo bar
532 +.Ed
533 +List all files in archive.tar verbosely.
534 +.Bd -literal -offset indent -compact
535 +tar \-tvf archive.tar
536 +.Ed
537 +Extract all files from archive.tar.
538 +.Bd -literal -offset indent -compact
539 +tar \-xf archive.tar
540 +.Ed
541 +.Sh SEE ALSO
542 +.\" libarchive
543 +.Xr tar 5 ,
544 +.\" man-pages
545 +.Xr symlink 7 ,
546 +.Xr rmt 8
547 +.Sh HISTORY
548 +The
549 +.Nm tar
550 +command appeared in
551 +.At v7 .
552 +.Sh BUGS
553 +The GNU folks, in general, abhor man pages, and create info documents instead.
554 +Unfortunately, the info document describing tar is licensed under the GFDL with
555 +invariant cover texts, which makes it impossible to include any text
556 +from that document in this man page.
557 +Most of the text in this document was automatically extracted from the usage
558 +text in the source.
559 +It may not completely describe all features of the program.
560
561 diff --git a/app-arch/tar/metadata.xml b/app-arch/tar/metadata.xml
562 new file mode 100644
563 index 0000000..f8de3a9
564 --- /dev/null
565 +++ b/app-arch/tar/metadata.xml
566 @@ -0,0 +1,11 @@
567 +<?xml version="1.0" encoding="UTF-8"?>
568 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
569 +<pkgmetadata>
570 +<herd>base-system</herd>
571 +<use>
572 + <flag name='minimal'>just install `tar`</flag>
573 +</use>
574 +<upstream>
575 + <remote-id type="cpe">cpe:/a:gnu:tar</remote-id>
576 +</upstream>
577 +</pkgmetadata>
578
579 diff --git a/app-arch/tar/tar-1.27.1-r99.ebuild b/app-arch/tar/tar-1.27.1-r99.ebuild
580 new file mode 100644
581 index 0000000..c8a8853
582 --- /dev/null
583 +++ b/app-arch/tar/tar-1.27.1-r99.ebuild
584 @@ -0,0 +1,79 @@
585 +# Copyright 1999-2013 Gentoo Foundation
586 +# Distributed under the terms of the GNU General Public License v2
587 +# $Header: /var/cvsroot/gentoo-x86/app-arch/tar/tar-1.27.1.ebuild,v 1.1 2013/11/25 12:20:59 polynomial-c Exp $
588 +
589 +EAPI="5"
590 +
591 +inherit autotools flag-o-matic eutils
592 +
593 +DESCRIPTION="Use this to make tarballs :)"
594 +HOMEPAGE="http://www.gnu.org/software/tar/"
595 +SRC_URI="mirror://gnu/tar/${P}.tar.bz2
596 + mirror://gnu-alpha/tar/${P}.tar.bz2"
597 +
598 +LICENSE="GPL-3+"
599 +SLOT="0"
600 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
601 +IUSE="acl minimal nls selinux static userland_GNU xattr"
602 +
603 +RDEPEND="acl? ( virtual/acl )
604 + selinux? ( sys-libs/libselinux )"
605 +DEPEND="${RDEPEND}
606 + nls? ( >=sys-devel/gettext-0.10.35 )
607 + xattr? ( sys-apps/attr )"
608 +
609 +src_prepare() {
610 + epatch "${FILESDIR}"/${P}-sys-attr.patch
611 + eautoreconf
612 +
613 + if ! use userland_GNU ; then
614 + sed -i \
615 + -e 's:/backup\.sh:/gbackup.sh:' \
616 + scripts/{backup,dump-remind,restore}.in \
617 + || die "sed non-GNU"
618 + fi
619 +}
620 +
621 +src_configure() {
622 + use static && append-ldflags -static
623 + FORCE_UNSAFE_CONFIGURE=1 \
624 + econf \
625 + --enable-backup-scripts \
626 + --bindir="${EPREFIX}"/bin \
627 + --libexecdir="${EPREFIX}"/usr/sbin \
628 + $(usex userland_GNU "" "--program-prefix=g") \
629 + $(use_with acl posix-acls) \
630 + $(use_enable nls) \
631 + $(use_with selinux) \
632 + $(use_with xattr xattrs)
633 +}
634 +
635 +src_install() {
636 + emake DESTDIR="${D}" install || die
637 +
638 + local p=$(usex userland_GNU "" "g")
639 + if [[ -z ${p} ]] ; then
640 + # a nasty yet required piece of baggage
641 + exeinto /etc
642 + doexe "${FILESDIR}"/rmt || die
643 + fi
644 +
645 + # autoconf looks for gtar before tar (in configure scripts), hence
646 + # in Prefix it is important that it is there, otherwise, a gtar from
647 + # the host system (FreeBSD, Solaris, Darwin) will be found instead
648 + # of the Prefix provided (GNU) tar
649 + if use prefix ; then
650 + dosym tar /bin/gtar
651 + fi
652 +
653 + dodoc AUTHORS ChangeLog* NEWS README* THANKS
654 + newman "${FILESDIR}"/tar.1-1.27 ${p}tar.1
655 + mv "${ED}"/usr/sbin/${p}backup{,-tar}
656 + mv "${ED}"/usr/sbin/${p}restore{,-tar}
657 +
658 + if use minimal ; then
659 + find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
660 + -type f -a '!' '(' -name tar -o -name ${p}tar ')' \
661 + -delete
662 + fi
663 +}