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