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-alternatives/gzip/
Date: Thu, 01 Dec 2022 19:38:46
Message-Id: 1669923503.7dbd9efce69d73d24db421189e4d2beccbcd6da2.sam@gentoo
1 commit: 7dbd9efce69d73d24db421189e4d2beccbcd6da2
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Dec 1 16:11:04 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=7dbd9efc
7
8 app-alternatives/gzip: Add a package for gzip symlinks
9
10 Closes: https://bugs.gentoo.org/868648
11 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 app-alternatives/gzip/gzip-0.ebuild | 45 +++++++++++++++++++++++++++++++++++++
15 app-alternatives/gzip/metadata.xml | 20 +++++++++++++++++
16 2 files changed, 65 insertions(+)
17
18 diff --git a/app-alternatives/gzip/gzip-0.ebuild b/app-alternatives/gzip/gzip-0.ebuild
19 new file mode 100644
20 index 000000000000..29e0808da453
21 --- /dev/null
22 +++ b/app-alternatives/gzip/gzip-0.ebuild
23 @@ -0,0 +1,45 @@
24 +# Copyright 2022 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=8
28 +
29 +DESCRIPTION="gzip symlinks"
30 +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Base/Alternatives"
31 +SRC_URI=""
32 +S=${WORKDIR}
33 +
34 +LICENSE="CC0-1.0"
35 +SLOT="0"
36 +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"
37 +IUSE="pigz +reference split-usr"
38 +REQUIRED_USE="^^ ( pigz reference )"
39 +
40 +RDEPEND="
41 + pigz? ( app-arch/pigz[-symlink(-)] )
42 + reference? ( >=app-arch/gzip-1.12-r3 )
43 + !<app-arch/gzip-1.12-r3
44 + !app-arch/pigz[symlink(-)]
45 +"
46 +
47 +src_install() {
48 + local usr_prefix=
49 + use split-usr && usr_prefix=../usr/bin/
50 +
51 + if use pigz; then
52 + dosym "${usr_prefix}pigz" /bin/gzip
53 + dosym gzip /bin/gunzip
54 + dosym gzip /bin/zcat
55 + newman - gzip.1 <<<".so pigz.1"
56 + elif use reference; then
57 + dosym gzip-reference /bin/gzip
58 + # gzip uses shell wrappers rather than argv[0]
59 + dosym gunzip-reference /bin/gunzip
60 + dosym zcat-reference /bin/zcat
61 + newman - gzip.1 <<<".so gzip-reference.1"
62 + else
63 + die "Invalid USE flag combination (broken REQUIRED_USE?)"
64 + fi
65 +
66 + newman - gunzip.1 <<<".so gzip.1"
67 + newman - zcat.1 <<<".so gzip.1"
68 +}
69
70 diff --git a/app-alternatives/gzip/metadata.xml b/app-alternatives/gzip/metadata.xml
71 new file mode 100644
72 index 000000000000..6a439f199cb1
73 --- /dev/null
74 +++ b/app-alternatives/gzip/metadata.xml
75 @@ -0,0 +1,20 @@
76 +<?xml version="1.0" encoding="UTF-8"?>
77 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
78 +<pkgmetadata>
79 + <maintainer type="project">
80 + <email>base-system@g.o</email>
81 + <name>Gentoo Base System</name>
82 + </maintainer>
83 + <maintainer type="person">
84 + <email>mgorny@g.o</email>
85 + <name>Michał Górny</name>
86 + </maintainer>
87 + <use>
88 + <flag name="pigz">
89 + Symlink to <pkg>app-arch/pigz</pkg>.
90 + </flag>
91 + <flag name="reference">
92 + Symlink to <pkg>app-arch/gzip</pkg>.
93 + </flag>
94 + </use>
95 +</pkgmetadata>