summaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
authorLibravatar Helmut Grohne <[email protected]>2024-06-06 00:30:00 +0200
committerLibravatar Santiago Vila <[email protected]>2024-06-06 17:20:21 +0200
commit0f4e218448a573886b560d59086457670956a41b (patch)
tree9136d9f33e276cc97e214313fa9c96e598e2b6be /debian/rules
parentd888609a4138041893295f76938b7596b8e85062 (diff)
downloadbase-files-0f4e218448a573886b560d59086457670956a41b.tar.gz
base-files-0f4e218448a573886b560d59086457670956a41b.zip
DEP17: Install /usr-merge aliasing symlinks. Closes: #1064459.
Diffstat (limited to '')
-rwxr-xr-xdebian/rules28
1 files changed, 27 insertions, 1 deletions
diff --git a/debian/rules b/debian/rules
index 05dfb39..17ad36f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,7 @@
#!/usr/bin/make -f
+include /usr/share/dpkg/architecture.mk
+
OSNAME = "GNU/`uname | sed -e 's/GNU\///'`"
ifeq ($(DEB_HOST_GNU_SYSTEM),linux)
OSNAME=GNU/Linux
@@ -11,6 +13,14 @@ endif
VENDORFILE = debian
DESTDIR = debian/base-files
+ifneq (,$(filter $(DEB_HOST_ARCH),amd64 loong64 mips64el ppc64 ppc64el sparc64))
+ USR_MERGE_RTLDLIB = lib64
+else ifneq (,$(filter $(DEB_HOST_ARCH),x32))
+ USR_MERGE_RTLDLIB = libx32
+endif
+USR_MERGE = bin lib sbin $(USR_MERGE_RTLDLIB)
+USR_MERGE_MULTILIB = $(filter-out $(USR_MERGE),lib32 lib64 libo32 libx32)
+
%:
dh $@
@@ -19,6 +29,15 @@ execute_after_dh_clean:
override_dh_auto_build:
sh debian/check-md5sum-etc profile
+ set -e; { \
+ echo "# Triggers for creating multilib aliasing symlinks on demand"; \
+ for d in $(USR_MERGE_MULTILIB); do \
+ echo "interest-noawait /usr/$$d"; \
+ done; \
+ } > debian/triggers
+
+execute_after_dh_installdirs:
+ dh_installdirs $(foreach d,$(USR_MERGE),usr/$(d))
override_dh_auto_install:
install -p -m 644 etc/* $(DESTDIR)/etc
@@ -42,6 +61,10 @@ override_dh_installchangelogs:
override_dh_link:
dh_link -X os-release
+ # We want these links to be relative, so we cannot use dh_link.
+ set -e; for d in $(USR_MERGE); do \
+ ln -s usr/$$d debian/base-files/$$d; \
+ done
override_dh_compress:
dh_compress -X README
@@ -55,4 +78,7 @@ override_dh_fixperms:
cd debian/base-files && chmod 700 root
override_dh_installdeb:
- dh_installdeb -DVENDORFILE=$(VENDORFILE)
+ dh_installdeb \
+ '-DVENDORFILE=$(VENDORFILE)' \
+ '-DUSR_MERGE_MULTILIB=$(USR_MERGE_MULTILIB)' \
+ '-DUSR_MERGE_RTLDLIB=$(USR_MERGE_RTLDLIB)'