diff --git a/debian/changelog b/debian/changelog
index c84316e1b4f22150464673f3d1271574539a4ee0..394637402d9738cde594aca23968df4c79718abb 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 de4d29ede734356297d45f1d38c75c8040387a51..188ec16deb53a7aea4db24489a6627a74ffa156b 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/ ";"