summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-11-22 21:05:23 +0100
committerMichał Górny <mgorny@gentoo.org>2022-11-28 15:31:34 +0100
commit46383ee643312058585dab843b2dd501a3c69a2c (patch)
tree9bf0370973db7f3a88be366de9eb1299f2ee4210 /app-alternatives
parentapp-alternatives: New category (diff)
downloadgentoo-46383ee643312058585dab843b2dd501a3c69a2c.tar.gz
gentoo-46383ee643312058585dab843b2dd501a3c69a2c.tar.bz2
gentoo-46383ee643312058585dab843b2dd501a3c69a2c.zip
app-alternatives/cpio: Add an ebuild for /bin/cpio symlink
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'app-alternatives')
-rw-r--r--app-alternatives/cpio/cpio-0.ebuild36
-rw-r--r--app-alternatives/cpio/metadata.xml20
2 files changed, 56 insertions, 0 deletions
diff --git a/app-alternatives/cpio/cpio-0.ebuild b/app-alternatives/cpio/cpio-0.ebuild
new file mode 100644
index 000000000000..20af68ac0123
--- /dev/null
+++ b/app-alternatives/cpio/cpio-0.ebuild
@@ -0,0 +1,36 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="CPIO symlink"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Base/Alternatives"
+SRC_URI=""
+S=${WORKDIR}
+
+LICENSE="CC0-1.0"
+SLOT="0"
+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 )"
+
+RDEPEND="
+ gnu? ( >=app-arch/cpio-2.13-r4 )
+ libarchive? ( app-arch/libarchive )
+ !<app-arch/cpio-2.13-r4
+"
+
+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
+}
diff --git a/app-alternatives/cpio/metadata.xml b/app-alternatives/cpio/metadata.xml
new file mode 100644
index 000000000000..77435f8882ae
--- /dev/null
+++ b/app-alternatives/cpio/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>mgorny@gentoo.org</email>
+ <name>Michał Górny</name>
+ </maintainer>
+ <use>
+ <flag name="gnu">
+ Symlink to GNU cpio (<pkg>app-arch/cpio</pkg>)
+ </flag>
+ <flag name="libarchive">
+ Symlink to bsdcpio from <pkg>app-arch/libarchive</pkg>
+ </flag>
+ </use>
+</pkgmetadata>