initial commit: 1.5.0
[systemrescuecd.git] / portage-overlay / app-arch / tar / tar-1.22-r1.ebuild
1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-arch/tar/tar-1.21-r1.ebuild,v 1.1 2008/12/29 10:03:44 vapier Exp $
4
5 inherit flag-o-matic eutils
6
7 DESCRIPTION="Use this to make tarballs :)"
8 HOMEPAGE="http://www.gnu.org/software/tar/"
9 SRC_URI="http://ftp.gnu.org/gnu/tar/${P}.tar.gz
10         ftp://alpha.gnu.org/gnu/tar/${P}.tar.gz
11         mirror://gnu/tar/${P}.tar.gz"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd"
16 IUSE="nls static userland_GNU"
17
18 RDEPEND=""
19 DEPEND="${RDEPEND}
20         nls? ( >=sys-devel/gettext-0.10.35 )"
21
22 src_unpack() {
23         unpack ${A}
24         cd "${S}"
25
26         epatch "${FILESDIR}"/tar-1.14-loneZeroWarning.patch
27         epatch "${FILESDIR}"/tar-1.15.1-vfatTruncate.patch
28         epatch "${FILESDIR}"/tar-1.19-xattrs.patch
29         epatch "${FILESDIR}"/tar-1.19-xattrs-conf.patch
30         epatch "${FILESDIR}"/tar-1.17-wildcards.patch
31         
32         if ! use userland_GNU ; then
33                 sed -i \
34                         -e 's:/backup\.sh:/gbackup.sh:' \
35                         scripts/{backup,dump-remind,restore}.in \
36                         || die "sed non-GNU"
37         fi
38 }
39
40 src_compile() {
41         local myconf
42         use static && append-ldflags -static
43         use userland_GNU || myconf="--program-prefix=g"
44         # Work around bug in sandbox #67051
45         gl_cv_func_chown_follows_symlink=yes \
46         econf \
47                 --enable-backup-scripts \
48                 --bindir=/bin \
49                 --libexecdir=/usr/sbin \
50                 $(use_enable nls) \
51                 ${myconf} || die
52         emake || die "emake failed"
53 }
54
55 src_install() {
56         local p=""
57         use userland_GNU || p=g
58
59         emake DESTDIR="${D}" install || die "make install failed"
60
61         if [[ -z ${p} ]] ; then
62                 # a nasty yet required piece of baggage
63                 exeinto /etc
64                 doexe "${FILESDIR}"/rmt || die
65         fi
66
67         dodoc AUTHORS ChangeLog* NEWS README* PORTS THANKS
68         newman "${FILESDIR}"/tar.1 ${p}tar.1
69         mv "${D}"/usr/sbin/${p}backup{,-tar}
70         mv "${D}"/usr/sbin/${p}restore{,-tar}
71
72         rm -f "${D}"/usr/$(get_libdir)/charset.alias
73 }