diff --git a/debian/.gitignore b/debian/.gitignore index 71b58d2108bc740fab3e49e8db04b38124d38865..642ca1661ba18469d15e5c5a924d12d33a003c60 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -10,6 +10,7 @@ /libcapsule-doc/ /libcapsule-gl-shims/ /libcapsule-tools/ +/libcapsule-tools-relocatable/ /libcapsule-libgl1-shims/ /libcapsule-tests/ /libcapsule0/ diff --git a/debian/control b/debian/control index 9962ebc9b458fb1109a6d338ffba3a602f4fdf14..0b9ebb70ec0515c43a1edc6a72a5a75ff355e2e8 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,7 @@ Build-Depends: autoconf-archive <pkg.libcapsule.from-git>, automake, bubblewrap, + chrpath, debhelper, dh-autoreconf, gtk-doc-tools, @@ -73,6 +74,26 @@ Description: . This package contains the files needed to generate libcapsule proxy libraries. +Package: libcapsule-tools-relocatable +Architecture: amd64 i386 +Multi-Arch: same +Section: misc +Depends: + ${shlibs:Depends}, +Description: + libcapsule is a helper library used to implement segregated run-time + dynamic linking proxy libraries - used (for example) to load a library + that has dependencies incompatible with the regular libraries that are + part of the host OS, such as an incompatible libstdc++ version. + . + This package contains relocatable versions of the tools used to enumerate + library symbols and dependencies. After building this package on a system + with the oldest glibc that is to be supported, they can be bundled in + projects that need to run on an arbitrary host system and make use of + libcapsule to prepare a container. To do this, the relocatable tools + must be copied to PATH/bin/TUPLE-capsule-TOOL, and their required + non-glibc libraries (libelf and zlib) must be copied to PATH/lib/TUPLE. + Package: libcapsule-gl-shims Architecture: amd64 i386 Multi-Arch: same diff --git a/debian/libcapsule-tools-relocatable.install b/debian/libcapsule-tools-relocatable.install new file mode 100644 index 0000000000000000000000000000000000000000..9084c938a29f73f325125b8df88139f89957a8b8 --- /dev/null +++ b/debian/libcapsule-tools-relocatable.install @@ -0,0 +1 @@ +usr/lib/libcapsule/relocatable diff --git a/debian/rules b/debian/rules index aaa4d8c16cf670bc574c608ba37eedd8d3d29f66..f2149a6c33f6fa51fc0a1a002e175fda2b7c8458 100755 --- a/debian/rules +++ b/debian/rules @@ -6,10 +6,13 @@ dh $@ --with autoreconf binaries := $(shell dh_listpackages) +fake_rpath := /_ORIGIN_/__/lib/${DEB_HOST_MULTIARCH} +real_rpath := $${ORIGIN}/../lib/${DEB_HOST_MULTIARCH} confflags = \ --disable-Werror \ --disable-silent-rules \ --enable-host-prefix=$(DEB_HOST_MULTIARCH)- \ + --enable-tools-rpath='${fake_rpath}' \ --libexecdir=\$${exec_prefix}/lib/libcapsule \ $(NULL) @@ -72,6 +75,26 @@ override_dh_auto_install: ln -s "$$bin" "$(DEB_HOST_GNU_TYPE)-$$tail"; \ done; \ fi + install -d debian/tmp/usr/lib/libcapsule/relocatable + cp -a \ + debian/tmp/usr/bin/*-capsule-capture-libs \ + debian/tmp/usr/bin/*-capsule-elf-dump \ + debian/tmp/usr/bin/*-capsule-symbols \ + debian/tmp/usr/bin/*-capsule-version \ + debian/tmp/usr/lib/libcapsule/relocatable + set -e; for bin in debian/tmp/usr/bin/$(DEB_HOST_MULTIARCH)-*; do \ + case "$$bin" in \ + (*-capsule-mkstublib) \ + ;; \ + (*) \ + chrpath -d "$$bin"; \ + chrpath -l "$$bin" || :; \ + ;; \ + esac; \ + done + chrpath -r '${real_rpath}' \ + debian/tmp/usr/lib/libcapsule/relocatable/$(DEB_HOST_MULTIARCH)-* + chrpath -l debian/tmp/usr/lib/libcapsule/relocatable/* $(MAKE) -C debian/libGL-proxy-build install V=1 $(proxy_vars) \ DESTDIR=$(CURDIR)/debian/libGL-proxy-build/shims install -d debian/tmp/usr/lib/libcapsule/shims/lib/$(DEB_HOST_MULTIARCH)