diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-12-05 20:27:37 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-12-06 15:46:39 +0100 |
commit | 85f17696807506edf725b68893471b23a4c78f51 (patch) | |
tree | 0f0bfd5104678370185a2bd6a2532340a27d18c6 /app-alternatives | |
parent | app-alternatives/bc: Use app-alternatives.eclass (diff) | |
download | gentoo-85f17696807506edf725b68893471b23a4c78f51.tar.gz gentoo-85f17696807506edf725b68893471b23a4c78f51.tar.bz2 gentoo-85f17696807506edf725b68893471b23a4c78f51.zip |
app-alternatives/cpio: Use app-alternatives.eclass
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-alternatives')
-rw-r--r-- | app-alternatives/cpio/cpio-0.ebuild | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/app-alternatives/cpio/cpio-0.ebuild b/app-alternatives/cpio/cpio-0.ebuild index 20af68ac0123..0bdeb6da6b2f 100644 --- a/app-alternatives/cpio/cpio-0.ebuild +++ b/app-alternatives/cpio/cpio-0.ebuild @@ -3,20 +3,18 @@ EAPI=8 -DESCRIPTION="CPIO symlink" -HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Base/Alternatives" -SRC_URI="" -S=${WORKDIR} +ALTERNATIVES=( + "gnu:>=app-arch/cpio-2.13-r4" + libarchive:app-arch/libarchive +) + +inherit app-alternatives -LICENSE="CC0-1.0" -SLOT="0" +DESCRIPTION="CPIO symlink" 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="+gnu libarchive split-usr" -REQUIRED_USE="^^ ( gnu libarchive )" +IUSE="split-usr" RDEPEND=" - gnu? ( >=app-arch/cpio-2.13-r4 ) - libarchive? ( app-arch/libarchive ) !<app-arch/cpio-2.13-r4 " @@ -24,13 +22,14 @@ src_install() { local usr_prefix= use split-usr && usr_prefix=../usr/bin/ - if use gnu; then - dosym gcpio /bin/cpio - newman - cpio.1 <<<".so gcpio.1" - elif use libarchive; then - dosym "${usr_prefix}bsdcpio" /bin/cpio - newman - cpio.1 <<<".so bsdcpio.1" - else - die "Invalid USE flag combination (broken REQUIRED_USE?)" - fi + case $(get_alternative) in + gnu) + dosym gcpio /bin/cpio + newman - cpio.1 <<<".so gcpio.1" + ;; + libarchive) + dosym "${usr_prefix}bsdcpio" /bin/cpio + newman - cpio.1 <<<".so bsdcpio.1" + ;; + esac } |