1 |
commit: d3a446d11fd0061c5826f18c0dc5d5a4b49dc4c1 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 1 17:26:45 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 2 03:47:23 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d3a446d1 |
7 |
|
8 |
app-alternatives/awk: New package to control awk symlinks |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
app-alternatives/awk/awk-2.ebuild | 59 ++++++++++++++++++++++++++++++++++++ |
13 |
app-alternatives/awk/metadata.xml | 20 +++++++++++- |
14 |
profiles/arch/amd64/package.use.mask | 4 +++ |
15 |
profiles/arch/base/package.use.mask | 4 +++ |
16 |
profiles/arch/x86/package.use.mask | 4 +++ |
17 |
5 files changed, 90 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/app-alternatives/awk/awk-2.ebuild b/app-alternatives/awk/awk-2.ebuild |
20 |
new file mode 100644 |
21 |
index 000000000000..01e69d65fbd1 |
22 |
--- /dev/null |
23 |
+++ b/app-alternatives/awk/awk-2.ebuild |
24 |
@@ -0,0 +1,59 @@ |
25 |
+# Copyright 2022 Gentoo Authors |
26 |
+# Distributed under the terms of the GNU General Public License v2 |
27 |
+ |
28 |
+EAPI=8 |
29 |
+ |
30 |
+DESCRIPTION="/bin/awk and /usr/bin/awk symlinks" |
31 |
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Base/Alternatives" |
32 |
+SRC_URI="" |
33 |
+S=${WORKDIR} |
34 |
+ |
35 |
+LICENSE="CC0-1.0" |
36 |
+SLOT="0" |
37 |
+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" |
38 |
+IUSE="busybox +gawk mawk nawk split-usr" |
39 |
+REQUIRED_USE="^^ ( busybox gawk mawk nawk )" |
40 |
+ |
41 |
+RDEPEND=" |
42 |
+ busybox? ( sys-apps/busybox ) |
43 |
+ gawk? ( sys-apps/gawk ) |
44 |
+ mawk? ( sys-apps/mawk ) |
45 |
+ nawk? ( sys-apps/nawk ) |
46 |
+ !app-eselect/eselect-awk |
47 |
+" |
48 |
+ |
49 |
+src_install() { |
50 |
+ local root_prefix= |
51 |
+ use split-usr && root_prefix=../../bin/ |
52 |
+ |
53 |
+ if use busybox; then |
54 |
+ dosym "${root_prefix}busybox" /usr/bin/awk |
55 |
+ newman - awk.1 <<<".so busybox.1" |
56 |
+ elif use gawk; then |
57 |
+ dosym gawk /usr/bin/awk |
58 |
+ newman - awk.1 <<<".so gawk.1" |
59 |
+ elif use mawk; then |
60 |
+ dosym mawk /usr/bin/awk |
61 |
+ newman - awk.1 <<<".so mawk.1" |
62 |
+ elif use nawk; then |
63 |
+ dosym nawk /usr/bin/awk |
64 |
+ newman - awk.1 <<<".so nawk.1" |
65 |
+ else |
66 |
+ die "Invalid USE flag combination (broken REQUIRED_USE?)" |
67 |
+ fi |
68 |
+ |
69 |
+ if use split-usr; then |
70 |
+ dosym ../usr/bin/awk /bin/awk |
71 |
+ fi |
72 |
+} |
73 |
+ |
74 |
+pkg_postrm() { |
75 |
+ # make sure we don't leave the user without the symlinks, since |
76 |
+ # they've not been owned by any other package |
77 |
+ if [[ ! -h ${EROOT}/usr/bin/awk ]]; then |
78 |
+ ln -s gawk "${EROOT}/usr/bin/awk" || die |
79 |
+ fi |
80 |
+ if [[ ! -h ${EROOT}/bin/awk ]]; then |
81 |
+ ln -s ../usr/bin/awk "${EROOT}/bin/awk" || die |
82 |
+ fi |
83 |
+} |
84 |
|
85 |
diff --git a/app-alternatives/awk/metadata.xml b/app-alternatives/awk/metadata.xml |
86 |
index 38ea143badef..0cf5fbf0d2f2 100644 |
87 |
--- a/app-alternatives/awk/metadata.xml |
88 |
+++ b/app-alternatives/awk/metadata.xml |
89 |
@@ -9,5 +9,23 @@ |
90 |
<email>base-system@g.o</email> |
91 |
<name>Gentoo Base System</name> |
92 |
</maintainer> |
93 |
- <stabilize-allarches/> |
94 |
+ <maintainer type="person"> |
95 |
+ <email>mgorny@g.o</email> |
96 |
+ <name>Michał Górny</name> |
97 |
+ </maintainer> |
98 |
+ <use> |
99 |
+ <flag name="busybox"> |
100 |
+ Symlink to <pkg>sys-apps/busybox</pkg> |
101 |
+ </flag> |
102 |
+ <flag name="gawk"> |
103 |
+ Symlink to <pkg>sys-apps/gawk</pkg> |
104 |
+ </flag> |
105 |
+ <flag name="mawk"> |
106 |
+ Symlink to <pkg>sys-apps/mawk</pkg> (warning: mawk is |
107 |
+ not fully POSIX-compliant) |
108 |
+ </flag> |
109 |
+ <flag name="nawk"> |
110 |
+ Symlink to <pkg>sys-apps/nawk</pkg> |
111 |
+ </flag> |
112 |
+ </use> |
113 |
</pkgmetadata> |
114 |
|
115 |
diff --git a/profiles/arch/amd64/package.use.mask b/profiles/arch/amd64/package.use.mask |
116 |
index 27207c6da3f9..317dfc821763 100644 |
117 |
--- a/profiles/arch/amd64/package.use.mask |
118 |
+++ b/profiles/arch/amd64/package.use.mask |
119 |
@@ -17,6 +17,10 @@ |
120 |
|
121 |
#--- END OF EXAMPLES --- |
122 |
|
123 |
+# Michał Górny <mgorny@g.o> (2022-12-01) |
124 |
+# Keyworded here. |
125 |
+app-alternatives/awk -nawk |
126 |
+ |
127 |
# Guillermo Joandet <gjoandet@×××××.com> (2022-11-22) |
128 |
# app-text/pandoc is keyworded on this architecture |
129 |
net-libs/gssdp -man |
130 |
|
131 |
diff --git a/profiles/arch/base/package.use.mask b/profiles/arch/base/package.use.mask |
132 |
index 5a1455d90b27..8ca1e3eda94e 100644 |
133 |
--- a/profiles/arch/base/package.use.mask |
134 |
+++ b/profiles/arch/base/package.use.mask |
135 |
@@ -1,6 +1,10 @@ |
136 |
# Copyright 1999-2022 Gentoo Authors |
137 |
# Distributed under the terms of the GNU General Public License v2 |
138 |
|
139 |
+# Michał Górny <mgorny@g.o> (2022-12-01) |
140 |
+# Not widely keyworded. |
141 |
+app-alternatives/awk nawk |
142 |
+ |
143 |
# Mike Gilbert <floppym@g.o> (2022-10-16) |
144 |
# Only supported on MIPS. |
145 |
dev-lang/gnat-gpl fixed-point |
146 |
|
147 |
diff --git a/profiles/arch/x86/package.use.mask b/profiles/arch/x86/package.use.mask |
148 |
index a68e233ecfd9..b733021ebde4 100644 |
149 |
--- a/profiles/arch/x86/package.use.mask |
150 |
+++ b/profiles/arch/x86/package.use.mask |
151 |
@@ -1,6 +1,10 @@ |
152 |
# Copyright 1999-2022 Gentoo Authors |
153 |
# Distributed under the terms of the GNU General Public License v2 |
154 |
|
155 |
+# Michał Górny <mgorny@g.o> (2022-12-01) |
156 |
+# Keyworded here. |
157 |
+app-alternatives/awk -nawk |
158 |
+ |
159 |
# Michał Górny <mgorny@g.o> (2022-11-16) |
160 |
# spirv-llvm-translator is not keyworded x86. |
161 |
dev-libs/libclc spirv |