1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit flag-o-matic eutils
8 DESCRIPTION="Use this to make tarballs :)"
9 HOMEPAGE="https://www.gnu.org/software/tar/"
10 SRC_URI="mirror://gnu/tar/${P}.tar.bz2
11 mirror://gnu-alpha/tar/${P}.tar.bz2"
15 KEYWORDS="~alpha amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
16 IUSE="acl elibc_glibc minimal nls selinux static userland_GNU xattr"
18 RDEPEND="acl? ( virtual/acl )
19 selinux? ( sys-libs/libselinux )"
21 nls? ( >=sys-devel/gettext-0.10.35 )
22 xattr? ( elibc_glibc? ( sys-apps/attr ) )"
25 "${FILESDIR}/${P}-extract-pathname-bypass-upstream.patch" #598334
26 "${FILESDIR}/${P}-add-files.patch"
30 epatch "${PATCHES[@]}"
33 if ! use userland_GNU ; then
35 -e 's:/backup\.sh:/gbackup.sh:' \
36 scripts/{backup,dump-remind,restore}.in \
42 use static && append-ldflags -static
43 FORCE_UNSAFE_CONFIGURE=1 \
45 --enable-backup-scripts \
46 --bindir="${EPREFIX}"/bin \
47 --libexecdir="${EPREFIX}"/usr/sbin \
48 $(usex userland_GNU "" "--program-prefix=g") \
49 $(use_with acl posix-acls) \
52 $(use_with xattr xattrs)
58 local p=$(usex userland_GNU "" "g")
59 if [[ -z ${p} ]] ; then
60 # a nasty yet required piece of baggage
62 doexe "${FILESDIR}"/rmt
65 # autoconf looks for gtar before tar (in configure scripts), hence
66 # in Prefix it is important that it is there, otherwise, a gtar from
67 # the host system (FreeBSD, Solaris, Darwin) will be found instead
68 # of the Prefix provided (GNU) tar
73 mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
74 mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
77 find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
78 -type f -a '!' '(' -name tar -o -name ${p}tar ')' \