sys-fs/cryptsetup: stable 1.7.5 for ppc/ppc64, bug #641712
[gentoo.git] / app-arch / tar / tar-1.29-r3.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="5"
5
6 inherit flag-o-matic eutils
7
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"
12
13 LICENSE="GPL-3+"
14 SLOT="0"
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"
17
18 RDEPEND="acl? ( virtual/acl )
19         selinux? ( sys-libs/libselinux )"
20 DEPEND="${RDEPEND}
21         nls? ( >=sys-devel/gettext-0.10.35 )
22         xattr? ( elibc_glibc? ( sys-apps/attr ) )"
23
24 PATCHES=(
25         "${FILESDIR}/${P}-extract-pathname-bypass-upstream.patch" #598334
26         "${FILESDIR}/${P}-add-files.patch"
27 )
28
29 src_prepare() {
30         epatch "${PATCHES[@]}"
31         epatch_user
32
33         if ! use userland_GNU ; then
34                 sed -i \
35                         -e 's:/backup\.sh:/gbackup.sh:' \
36                         scripts/{backup,dump-remind,restore}.in \
37                         || die "sed non-GNU"
38         fi
39 }
40
41 src_configure() {
42         use static && append-ldflags -static
43         FORCE_UNSAFE_CONFIGURE=1 \
44         econf \
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) \
50                 $(use_enable nls) \
51                 $(use_with selinux) \
52                 $(use_with xattr xattrs)
53 }
54
55 src_install() {
56         default
57
58         local p=$(usex userland_GNU "" "g")
59         if [[ -z ${p} ]] ; then
60                 # a nasty yet required piece of baggage
61                 exeinto /etc
62                 doexe "${FILESDIR}"/rmt
63         fi
64
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
69         if use prefix ; then
70                 dosym tar /bin/gtar
71         fi
72
73         mv "${ED}"/usr/sbin/${p}backup{,-tar} || die
74         mv "${ED}"/usr/sbin/${p}restore{,-tar} || die
75
76         if use minimal ; then
77                 find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
78                         -type f -a '!' '(' -name tar -o -name ${p}tar ')' \
79                         -delete || die
80         fi
81 }