Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/httpclient/
Date: Fri, 08 Apr 2022 09:15:49
Message-Id: 1649409338.82e6d9287ca91a00ceddb2f0d15cd2a902bd8f9c.graaff@gentoo
1 commit: 82e6d9287ca91a00ceddb2f0d15cd2a902bd8f9c
2 Author: Hans de Graaff <graaff <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 8 08:02:29 2022 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 8 09:15:38 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82e6d928
7
8 dev-ruby/httpclient: update EAPI 5 -> 8
9
10 Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>
11
12 dev-ruby/httpclient/httpclient-2.8.3-r2.ebuild | 78 ++++++++++++++++++++++++++
13 1 file changed, 78 insertions(+)
14
15 diff --git a/dev-ruby/httpclient/httpclient-2.8.3-r2.ebuild b/dev-ruby/httpclient/httpclient-2.8.3-r2.ebuild
16 new file mode 100644
17 index 000000000000..08ca687239b9
18 --- /dev/null
19 +++ b/dev-ruby/httpclient/httpclient-2.8.3-r2.ebuild
20 @@ -0,0 +1,78 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +USE_RUBY="ruby26 ruby27 ruby30"
27 +
28 +RUBY_FAKEGEM_TASK_TEST="-Ilib test"
29 +RUBY_FAKEGEM_TASK_DOC="doc"
30 +
31 +RUBY_FAKEGEM_DOCDIR="doc"
32 +
33 +RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"
34 +
35 +RUBY_FAKEGEM_GEMSPEC="httpclient.gemspec"
36 +
37 +inherit ruby-fakegem
38 +
39 +DESCRIPTION="'httpclient' gives something like the functionality of libwww-perl (LWP) in Ruby"
40 +HOMEPAGE="https://github.com/nahi/httpclient"
41 +SRC_URI="https://github.com/nahi/httpclient/archive/v${PV}.tar.gz -> ${P}.tgz"
42 +
43 +LICENSE="Ruby"
44 +SLOT="0"
45 +
46 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris ~x86-solaris"
47 +IUSE=""
48 +
49 +ruby_add_rdepend "virtual/ruby-ssl"
50 +
51 +ruby_add_bdepend "doc? ( dev-ruby/rdoc )"
52 +ruby_add_bdepend "test? ( dev-ruby/test-unit dev-ruby/http-cookie )"
53 +
54 +all_ruby_prepare() {
55 + rm Gemfile || die
56 + sed -i -e '/[bB]undler/s:^:#:' Rakefile || die
57 +
58 + # Fix documentation task
59 + sed -i -e 's/README.txt/README.md/' Rakefile || die
60 +
61 + # Remove mandatory CI reports since we don't need this for testing.
62 + sed -i -e '/reporter/s:^:#:' Rakefile || die
63 +
64 + # Remove mandatory simplecov dependency
65 + sed -i -e '/[Ss]imple[Cc]ov/ s:^:#:' test/helper.rb || die
66 +
67 + # Comment out test requiring network access that makes assumptions
68 + # about the environment, bug 395155
69 + sed -i -e '/test_async_error/,/^ end/ s:^:#:' test/test_httpclient.rb || die
70 +
71 + # Skip tests using rack-ntlm which is not packaged. Weirdly these
72 + # only fail on jruby.
73 + rm test/test_auth.rb || die
74 +
75 + # Skip test failing due to hard-coded expired certificate
76 + sed -i -e '/test_verification_without_httpclient/,/^ end/ s:^:#:' test/test_ssl.rb || die
77 +
78 + # Skip test depending on obsolete and vulnerable SSLv3
79 + sed -i -e '/test_no_sslv3/,/^ end/ s:^:#:' test/test_ssl.rb || die
80 +
81 + # Do not use 11-year-old bundled certificates!
82 + # fix this copy so it doesn't fail tests
83 + ln -sf "${EPREFIX}"/etc/ssl/certs/ca-certificates.crt ./dist_key/cacerts.pem
84 + ln -sf "${EPREFIX}"/etc/ssl/certs/ca-certificates.crt ./lib/httpclient/cacert.pem
85 +}
86 +
87 +each_ruby_test() {
88 + ${RUBY} -Ilib:test:. -e 'gem "test-unit"; Dir["test/test_*.rb"].each{|f| require f}' || die
89 +}
90 +
91 +each_ruby_install() {
92 + each_fakegem_install
93 + # Do not use 11-year-old bundled certificates!
94 + # fix this copy for production systems
95 + # do not ship the cacert1024.pem at all anymore, nobody should use RSA1024 certs!
96 + rm -f "${ED}/$(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/lib/httpclient/"{cacert.pem,cacert1024}.pem
97 + dosym -r /etc/ssl/certs/ca-certificates.crt $(ruby_fakegem_gemsdir)/gems/${RUBY_FAKEGEM_NAME}-${RUBY_FAKEGEM_VERSION}/lib/httpclient/cacert.pem
98 +}