Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/tar/
Date: Mon, 28 Nov 2022 14:31:44
Message-Id: 1669645896.35d09e247ddbff518f1d292eb2990be8669cc827.mgorny@gentoo
1 commit: 35d09e247ddbff518f1d292eb2990be8669cc827
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 22 21:05:02 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 28 14:31:36 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35d09e24
7
8 app-arch/tar: Support app-alternatives/tar
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 app-arch/tar/tar-1.34-r2.ebuild | 90 +++++++++++++++++++++++++++++++++++++++++
13 1 file changed, 90 insertions(+)
14
15 diff --git a/app-arch/tar/tar-1.34-r2.ebuild b/app-arch/tar/tar-1.34-r2.ebuild
16 new file mode 100644
17 index 000000000000..5606cfb60b71
18 --- /dev/null
19 +++ b/app-arch/tar/tar-1.34-r2.ebuild
20 @@ -0,0 +1,90 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=7
25 +
26 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/tar.asc
27 +inherit verify-sig
28 +
29 +DESCRIPTION="Use this to make tarballs :)"
30 +HOMEPAGE="https://www.gnu.org/software/tar/"
31 +SRC_URI="mirror://gnu/tar/${P}.tar.xz
32 + https://alpha.gnu.org/gnu/tar/${P}.tar.xz"
33 +SRC_URI+=" verify-sig? (
34 + mirror://gnu/tar/${P}.tar.xz.sig
35 + https://alpha.gnu.org/gnu/tar/${P}.tar.xz.sig
36 + )"
37 +
38 +LICENSE="GPL-3+"
39 +SLOT="0"
40 +if [[ -z "$(ver_cut 3)" ]] || [[ "$(ver_cut 3)" -lt 90 ]] ; then
41 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
42 +fi
43 +IUSE="acl minimal nls selinux xattr"
44 +
45 +RDEPEND="
46 + acl? ( virtual/acl )
47 + selinux? ( sys-libs/libselinux )
48 +"
49 +DEPEND="${RDEPEND}
50 + xattr? ( elibc_glibc? ( sys-apps/attr ) )
51 +"
52 +BDEPEND="
53 + nls? ( sys-devel/gettext )
54 + verify-sig? ( sec-keys/openpgp-keys-tar )
55 +"
56 +PDEPEND="
57 + app-alternatives/tar
58 +"
59 +
60 +src_configure() {
61 + local myeconfargs=(
62 + --bindir="${EPREFIX}"/bin
63 + --enable-backup-scripts
64 + --libexecdir="${EPREFIX}"/usr/sbin
65 + $(use_with acl posix-acls)
66 + $(use_enable nls)
67 + $(use_with selinux)
68 + $(use_with xattr xattrs)
69 +
70 + # autoconf looks for gtar before tar (in configure scripts), hence
71 + # in Prefix it is important that it is there, otherwise, a gtar from
72 + # the host system (FreeBSD, Solaris, Darwin) will be found instead
73 + # of the Prefix provided (GNU) tar
74 + --program-prefix=g
75 + )
76 +
77 + FORCE_UNSAFE_CONFIGURE=1 econf "${myeconfargs[@]}"
78 +}
79 +
80 +src_install() {
81 + default
82 +
83 + # a nasty yet required piece of baggage
84 + exeinto /etc
85 + doexe "${FILESDIR}"/rmt
86 +
87 + mv "${ED}"/usr/sbin/{gbackup,backup-tar} || die
88 + mv "${ED}"/usr/sbin/{grestore,restore-tar} || die
89 + mv "${ED}"/usr/sbin/{g,}backup.sh || die
90 + mv "${ED}"/usr/sbin/{g,}dump-remind || die
91 +
92 + if use minimal ; then
93 + find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
94 + -type f -a '!' -name gtar \
95 + -delete || die
96 + fi
97 +
98 + if ! use minimal; then
99 + dosym grmt /usr/sbin/rmt
100 + fi
101 + dosym grmt.8 /usr/share/man/man8/rmt.8
102 +}
103 +
104 +pkg_postinst() {
105 + # ensure to preserve the symlink before app-alternatives/tar
106 + # is installed
107 + if [[ ! -h ${EROOT}/bin/tar ]]; then
108 + ln -s gtar "${EROOT}/bin/tar" || die
109 + fi
110 +}