The 2 patches attached are based on 3.11.0-4. The first is wishlist, but
makes it easier for people who do Ruby to contribute patches, and the
second is really necessary to unblock the ruby transition to 2.7.
From 2a8e4c97457cea256120c1a59f1db79a37d4200f Mon Sep 17 00:00:00 2001
From: Antonio Terceiro <terce...@debian.org>
Date: Thu, 9 Apr 2020 11:13:29 -0300
Subject: [PATCH 1/2] Add patch to not fail build when bundler is installed

Closes: #956300
---
 .../0007-Don-t-run-rspec-via-bundler.patch    | 26 +++++++++++++++++++
 debian/patches/series                         |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 debian/patches/0007-Don-t-run-rspec-via-bundler.patch

diff --git a/debian/patches/0007-Don-t-run-rspec-via-bundler.patch b/debian/patches/0007-Don-t-run-rspec-via-bundler.patch
new file mode 100644
index 00000000..31dc149b
--- /dev/null
+++ b/debian/patches/0007-Don-t-run-rspec-via-bundler.patch
@@ -0,0 +1,26 @@
+From: Antonio Terceiro <terce...@debian.org>
+Date: Thu, 9 Apr 2020 11:10:03 -0300
+Subject: Don't run rspec via bundler
+
+Closes: #956300
+---
+ CMakeLists.txt | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ab7eb2e..4ca0392 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -160,9 +160,9 @@ add_subdirectory(locales)
+ # Add test executables for unit testing
+ add_test(NAME "libfacter\\ tests" COMMAND libfacter_test)
+ if (RUBY_FOUND)
+-    find_program(BUNDLER_PATH NAMES bundle.bat bundle)
+-    if (BUNDLER_PATH)
+-        add_test(NAME "libfacter\\ specs" COMMAND ${BUNDLER_PATH} exec rspec WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/lib")
++    find_program(RSPEC_PATH NAMES rspec)
++    if (RSPEC_PATH)
++        add_test(NAME "libfacter\\ specs" COMMAND rspec WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/lib")
+     endif()
+ endif()
+ # Debian: disable the smoke tests, as the build environment lacks necessary
diff --git a/debian/patches/series b/debian/patches/series
index 8bae5647..9f3fef85 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@
 0004-rapidjson-1.1-compat.patch
 0005-fix-custom-facts-overriding-core.patch
 0006-FACT-1916-fix-route-parsing-on-Linux.patch
+0007-Don-t-run-rspec-via-bundler.patch
-- 
2.26.0

From f69a814783851391f2a27e317119d70554b5f419 Mon Sep 17 00:00:00 2001
From: Antonio Terceiro <terce...@debian.org>
Date: Thu, 9 Apr 2020 11:14:27 -0300
Subject: [PATCH 2/2] Add a dependency on the minimal Ruby version needed

Closes: #956301
---
 debian/control             | 2 +-
 debian/gen-ruby-dependency | 9 +++++++++
 debian/rules               | 4 ++++
 3 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100755 debian/gen-ruby-dependency

diff --git a/debian/control b/debian/control
index bb5757bd..9b6cdc87 100644
--- a/debian/control
+++ b/debian/control
@@ -36,7 +36,7 @@ Homepage: https://github.com/puppetlabs/facter
 
 Package: facter
 Architecture: any
-Depends: libfacter3.11.0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
+Depends: libfacter3.11.0 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}, ${ruby-interpreter:Depends}
 Description: collect and display facts about the system
  Facter is Puppet’s cross-platform system profiling library. It discovers and
  reports per-node facts, which are collected by the Puppet agent and are made
diff --git a/debian/gen-ruby-dependency b/debian/gen-ruby-dependency
new file mode 100755
index 00000000..bcfd2a84
--- /dev/null
+++ b/debian/gen-ruby-dependency
@@ -0,0 +1,9 @@
+#!/usr/bin/ruby
+
+require 'ruby_debian_dev'
+
+dependency = RubyDebianDev::RUBY_INTERPRETERS.map do |interp, data|
+  lib = data[:shared_library]
+  RubyDebianDev.min_ruby_dependency_for(lib)
+end.join(', ')
+puts "ruby-interpreter:Depends=#{dependency}"
diff --git a/debian/rules b/debian/rules
index 5de884da..fda516b0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,3 +19,7 @@ override_dh_link:
 		   /usr/lib/$(DEB_HOST_MULTIARCH)/libfacter.so.$(DEB_VERSION_UPSTREAM) \
 		   "$${target}/libfacter.so"; \
 	done
+
+override_dh_gencontrol:
+	./debian/gen-ruby-dependency >> debian/facter.substvars
+	dh_gencontrol
-- 
2.26.0

Attachment: signature.asc
Description: PGP signature

Reply via email to