diff -Nru ruby-rmagick-2.15.4+dfsg/debian/changelog ruby-rmagick-2.15.4+dfsg/debian/changelog
--- ruby-rmagick-2.15.4+dfsg/debian/changelog 2016-11-29 17:00:20.000000000 -0800
+++ ruby-rmagick-2.15.4+dfsg/debian/changelog 2016-12-01 15:36:05.000000000 -0800
@@ -1,3 +1,10 @@
+ruby-rmagick (2.15.4+dfsg-2ubuntu1) zesty; urgency=medium
+
+ * d/rules: add fixed dependency on the imagemagick library used to
+ build this package.
+
+ -- Nishanth Aravamudan <nish.aravamudan@canonical.com> Thu, 01 Dec 2016 15:36:05 -0800
+
ruby-rmagick (2.15.4+dfsg-2build1) zesty; urgency=medium
* No change rebuild against src:imagemagick 1:6.9.6.6+dfsg-1.
diff -Nru ruby-rmagick-2.15.4+dfsg/debian/rules ruby-rmagick-2.15.4+dfsg/debian/rules
--- ruby-rmagick-2.15.4+dfsg/debian/rules 2016-08-16 07:29:37.000000000 -0700
+++ ruby-rmagick-2.15.4+dfsg/debian/rules 2016-12-01 15:35:55.000000000 -0800
@@ -12,3 +12,14 @@
find debian/*/usr/share/doc/ruby-rmagick-doc/ \
-type f -executable -exec \
chmod -x '{}' ';'
+
+override_dh_shlibdeps:
+ # this should be debian/ruby-rmagick/DEBIAN/shlibs, but doesn't seem to work?
+ find debian/ruby-rmagick/ -name RMagick2.so -exec ldd '{}' ';' | \
+ awk '/\/libMagickCore-6.Q16/ {print $$3}' | xargs dpkg -S | \
+ awk '{print $$1}' | sed 's/:$$//' | xargs dpkg-query -W \
+ -f='libMagickCore-6.Q16 2 $${Package} (>= $${Version})\n' > debian/shlibs.local
+ dh_shlibdeps
+
+override_dh_clean:
+ dh_clean debian/shlibs.local