From c34efbebd577644674a7cf543b3e0540c9f0fa9f Mon Sep 17 00:00:00 2001 From: Antonio Russo Date: Fri, 7 Jul 2017 13:45:17 -0400 Subject: [PATCH] Prevent dependencies on Debianized packages Call dpkg-shlibdeps with arguments excluding the Debianized packages lib{uutil1,nvpair1,zfs2,zpool2}linux from the auto-generated dependencies of generated .debs. A shim dh_shlibdeps that calls the real dh_shlibdeps with corresponding arguments is installed into a temporary directory, which is in turn pre-pended to the PATH for the alien call, working around alien's inability to directly alter the dependencies of its output debs. Resolves #6106. Signed-off-by: Brian Behlendorf Signed-off-by: Antonio Russo Closes #6309 Closes #6106 --- config/deb.am | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/config/deb.am b/config/deb.am index 648417b2a..6665e4a2d 100644 --- a/config/deb.am +++ b/config/deb.am @@ -38,9 +38,24 @@ if CONFIG_USER pkg7=$${name}-test-$${version}.$${arch}.rpm; \ pkg8=$${name}-dracut-$${version}.$${arch}.rpm; \ pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \ +## Arguments need to be passed to dh_shlibdeps. Alien provides no mechanism +## to do this, so we install a shim onto the path which calls the real +## dh_shlibdeps with the required arguments. + path_prepend=`mktemp -d /tmp/intercept.XXX`; \ + echo "#$(SHELL)" > $${path_prepend}/dh_shlibdeps; \ + echo "`which dh_shlibdeps` -- \ + -xlibuutil1linux -xlibnvpair1linux -xlibzfs2linux -xlibzpool2linux" \ + >> $${path_prepend}/dh_shlibdeps; \ +## These -x arguments are passed to dpkg-shlibdeps, which exclude the +## Debianized packages from the auto-generated dependencies of the new debs, +## which should NOT be mixed with the alien-generated debs created here + chmod +x $${path_prepend}/dh_shlibdeps; \ + env PATH=$${path_prepend}:$${PATH} \ fakeroot $(ALIEN) --bump=0 --scripts --to-deb \ $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \ - $$pkg8 $$pkg9; + $$pkg8 $$pkg9; \ + $(RM) $${path_prepend}/dh_shlibdeps; \ + rmdir $${path_prepend}; \ $(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \ $$pkg8 $$pkg9; endif