Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/rex/
Date: Fri, 30 Jul 2021 19:28:48
Message-Id: 1627673326.7139e93e8d05700ed56bd241c3a4f169398afafb.monsieurp@gentoo
1 commit: 7139e93e8d05700ed56bd241c3a4f169398afafb
2 Author: Ferenc Erki <erkiferenc <AT> gmail <DOT> com>
3 AuthorDate: Wed Jul 7 22:11:51 2021 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 30 19:28:46 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7139e93e
7
8 app-admin/rex: version bump to 1.13.4.
9
10 Signed-off-by: Ferenc Erki <erkiferenc <AT> gmail.com>
11 Closes: https://github.com/gentoo/gentoo/pull/21555
12 Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org>
13
14 app-admin/rex/Manifest | 1 +
15 app-admin/rex/rex-1.13.4.ebuild | 220 ++++++++++++++++++++++++++++++++++++++++
16 2 files changed, 221 insertions(+)
17
18 diff --git a/app-admin/rex/Manifest b/app-admin/rex/Manifest
19 index 6bac2adedf4..cfbe2dfde19 100644
20 --- a/app-admin/rex/Manifest
21 +++ b/app-admin/rex/Manifest
22 @@ -1 +1,2 @@
23 DIST Rex-1.13.3.tar.gz 349550 BLAKE2B c2ccc2144e56761d33ed2b5d790febd49863639d2e3bba8028b7937b43eb51e7e59e9e99cb1d67f247b2dff8ef91aa04776afd6277ad8a2370f35d71e0b528dd SHA512 beab22aef8ba620b6e74847698eab99977844d2e9632812a9ae0e1ee303cbe4e5a6489000bd5209d76e42e3bb4bb799a90408ed6fb14e034f68132a4d37766dc
24 +DIST Rex-1.13.4.tar.gz 351011 BLAKE2B ec046b88f4443b03c05efbabb40900085293c61dab0ee9818a8c4d05be3cc0a1c1f53738b72cc245aaa2dfbcb00541f0e1e31b0c20f2464e9fc6586ed10707ef SHA512 27b76f4b527b42ea0b06dc1de05254dbd6e2fa3bc9a8a708af7557789ef22aec374a5d0585bf3ec4ee878a5387d51b881cf95855dbd05149b7b23929de12027d
25
26 diff --git a/app-admin/rex/rex-1.13.4.ebuild b/app-admin/rex/rex-1.13.4.ebuild
27 new file mode 100644
28 index 00000000000..cad3166f1de
29 --- /dev/null
30 +++ b/app-admin/rex/rex-1.13.4.ebuild
31 @@ -0,0 +1,220 @@
32 +# Copyright 1999-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +
37 +if [[ ${PV} == 9999 ]]; then
38 + GITHUB_USER=RexOps
39 + GITHUB_REPO=Rex
40 + EGIT_REPO_URI="https://github.com/${GITHUB_USER}/${GITHUB_REPO}.git"
41 + EGIT_BRANCH="master"
42 + EGIT_CHECKOUT_DIR="${WORKDIR}/${PN}-git"
43 + VCS_ECLASS="git-r3"
44 +else
45 + # This is intentional to stop perl-module.eclass doing magic things when it
46 + # shouldn't. Like making ${S} contain "Rex" when the git clone has "rex"
47 + # Also prevents perl-module.eclass provisioning SRC_URI
48 + DIST_AUTHOR=FERKI
49 + DIST_NAME=Rex
50 + KEYWORDS="~amd64 ~x86"
51 +fi
52 +inherit bash-completion-r1 perl-module ${VCS_ECLASS}
53 +
54 +DESCRIPTION="(R)?ex, the friendly automation framework"
55 +HOMEPAGE="https://metacpan.org/release/Rex https://www.rexify.org"
56 +
57 +SLOT="0"
58 +IUSE="minimal test"
59 +RESTRICT="!test? ( test )"
60 +
61 +DZIL_DEPENDS="
62 + dev-perl/Dist-Zilla
63 + dev-perl/Dist-Zilla-Plugin-CheckExtraTests
64 + dev-perl/Dist-Zilla-Plugin-ContributorsFile
65 + dev-perl/Dist-Zilla-Plugin-Git
66 + dev-perl/Dist-Zilla-Plugin-Git-Contributors
67 + dev-perl/Dist-Zilla-Plugin-MakeMaker-Awesome
68 + dev-perl/Dist-Zilla-Plugin-Meta-Contributors
69 + dev-perl/Dist-Zilla-Plugin-MetaProvides-Package
70 + dev-perl/Dist-Zilla-Plugin-NextVersion-Semantic
71 + dev-perl/Dist-Zilla-Plugin-OSPrereqs
72 + dev-perl/Dist-Zilla-Plugin-OurPkgVersion
73 + dev-perl/Dist-Zilla-Plugin-Run
74 + dev-perl/Software-License
75 +"
76 +RDEPEND="
77 + !minimal? (
78 + dev-perl/DBI
79 + dev-perl/Expect
80 + dev-perl/IPC-Shareable
81 + dev-perl/XML-LibXML
82 + )
83 + virtual/perl-Carp
84 + virtual/perl-Data-Dumper
85 + dev-perl/Data-Validate-IP
86 + dev-perl/Devel-Caller
87 + dev-perl/Digest-HMAC
88 + virtual/perl-Digest-MD5
89 + virtual/perl-Exporter
90 + virtual/perl-File-Spec
91 + dev-perl/HTTP-Message
92 + dev-perl/Hash-Merge
93 + virtual/perl-IO
94 + dev-perl/IO-String
95 + dev-perl/IO-Tty
96 + dev-perl/JSON-MaybeXS
97 + virtual/perl-MIME-Base64
98 + dev-perl/Net-OpenSSH
99 + dev-perl/Net-SFTP-Foreign
100 + >=virtual/perl-Scalar-List-Utils-1.450.0
101 + dev-perl/Parallel-ForkManager
102 + dev-perl/Sort-Naturally
103 + dev-perl/String-Escape
104 + virtual/perl-Storable
105 + dev-perl/TermReadKey
106 + virtual/perl-Test-Simple
107 + dev-perl/Text-Glob
108 + virtual/perl-Text-Tabs+Wrap
109 + virtual/perl-Time-HiRes
110 + dev-perl/URI
111 + dev-perl/XML-Simple
112 + dev-perl/libwww-perl
113 + dev-perl/YAML
114 + virtual/perl-version
115 +"
116 +# NB: would add test? !minimal? Test-mysqld, but I can't get that to work
117 +BDEPEND="
118 + ${RDEPEND}
119 + >=virtual/perl-CPAN-Meta-Requirements-2.120.620
120 + >=virtual/perl-ExtUtils-MakeMaker-7.110.100
121 + >=dev-perl/File-ShareDir-Install-0.60.0
122 + virtual/perl-Module-Metadata
123 + test? (
124 + !minimal? (
125 + dev-perl/File-LibMagic
126 + )
127 + virtual/perl-File-Temp
128 + dev-perl/Test-Deep
129 + dev-perl/Test-Output
130 + dev-perl/Test-UseAllModules
131 + virtual/perl-autodie
132 + )
133 +"
134 +
135 +[[ ${PV} == 9999 ]] && BDEPEND+=" ${DZIL_DEPENDS}"
136 +
137 +src_unpack() {
138 + if [[ ${PV} == 9999 ]]; then
139 + "${VCS_ECLASS}"_src_unpack
140 + mkdir -p "${S}" || die "Can't make ${S}"
141 + else
142 + default
143 + fi
144 +}
145 +
146 +dzil_src_prep() {
147 + einfo "Patching dist.ini"
148 +
149 + # This block of sed invocations removes all plugins that aren't
150 + # useful for users to have on Gentoo, because all of them are
151 + # conditional and subjective style checks, which don't indicate
152 + # a real issue for users, and paying the price of their dependencies is undesired.
153 +
154 + # The {N;d} trick adds the [n]ext line after the match to the pattern-space
155 + # so that the final [d]elete deletes the next line too. Can be expanded for each
156 + # line, ie: {N;N;N;d} deletes 3 lines after the match as well as the match.
157 + sed -e '/^\[Test::Kwalitee\]/d' \
158 + -e '/^\[PodSyntaxTests\]/d' \
159 + -e '/^Perl::Critic::Freenode =/d' \
160 + -e '/^Perl::Critic::TooMuchCode =/d' \
161 + -e '/^Test::Kwalitee =/d' \
162 + -e '/^Test::PerlTidy =/d' \
163 + -e '/^Test::Pod =/d' \
164 + -e '/^\[Test::CPAN::Changes\]/{N;d}' \
165 + -e '/^\[OptionalFeature/,/^$/d' \
166 + -e '/^\[Test::MinimumVersion\]/{N;d}' \
167 + -i dist.ini || die "Can't patch dist.ini"
168 +
169 + # Removals/additions have to be tracked by git or dzil build fails
170 + # Spurious warning during src_prepare
171 + git rm -f xt/author/critic-progressive.t || die "Can't rm author/critic-progressive.t"
172 + # Spurious warning during src_prepare
173 + git rm -f xt/author/perltidy.t || die "Can't rm author/perltidy.t"
174 +}
175 +dzil_env_setup() {
176 + # NextRelease noise :(
177 + mkdir -p ~/.dzil/ || die "mkdir -p ~/.dzil/ failed"
178 + local user="$(whoami)"
179 + local host="$(hostname)"
180 + printf '[%%User]\nname = %s\nemail = %s' "${user}" "${user}@${host}" >> ~/.dzil/config.ini
181 +
182 +}
183 +dzil_to_distdir() {
184 + local dzil_root dest has_missing modname dzil_version
185 + dzil_root="$1"
186 + dest="$2"
187 +
188 + cd "${dzil_root}" || die "Can't enter git workdir '${dzil_root}'";
189 +
190 + S="${dzil_root}" dzil_src_prep
191 + dzil_env_setup
192 +
193 + dzil_version="$(dzil version)" || die "Error invoking 'dzil version'"
194 + einfo "Generating CPAN dist with ${dzil_version}"
195 +
196 + has_missing=""
197 +
198 + einfo "Checking dzil authordeps"
199 + while IFS= read -d $'\n' -r modname; do
200 + if [[ -z "${has_missing}" ]]; then
201 + has_missing=1
202 + eerror "'dzil authordeps' indicates missing build dependencies"
203 + eerror "These will prevent building, please report a bug"
204 + eerror "Missing:"
205 + fi
206 + eerror " ${modname}"
207 + done < <( dzil authordeps --missing --versions )
208 +
209 + [[ -z "${has_missing}" ]] || die "Satisfy all missing authordeps first"
210 +
211 + einfo "Checking dzil build deps"
212 + while IFS= read -d $'\n' -r modname; do
213 + if [[ -z "${has_missing}" ]]; then
214 + has_missing=1
215 + ewarn "'dzil listdeps' indicates missing build dependencies"
216 + ewarn "These may prevent building, please report a bug if they do"
217 + ewarn "Missing:"
218 + fi
219 + ewarn " ${modname}"
220 + done < <( dzil listdeps --missing --versions --author )
221 +
222 + einfo "Generating release"
223 + dzil build --notgz --in "${dest}" || die "Unable to build CPAN dist in '${dest}'"
224 +}
225 +
226 +src_prepare() {
227 + if [[ ${PV} == 9999 ]]; then
228 + # Uses git sources in WORKDIR/rex-git
229 + # to generate a CPAN-style tree in ${S}
230 + # before letting perl-module.eclass do the rest
231 + dzil_to_distdir "${EGIT_CHECKOUT_DIR}" "${S}"
232 + fi
233 + cd "${S}" || die "Can't enter build dir"
234 +
235 + # If you DIY installed Test::mysqld, but didn't patch
236 + # it to handle the fact on Gentoo, mysql_install_db is NOT in PATH
237 + # tests fail. So this test is patched out if mysql_install_db is not in PATH
238 + if perl_has_module "Test::mysqld" && ! type -P mysql_install_db >/dev/null; then
239 + perl_rm_files "t/db.t"
240 + fi
241 + perl-module_src_prepare
242 +}
243 +
244 +src_install() {
245 + newbashcomp "share/${PN}-tab-completion.bash" "${PN}"
246 +
247 + insinto /usr/share/zsh/site-functions
248 + newins "share/${PN}-tab-completion.zsh" "_${PN}"
249 +
250 + perl-module_src_install
251 +}