Package: python2.7-minimal Version: 2.7.18-13.1 Severity: wishlist Tags: patch User: pkg-systemd-maintain...@lists.alioth.debian.org Usertags: systemd-binfmt
Hi, your package python2.7-minimal declares a dependency (Suggests) on binfmt-support and ships binfmt-support configuration files in /usr/share/binfmts/. systemd provides a builtin, cross-distro facility named systemd-binfmt to register binary formats. You can read more about it at https://www.freedesktop.org/software/systemd/man/systemd-binfmt.html https://www.freedesktop.org/software/systemd/man/binfmt.d.html https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html The systemd package provides a dpkg file trigger so it is sufficient to simply install configuration files in /usr/lib/binfmt.d/, no modifications in the maintainer scripts are necessary. The attached patch ships a configuration file for systemd-binfmt which will automatically enable binfmt support for python2.7 without requiring further dependencies. Regards, Michael
diff -u python2.7-2.7.18/debian/rules python2.7-2.7.18/debian/rules --- python2.7-2.7.18/debian/rules +++ python2.7-2.7.18/debian/rules @@ -1142,11 +1142,15 @@ : # generate binfmt file mkdir -p $(d_min)/usr/share/binfmts + mkdir -p $(d_min)/usr/lib/binfmt.d ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) $(buildd_static)/python debian/mkbinfmt.py $(PVER) \ > $(d_min)/usr/share/binfmts/$(PVER) + $(buildd_static)/python debian/mkbinfmtconf.py $(PVER) \ + > $(d_min)/usr/lib/binfmt.d/$(PVER).conf else $(PVER) debian/mkbinfmt.py $(PVER) > $(d_min)/usr/share/binfmts/$(PVER) + $(PVER) debian/mkbinfmtconf.py $(PVER) > $(d_min)/usr/lib/binfmt.d/$(PVER).conf endif : # desktop entry only in patch2: unchanged: --- python2.7-2.7.18.orig/debian/mkbinfmtconf.py +++ python2.7-2.7.18/debian/mkbinfmtconf.py @@ -0,0 +1,8 @@ +# mkbinfmt.py +import imp, sys, string, os.path + +magic = string.join(["\\x%.2x" % ord(c) for c in imp.get_magic()],"") + +name = sys.argv[1] + +print(":%s:M::%s::/usr/bin/%s:") % (name, magic, name)