Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-alternatives/cpio/
Date: Mon, 28 Nov 2022 14:31:43
Message-Id: 1669645894.46383ee643312058585dab843b2dd501a3c69a2c.mgorny@gentoo
1 commit: 46383ee643312058585dab843b2dd501a3c69a2c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 22 20:05:23 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 28 14:31:34 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=46383ee6
7
8 app-alternatives/cpio: Add an ebuild for /bin/cpio symlink
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 app-alternatives/cpio/cpio-0.ebuild | 36 ++++++++++++++++++++++++++++++++++++
13 app-alternatives/cpio/metadata.xml | 20 ++++++++++++++++++++
14 2 files changed, 56 insertions(+)
15
16 diff --git a/app-alternatives/cpio/cpio-0.ebuild b/app-alternatives/cpio/cpio-0.ebuild
17 new file mode 100644
18 index 000000000000..20af68ac0123
19 --- /dev/null
20 +++ b/app-alternatives/cpio/cpio-0.ebuild
21 @@ -0,0 +1,36 @@
22 +# Copyright 2022 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=8
26 +
27 +DESCRIPTION="CPIO symlink"
28 +HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Base/Alternatives"
29 +SRC_URI=""
30 +S=${WORKDIR}
31 +
32 +LICENSE="CC0-1.0"
33 +SLOT="0"
34 +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"
35 +IUSE="+gnu libarchive split-usr"
36 +REQUIRED_USE="^^ ( gnu libarchive )"
37 +
38 +RDEPEND="
39 + gnu? ( >=app-arch/cpio-2.13-r4 )
40 + libarchive? ( app-arch/libarchive )
41 + !<app-arch/cpio-2.13-r4
42 +"
43 +
44 +src_install() {
45 + local usr_prefix=
46 + use split-usr && usr_prefix=../usr/bin/
47 +
48 + if use gnu; then
49 + dosym gcpio /bin/cpio
50 + newman - cpio.1 <<<".so gcpio.1"
51 + elif use libarchive; then
52 + dosym "${usr_prefix}bsdcpio" /bin/cpio
53 + newman - cpio.1 <<<".so bsdcpio.1"
54 + else
55 + die "Invalid USE flag combination (broken REQUIRED_USE?)"
56 + fi
57 +}
58
59 diff --git a/app-alternatives/cpio/metadata.xml b/app-alternatives/cpio/metadata.xml
60 new file mode 100644
61 index 000000000000..77435f8882ae
62 --- /dev/null
63 +++ b/app-alternatives/cpio/metadata.xml
64 @@ -0,0 +1,20 @@
65 +<?xml version="1.0" encoding="UTF-8"?>
66 +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
67 +<pkgmetadata>
68 + <maintainer type="project">
69 + <email>base-system@g.o</email>
70 + <name>Gentoo Base System</name>
71 + </maintainer>
72 + <maintainer type="person">
73 + <email>mgorny@g.o</email>
74 + <name>Michał Górny</name>
75 + </maintainer>
76 + <use>
77 + <flag name="gnu">
78 + Symlink to GNU cpio (<pkg>app-arch/cpio</pkg>)
79 + </flag>
80 + <flag name="libarchive">
81 + Symlink to bsdcpio from <pkg>app-arch/libarchive</pkg>
82 + </flag>
83 + </use>
84 +</pkgmetadata>