Skip to content

Commit cc89415

Browse files
committed
app-arch/tar: import for Prefix fix
Signed-off-by: Fabian Groffen <[email protected]>
1 parent 9020136 commit cc89415

File tree

5 files changed

+168
-0
lines changed

5 files changed

+168
-0
lines changed

Diff for: app-arch/tar/Manifest

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DIST tar-1.35.tar.xz 2317208 BLAKE2B e1a200d21f433cd7d917dd979db16919a9167056ae62cf7d038a6118e56b2fe419cd4a396eee66f1f4dc13a8dc380e23f6ffd7ee0ca84e5dd9ad9411f60e002c SHA512 8b84ed661e6c878fa33eb5c1808d20351e6f40551ac63f96014fb0d0b9c72d5d94d8865d39e36bcb184fd250f84778a3b271bbd8bd2ceb69eece0c3568577510
2+
DIST tar-1.35.tar.xz.sig 95 BLAKE2B 8501b55b700bc99b81f04519db1cd8f7bc3d87dd5bfefa25a3d979b23359f02dfb770f3dd66dca275baa70a99612cb85c1019faaf3a1f0bcf50c9815b8e32eca SHA512 00e5c95bf8015f75f59556a82ed7f50bddefe89754c7ff3c19411aee2f37626a5d65c33e18b87f7f8f96388d3f175fd095917419a3ad1c0fc9d6188088bac944

Diff for: app-arch/tar/files/rmt

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
#
3+
# This is not a mistake. This shell script (/etc/rmt) has been provided
4+
# for compatibility with other Unix-like systems, some of which have
5+
# utilities that expect to find (and execute) rmt in the /etc directory
6+
# on remote systems.
7+
#
8+
exec rmt "$@"

Diff for: app-arch/tar/files/tar-1.35-libintl.patch

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 8632df398b2f548465ebe68b8f494c0d6f8d913d Mon Sep 17 00:00:00 2001
2+
From: Sergey Poznyakoff <[email protected]>
3+
Date: Tue, 18 Jul 2023 17:02:23 +0300
4+
Subject: Fix savannah bug #64441
5+
6+
* src/Makefile.am (tar_LDADD): Add libiconv libraries.
7+
---
8+
src/Makefile.am | 3 ++-
9+
1 file changed, 2 insertions(+), 1 deletion(-)
10+
11+
diff --git a/src/Makefile.am b/src/Makefile.am
12+
index 36c9543..e2ec58d 100644
13+
--- a/src/Makefile.am
14+
+++ b/src/Makefile.am
15+
@@ -52,4 +52,5 @@ AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
16+
tar_LDADD = $(LIBS) ../lib/libtar.a ../gnu/libgnu.a\
17+
$(LIB_ACL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)\
18+
$(LIB_GETRANDOM) $(LIB_HARD_LOCALE) $(FILE_HAS_ACL_LIB) $(LIB_MBRTOWC)\
19+
- $(LIB_SELINUX) $(LIB_SETLOCALE_NULL)
20+
+ $(LIB_SELINUX) $(LIB_SETLOCALE_NULL) \
21+
+ $(LIBINTL) $(LIBICONV)
22+
--
23+
cgit v1.1
24+

Diff for: app-arch/tar/metadata.xml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
3+
<pkgmetadata>
4+
<maintainer type="project">
5+
<email>[email protected]</email>
6+
<name>Gentoo Base System</name>
7+
</maintainer>
8+
<use>
9+
<flag name="minimal">just install `tar`</flag>
10+
</use>
11+
<upstream>
12+
<remote-id type="cpe">cpe:/a:gnu:tar</remote-id>
13+
</upstream>
14+
</pkgmetadata>

Diff for: app-arch/tar/tar-1.35.ebuild

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Copyright 1999-2025 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/tar.asc
7+
inherit multiprocessing verify-sig autotools
8+
9+
DESCRIPTION="Use this to make tarballs :)"
10+
HOMEPAGE="https://www.gnu.org/software/tar/"
11+
SRC_URI="
12+
mirror://gnu/tar/${P}.tar.xz
13+
https://alpha.gnu.org/gnu/tar/${P}.tar.xz
14+
verify-sig? (
15+
mirror://gnu/tar/${P}.tar.xz.sig
16+
https://alpha.gnu.org/gnu/tar/${P}.tar.xz.sig
17+
)
18+
"
19+
20+
LICENSE="GPL-3+"
21+
SLOT="0"
22+
if [[ -z "$(ver_cut 3)" || "$(ver_cut 3)" -lt 90 ]] ; then
23+
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
24+
fi
25+
IUSE="acl minimal nls selinux xattr"
26+
27+
RDEPEND="
28+
acl? ( virtual/acl )
29+
selinux? ( sys-libs/libselinux )
30+
"
31+
DEPEND="
32+
${RDEPEND}
33+
xattr? ( elibc_glibc? ( sys-apps/attr ) )
34+
"
35+
BDEPEND="
36+
nls? ( sys-devel/gettext )
37+
verify-sig? ( sec-keys/openpgp-keys-tar )
38+
"
39+
PDEPEND="
40+
app-alternatives/tar
41+
"
42+
43+
PATCHES=( "${FILESDIR}"/${P}-libintl.patch )
44+
45+
src_prepare() {
46+
default
47+
eautoreconf
48+
}
49+
50+
src_configure() {
51+
# -fanalyzer doesn't make sense for us in ebuilds, as it's for static analysis
52+
export gl_cv_warn_c__fanalyzer=no
53+
54+
local myeconfargs=(
55+
--bindir="${EPREFIX}"/bin
56+
# Avoid -Werror
57+
--disable-gcc-warnings
58+
--enable-backup-scripts
59+
--libexecdir="${EPREFIX}"/usr/sbin
60+
$(use_with acl posix-acls)
61+
$(use_enable nls)
62+
$(use_with selinux)
63+
$(use_with xattr xattrs)
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+
--program-prefix=g
70+
)
71+
72+
# Drop CONFIG_SHELL hack after 1.35: https://git.savannah.gnu.org/cgit/tar.git/commit/?id=7687bf4acc4dc4554538389383d7fb4c3e6521cd
73+
CONFIG_SHELL="${BROOT}"/bin/bash FORCE_UNSAFE_CONFIGURE=1 econf "${myeconfargs[@]}"
74+
}
75+
76+
src_test() {
77+
# Drop after 1.35: https://git.savannah.gnu.org/cgit/tar.git/commit/?id=18f90676e4695ffcf13413e9fbb24cc0ae2ae9d5
78+
local -x XZ_OPT= XZ_DEFAULTS=
79+
80+
emake check TESTSUITEFLAGS="--jobs=$(get_makeopts_jobs)"
81+
}
82+
83+
src_install() {
84+
default
85+
86+
# A nasty yet required piece of baggage
87+
exeinto /etc
88+
doexe "${FILESDIR}"/rmt
89+
90+
mv "${ED}"/usr/sbin/{gbackup,backup-tar} || die
91+
mv "${ED}"/usr/sbin/{grestore,restore-tar} || die
92+
mv "${ED}"/usr/sbin/{g,}backup.sh || die
93+
mv "${ED}"/usr/sbin/{g,}dump-remind || die
94+
95+
if use minimal ; then
96+
find "${ED}"/etc "${ED}"/*bin/ "${ED}"/usr/*bin/ \
97+
-type f -a '!' -name gtar \
98+
-delete || die
99+
fi
100+
101+
if ! use minimal; then
102+
dosym grmt /usr/sbin/rmt
103+
fi
104+
dosym grmt.8 /usr/share/man/man8/rmt.8
105+
}
106+
107+
pkg_postinst() {
108+
# Ensure to preserve the symlink before app-alternatives/tar
109+
# is installed
110+
if [[ ! -h ${EROOT}/bin/tar ]]; then
111+
if [[ -e ${EROOT}/usr/bin/tar ]] ; then
112+
# bug #904887
113+
ewarn "${EROOT}/usr/bin/tar exists but is not a symlink."
114+
ewarn "This is expected during Prefix bootstrap and unusual otherwise."
115+
ewarn "Moving away unexpected ${EROOT}/usr/bin/tar to .bak."
116+
mv "${EROOT}/usr/bin/tar" "${EROOT}/usr/bin/tar.bak" || die
117+
fi
118+
ln -s gtar "${EROOT}/bin/tar" || die
119+
fi
120+
}

0 commit comments

Comments
 (0)