diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-12-05 20:50:55 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-12-06 15:46:40 +0100 |
commit | 0553e130788c33c3e297548725773ca21d603d19 (patch) | |
tree | 124b2265c0241b4bcb6ded6695a18f9e74599a00 /app-alternatives/gzip | |
parent | app-alternatives/tar: Use app-alternatives.eclass (diff) | |
download | gentoo-0553e130788c33c3e297548725773ca21d603d19.tar.gz gentoo-0553e130788c33c3e297548725773ca21d603d19.tar.bz2 gentoo-0553e130788c33c3e297548725773ca21d603d19.zip |
app-alternatives/gzip: Use app-alternatives.eclass
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-alternatives/gzip')
-rw-r--r-- | app-alternatives/gzip/gzip-0.ebuild | 47 |
1 files changed, 23 insertions, 24 deletions
diff --git a/app-alternatives/gzip/gzip-0.ebuild b/app-alternatives/gzip/gzip-0.ebuild index 29e0808da453..77090242607d 100644 --- a/app-alternatives/gzip/gzip-0.ebuild +++ b/app-alternatives/gzip/gzip-0.ebuild @@ -3,20 +3,18 @@ EAPI=8 -DESCRIPTION="gzip symlinks" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Base/Alternatives" -SRC_URI="" -S=${WORKDIR} +ALTERNATIVES=( + "reference:>=app-arch/gzip-1.12-r3" + "pigz:app-arch/pigz[-symlink(-)]" +) + +inherit app-alternatives -LICENSE="CC0-1.0" -SLOT="0" +DESCRIPTION="gzip symlinks" 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" -IUSE="pigz +reference split-usr" -REQUIRED_USE="^^ ( pigz reference )" +IUSE="split-usr" RDEPEND=" - pigz? ( app-arch/pigz[-symlink(-)] ) - reference? ( >=app-arch/gzip-1.12-r3 ) !<app-arch/gzip-1.12-r3 !app-arch/pigz[symlink(-)] " @@ -25,20 +23,21 @@ src_install() { local usr_prefix= use split-usr && usr_prefix=../usr/bin/ - if use pigz; then - dosym "${usr_prefix}pigz" /bin/gzip - dosym gzip /bin/gunzip - dosym gzip /bin/zcat - newman - gzip.1 <<<".so pigz.1" - elif use reference; then - dosym gzip-reference /bin/gzip - # gzip uses shell wrappers rather than argv[0] - dosym gunzip-reference /bin/gunzip - dosym zcat-reference /bin/zcat - newman - gzip.1 <<<".so gzip-reference.1" - else - die "Invalid USE flag combination (broken REQUIRED_USE?)" - fi + case $(get_alternative) in + pigz) + dosym "${usr_prefix}pigz" /bin/gzip + dosym gzip /bin/gunzip + dosym gzip /bin/zcat + newman - gzip.1 <<<".so pigz.1" + ;; + reference) + dosym gzip-reference /bin/gzip + # gzip uses shell wrappers rather than argv[0] + dosym gunzip-reference /bin/gunzip + dosym zcat-reference /bin/zcat + newman - gzip.1 <<<".so gzip-reference.1" + ;; + esac newman - gunzip.1 <<<".so gzip.1" newman - zcat.1 <<<".so gzip.1" |