From 0927d3be44c7d72fafeaad721d75a93f1f1cf2b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Boutillier?= <boutil@debian.org>
Date: Wed, 26 Aug 2020 11:40:23 +0200
Subject: [PATCH] Replace 2.7.0 in d/rules by
 theRbConfig::RBCONFIG["ruby_version"] (Closes: #964320)

---
 debian/changelog | 11 +++++++++++
 debian/rules     |  9 ++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index c84316e..3946374 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+ruby-http-parser (1.2.1-4) UNRELEASED; urgency=medium
+
+  [ Pirate Praveen ]
+  * Allow version from backports to satisfy dependency
+
+  [ Cédric Boutillier ]
+  * Replace hardcoded 2.7.0 version in debian/rules by the output of
+    RbConfig::RBCONFIG["ruby_version"] (Closes: #964320)
+
+ -- Cédric Boutillier <boutil@debian.org>  Wed, 26 Aug 2020 11:37:49 +0200
+
 ruby-http-parser (1.2.1-3) unstable; urgency=medium
 
   * Team upload.
diff --git a/debian/rules b/debian/rules
index de4d29e..188ec16 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,12 +4,15 @@
 export GEM2DEB_TEST_RUNNER = --check-dependencies
 #export DH_RUBY = --gem-install
 
+RUBY_VERSION=`ruby -e 'puts RbConfig::CONFIG["ruby_version"]'`
+RUBY_ARCH=`ruby -e 'puts RbConfig::CONFIG["arch"]'`
+
 %:
 	dh $@ --buildsystem=ruby --with ruby
 
 override_dh_install:
 	dh_install
-	mv $(CURDIR)/debian/ruby-http-parser/usr/share/rubygems-integration/2.7.0 \
+	mv $(CURDIR)/debian/ruby-http-parser/usr/share/rubygems-integration/$(RUBY_VERSION) \
 	   $(CURDIR)/debian/ruby-http-parser/usr/share/rubygems-integration/all
-	mkdir -p $(CURDIR)/debian/ruby-http-parser/usr/lib/`ruby -e 'puts RbConfig::CONFIG["arch"]'`/ruby/vendor_ruby/
-	find ext/ -name "libhttp-parser-ext.so" -exec cp "{}" $(CURDIR)/debian/ruby-http-parser/usr/lib/`ruby -e 'puts RbConfig::CONFIG["arch"]'`/ruby/vendor_ruby/ ";"
+	mkdir -p $(CURDIR)/debian/ruby-http-parser/usr/lib/$(RUBY_ARCH)/ruby/vendor_ruby/
+	find ext/ -name "libhttp-parser-ext.so" -exec cp "{}" $(CURDIR)/debian/ruby-http-parser/usr/lib/$(RUBY_ARCH)/ruby/vendor_ruby/ ";"
-- 
GitLab