commit:     92057e0c4b623933276ab2b785c4757d56a67788
Author:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 24 05:38:30 2024 +0000
Commit:     Hans de Graaff <graaff <AT> gentoo <DOT> org>
CommitDate: Wed Apr 24 05:43:49 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=92057e0c

dev-ruby/pcaprub: add 0.13.2

Signed-off-by: Hans de Graaff <graaff <AT> gentoo.org>

 dev-ruby/pcaprub/Manifest              |  1 +
 dev-ruby/pcaprub/pcaprub-0.13.2.ebuild | 65 ++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/dev-ruby/pcaprub/Manifest b/dev-ruby/pcaprub/Manifest
index ca57801dd0ad..fc224458750d 100644
--- a/dev-ruby/pcaprub/Manifest
+++ b/dev-ruby/pcaprub/Manifest
@@ -1 +1,2 @@
 DIST pcaprub-0.13.1.gem 36864 BLAKE2B 
8a0f035d2d66cb21b8314e1f855f18fa71824ffaaa3260faa90f71dbd55172701cf0105f8dce91f3107dd455b5480170a2490a2b5a13f25b46a390401fc8b8e0
 SHA512 
3079a5f7b29df502b5bbf0afdb7c670c9a43fbb4024163001018ebffd660597197cb0c146005f1ce027f00f2ba4c2e0430a8574cb10c4fac310a8b04411c53dd
+DIST pcaprub-0.13.2.gem 36864 BLAKE2B 
1bb0f37faa0752a7cb9b5c76f071596cf11b2c52dc3d16cd1fb577d7467afff3b46a7e4bb53436677231418ed8c0f91c91970366d4040f9ddf0491e50c52dfe5
 SHA512 
1be60a684ead0a91bd113150ac426f86f30b906bc2a300ac334ac9cc323406e4680d9578070d9f39cb479d9a45c2e4f42c11db9ca5531f8d5dee8d1dfc01425f

diff --git a/dev-ruby/pcaprub/pcaprub-0.13.2.ebuild 
b/dev-ruby/pcaprub/pcaprub-0.13.2.ebuild
new file mode 100644
index 000000000000..db30184a51d2
--- /dev/null
+++ b/dev-ruby/pcaprub/pcaprub-0.13.2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+USE_RUBY="ruby31 ruby32 ruby33"
+
+RUBY_FAKEGEM_EXTRADOC="FAQ.rdoc README.rdoc USAGE.rdoc"
+RUBY_FAKEGEM_EXTENSIONS=(ext/pcaprub_c/extconf.rb)
+RUBY_FAKEGEM_TASK_TEST="test"
+inherit ruby-fakegem
+
+DESCRIPTION="Libpcap bindings for ruby compat"
+HOMEPAGE="https://rubygems.org/gems/pcaprub";
+
+LICENSE="LGPL-2.1"
+SLOT="$(ver_cut 1-2)"
+KEYWORDS="~amd64 ~arm ~x86"
+
+DEPEND+="net-libs/libpcap"
+RDEPEND+="net-libs/libpcap"
+
+ruby_add_bdepend "
+       test? (
+               >=dev-ruby/rake-compiler-0.6.0
+               dev-ruby/shoulda-context
+       )
+"
+
+all_ruby_prepare() {
+       sed -i \
+               -e '/\(minitest\|shoulda-context\)/s:~>:>=:' \
+               -e '/coveralls/d' \
+               -e '/rubygems-tasks/d' \
+               -e '/gem.*git/d' \
+               Gemfile || die
+
+       sed -i \
+               -e '/rubygems\/tasks/d' \
+               -e '/Gem::Tasks/d' \
+               -e "/^require 'git'/,/end/ s/^/#/" \
+               Rakefile || die
+
+       sed -i -e '/coveralls/Id' test/test_helper.rb || die
+
+       # Tests which need escalated privileges
+       local privileged_tests=(
+               test_set_datalink
+               test_create_from_primitives
+               test_filter
+               test_pcap_stats
+               test_pcap_datalink
+               test_pcap_inject
+               test_pcap_next
+               test_pcap_setfilter
+               test_pcap_snapshot
+       )
+
+       local privileged_tests_expr=$(printf "%s\|" "${privileged_tests[@]}")
+       privileged_tests_expr="${privileged_tests_expr::-2}"
+
+       sed -i \
+               -e "/def \(${privileged_tests_expr}\)/,/^  end/s/^/#/" \
+               test/test_pcaprub_unit.rb || die
+}

Reply via email to