Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/gzip/
Date: Thu, 01 Dec 2022 19:38:46
Message-Id: 1669923503.aa9e23f4d96ed4046d265751ac8d8902f389c26b.sam@gentoo
1 commit: aa9e23f4d96ed4046d265751ac8d8902f389c26b
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 1 16:11:16 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Dec 1 19:38:23 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa9e23f4
7
8 app-arch/gzip: Support app-alternatives/gzip
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 app-arch/gzip/gzip-1.12-r3.ebuild | 84 +++++++++++++++++++++++++++++++++++++++
14 1 file changed, 84 insertions(+)
15
16 diff --git a/app-arch/gzip/gzip-1.12-r3.ebuild b/app-arch/gzip/gzip-1.12-r3.ebuild
17 new file mode 100644
18 index 000000000000..98f464a9e840
19 --- /dev/null
20 +++ b/app-arch/gzip/gzip-1.12-r3.ebuild
21 @@ -0,0 +1,84 @@
22 +# Copyright 1999-2022 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=7
26 +
27 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/gzip.asc
28 +inherit flag-o-matic verify-sig
29 +
30 +DESCRIPTION="Standard GNU compressor"
31 +HOMEPAGE="https://www.gnu.org/software/gzip/"
32 +SRC_URI="mirror://gnu/gzip/${P}.tar.xz
33 + https://alpha.gnu.org/gnu/gzip/${P}.tar.xz"
34 +SRC_URI+=" verify-sig? (
35 + mirror://gnu/gzip/${P}.tar.xz.sig
36 + https://alpha.gnu.org/gnu/gzip/${P}.tar.xz.sig
37 + )"
38 +
39 +LICENSE="GPL-3+"
40 +SLOT="0"
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 +IUSE="pic static"
43 +
44 +BDEPEND="verify-sig? ( sec-keys/openpgp-keys-gzip )"
45 +RDEPEND="!app-arch/pigz[symlink(-)]"
46 +PDEPEND="
47 + app-alternatives/gzip
48 +"
49 +
50 +PATCHES=(
51 + "${FILESDIR}/${PN}-1.3.8-install-symlinks.patch"
52 +)
53 +
54 +src_configure() {
55 + use static && append-flags -static
56 +
57 + # Avoid text relocation in gzip
58 + use pic && export DEFS="NO_ASM"
59 +
60 + # bug #663928
61 + econf --disable-gcc-warnings
62 +}
63 +
64 +src_install() {
65 + default
66 +
67 + docinto txt
68 + dodoc algorithm.doc gzip.doc
69 +
70 + # Avoid conflict with app-arch/ncompress
71 + rm "${ED}"/usr/bin/uncompress || die
72 +
73 + # keep most things in /usr, just the fun stuff in /
74 + # also rename them to avoid conflict with app-alternatives/gzip
75 + dodir /bin
76 + local x
77 + for x in gunzip gzip zcat; do
78 + mv "${ED}/usr/bin/${x}" "${ED}/bin/${x}-reference" || die
79 + done
80 + sed -i -e 's:exec gzip:&-reference:' \
81 + "${ED}"/bin/{gunzip,zcat}-reference || die
82 + mv "${ED}"/usr/share/man/man1/gzip{,-reference}.1 || die
83 + rm "${ED}"/usr/share/man/man1/{gunzip,zcat}.1 || die
84 +}
85 +
86 +pkg_postinst() {
87 + if [[ -n ${REPLACING_VERSIONS} ]]; then
88 + local ver
89 + for ver in ${REPLACING_VERSIONS}; do
90 + if ver_test "${ver}" -lt "1.12-r2"; then
91 + ewarn "This package no longer installs 'uncompress'."
92 + ewarn "Please use 'gzip -d' to decompress .Z files."
93 + fi
94 + done
95 + fi
96 +
97 + # ensure to preserve the symlinks before app-alternatives/gzip
98 + # is installed
99 + local x
100 + for x in gunzip gzip zcat; do
101 + if [[ ! -h ${EROOT}/bin/${x} ]]; then
102 + ln -s "${x}-reference" "${EROOT}/bin/${x}" || die
103 + fi
104 + done
105 +}