From c47b4da497f1276b6291c9ba242049aa4e86ea1c Mon Sep 17 00:00:00 2001
From: Slávek Banko <slavek.banko@axis.cz>
Date: Mon, 23 Feb 2026 21:32:12 +0100
Subject: DEB libr: Install libraries according to multi-arch rules.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since R14.1.6 – TDE/tde-cmake#140, the default location for /usr is
according to default multi-arch location used by the distribution.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
---
 debian/_base/dependencies/libr/debian/changelog               |  6 ++++++
 debian/_base/dependencies/libr/debian/control                 |  3 ++-
 debian/_base/dependencies/libr/debian/dirs                    |  2 --
 debian/_base/dependencies/libr/debian/libr-dev.dirs           |  3 +--
 debian/_base/dependencies/libr/debian/libr-dev.install        | 11 ++++-------
 .../_base/dependencies/libr/debian/libr-dev.lintian-overrides |  2 ++
 debian/_base/dependencies/libr/debian/libr1.install           |  2 +-
 debian/_base/dependencies/libr/debian/rules                   |  7 +++++++
 .../_base/dependencies/libr/debian/source.lintian-overrides   |  9 ---------
 .../_base/dependencies/libr/debian/source/lintian-overrides   |  9 +++++++++
 ubuntu/_base/dependencies/libr/debian/changelog               |  6 ++++++
 ubuntu/_base/dependencies/libr/debian/control                 |  3 ++-
 ubuntu/_base/dependencies/libr/debian/dirs                    |  2 --
 ubuntu/_base/dependencies/libr/debian/libr-dev.dirs           |  3 +--
 ubuntu/_base/dependencies/libr/debian/libr-dev.install        | 11 ++++-------
 .../_base/dependencies/libr/debian/libr-dev.lintian-overrides |  2 ++
 ubuntu/_base/dependencies/libr/debian/libr1.install           |  2 +-
 ubuntu/_base/dependencies/libr/debian/rules                   |  7 +++++++
 .../_base/dependencies/libr/debian/source.lintian-overrides   |  9 ---------
 .../_base/dependencies/libr/debian/source/lintian-overrides   |  9 +++++++++
 20 files changed, 64 insertions(+), 44 deletions(-)
 delete mode 100644 debian/_base/dependencies/libr/debian/dirs
 create mode 100644 debian/_base/dependencies/libr/debian/libr-dev.lintian-overrides
 delete mode 100644 debian/_base/dependencies/libr/debian/source.lintian-overrides
 create mode 100644 debian/_base/dependencies/libr/debian/source/lintian-overrides
 delete mode 100644 ubuntu/_base/dependencies/libr/debian/dirs
 create mode 100644 ubuntu/_base/dependencies/libr/debian/libr-dev.lintian-overrides
 delete mode 100644 ubuntu/_base/dependencies/libr/debian/source.lintian-overrides
 create mode 100644 ubuntu/_base/dependencies/libr/debian/source/lintian-overrides

diff --git a/debian/_base/dependencies/libr/debian/changelog b/debian/_base/dependencies/libr/debian/changelog
index e10d865e5..816d6af73 100644
--- a/debian/_base/dependencies/libr/debian/changelog
+++ b/debian/_base/dependencies/libr/debian/changelog
@@ -1,3 +1,9 @@
+libr (4:14.1.6~pre0-0) trixie; urgency=low
+
+  * Install libraries according to multi-arch rules.
+
+ -- Slávek Banko <slavek.banko@axis.cz>  Mon, 23 Feb 2026 21:18:10 +0100
+
 libr (4:0.6.0-2debian8.0.0+6~d) jessie; urgency=low
 
   * Fix mangling of a critical elf library section on armhf
diff --git a/debian/_base/dependencies/libr/debian/control b/debian/_base/dependencies/libr/debian/control
index 0401c36b4..fb437131a 100644
--- a/debian/_base/dependencies/libr/debian/control
+++ b/debian/_base/dependencies/libr/debian/control
@@ -1,5 +1,5 @@
 Source: libr
-Priority: extra
+Priority: optional
 Maintainer: TDE Debian Team <team-debian@trinitydesktop.org>
 Build-Depends: cdbs, tde-cdbs, debhelper (>= 10~), quilt, tde-cmake, ninja-build, pkgconf, libgtk2.0-dev, binutils-dev, doxygen
 Standards-Version: 3.8.4
@@ -9,6 +9,7 @@ Homepage: http://www.compholio.com/elficon/
 Package: libr1
 Section: libs
 Architecture: any
+Multi-Arch: same
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: ELF binary resource library
  Store and retrieve resources from ELF binaries.
diff --git a/debian/_base/dependencies/libr/debian/dirs b/debian/_base/dependencies/libr/debian/dirs
deleted file mode 100644
index ca882bbb7..000000000
--- a/debian/_base/dependencies/libr/debian/dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/sbin
diff --git a/debian/_base/dependencies/libr/debian/libr-dev.dirs b/debian/_base/dependencies/libr/debian/libr-dev.dirs
index 441fd8fc6..2405d8173 100644
--- a/debian/_base/dependencies/libr/debian/libr-dev.dirs
+++ b/debian/_base/dependencies/libr/debian/libr-dev.dirs
@@ -1,3 +1,2 @@
-usr/lib
-usr/include
 usr/include/libr
+usr/lib
diff --git a/debian/_base/dependencies/libr/debian/libr-dev.install b/debian/_base/dependencies/libr/debian/libr-dev.install
index 6fad4769a..fc8a1b7cb 100644
--- a/debian/_base/dependencies/libr/debian/libr-dev.install
+++ b/debian/_base/dependencies/libr/debian/libr-dev.install
@@ -1,9 +1,6 @@
-usr/include/*
 usr/include/libr/*
-usr/lib/lib*.a
-usr/lib/lib*.so
-usr/lib/*.la
-usr/lib/pkgconfig/*
+usr/lib/$(DEB_HOST_MULTIARCH)/lib*.a
+usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so
+usr/lib/$(DEB_HOST_MULTIARCH)/*.la
+usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/*
 usr/share/man/man3/*.3
-#usr/share/pkgconfig/*
-
diff --git a/debian/_base/dependencies/libr/debian/libr-dev.lintian-overrides b/debian/_base/dependencies/libr/debian/libr-dev.lintian-overrides
new file mode 100644
index 000000000..9f47b462b
--- /dev/null
+++ b/debian/_base/dependencies/libr/debian/libr-dev.lintian-overrides
@@ -0,0 +1,2 @@
+# Man pages are generated automatically.
+libr-dev: bad-whatis-entry
diff --git a/debian/_base/dependencies/libr/debian/libr1.install b/debian/_base/dependencies/libr/debian/libr1.install
index d0dbfd18a..48eab8981 100644
--- a/debian/_base/dependencies/libr/debian/libr1.install
+++ b/debian/_base/dependencies/libr/debian/libr1.install
@@ -1 +1 @@
-usr/lib/lib*.so.*
+usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so.*
diff --git a/debian/_base/dependencies/libr/debian/rules b/debian/_base/dependencies/libr/debian/rules
index 0b16c81e9..95c91da90 100755
--- a/debian/_base/dependencies/libr/debian/rules
+++ b/debian/_base/dependencies/libr/debian/rules
@@ -3,8 +3,15 @@
 include /usr/share/cdbs/1/rules/debhelper.mk
 -include /usr/share/cdbs/1/class/tde.mk
 
+ifdef DEB_HOST_MULTIARCH
+  CMAKE_INSTALL_LIBDIR = lib/$(DEB_HOST_MULTIARCH)
+else
+  CMAKE_INSTALL_LIBDIR = lib
+endif
+
 # Build options
 DEB_CMAKE_EXTRA_FLAGS := \
+ -DCMAKE_INSTALL_LIBDIR=$(CMAKE_INSTALL_LIBDIR) \
  -DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \
  -DCMAKE_SKIP_RPATH="OFF" \
  -DCMAKE_VERBOSE_MAKEFILE="ON" \
diff --git a/debian/_base/dependencies/libr/debian/source.lintian-overrides b/debian/_base/dependencies/libr/debian/source.lintian-overrides
deleted file mode 100644
index 71c1b8924..000000000
--- a/debian/_base/dependencies/libr/debian/source.lintian-overrides
+++ /dev/null
@@ -1,9 +0,0 @@
-# We build for many distribution versions and therefore need
-# the distribution version as part of the package version,
-# which is unintentionally understood as NMU.
-libr source: source-nmu-has-incorrect-version-number
-libr source: binary-nmu-debian-revision-in-source
-libr source: no-nmu-in-changelog
-
-# We want XZ regardless of the default compression.
-libr source: custom-compression-in-debian-source-options
diff --git a/debian/_base/dependencies/libr/debian/source/lintian-overrides b/debian/_base/dependencies/libr/debian/source/lintian-overrides
new file mode 100644
index 000000000..71c1b8924
--- /dev/null
+++ b/debian/_base/dependencies/libr/debian/source/lintian-overrides
@@ -0,0 +1,9 @@
+# We build for many distribution versions and therefore need
+# the distribution version as part of the package version,
+# which is unintentionally understood as NMU.
+libr source: source-nmu-has-incorrect-version-number
+libr source: binary-nmu-debian-revision-in-source
+libr source: no-nmu-in-changelog
+
+# We want XZ regardless of the default compression.
+libr source: custom-compression-in-debian-source-options
diff --git a/ubuntu/_base/dependencies/libr/debian/changelog b/ubuntu/_base/dependencies/libr/debian/changelog
index e10d865e5..816d6af73 100644
--- a/ubuntu/_base/dependencies/libr/debian/changelog
+++ b/ubuntu/_base/dependencies/libr/debian/changelog
@@ -1,3 +1,9 @@
+libr (4:14.1.6~pre0-0) trixie; urgency=low
+
+  * Install libraries according to multi-arch rules.
+
+ -- Slávek Banko <slavek.banko@axis.cz>  Mon, 23 Feb 2026 21:18:10 +0100
+
 libr (4:0.6.0-2debian8.0.0+6~d) jessie; urgency=low
 
   * Fix mangling of a critical elf library section on armhf
diff --git a/ubuntu/_base/dependencies/libr/debian/control b/ubuntu/_base/dependencies/libr/debian/control
index 0401c36b4..fb437131a 100644
--- a/ubuntu/_base/dependencies/libr/debian/control
+++ b/ubuntu/_base/dependencies/libr/debian/control
@@ -1,5 +1,5 @@
 Source: libr
-Priority: extra
+Priority: optional
 Maintainer: TDE Debian Team <team-debian@trinitydesktop.org>
 Build-Depends: cdbs, tde-cdbs, debhelper (>= 10~), quilt, tde-cmake, ninja-build, pkgconf, libgtk2.0-dev, binutils-dev, doxygen
 Standards-Version: 3.8.4
@@ -9,6 +9,7 @@ Homepage: http://www.compholio.com/elficon/
 Package: libr1
 Section: libs
 Architecture: any
+Multi-Arch: same
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: ELF binary resource library
  Store and retrieve resources from ELF binaries.
diff --git a/ubuntu/_base/dependencies/libr/debian/dirs b/ubuntu/_base/dependencies/libr/debian/dirs
deleted file mode 100644
index ca882bbb7..000000000
--- a/ubuntu/_base/dependencies/libr/debian/dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/sbin
diff --git a/ubuntu/_base/dependencies/libr/debian/libr-dev.dirs b/ubuntu/_base/dependencies/libr/debian/libr-dev.dirs
index 441fd8fc6..2405d8173 100644
--- a/ubuntu/_base/dependencies/libr/debian/libr-dev.dirs
+++ b/ubuntu/_base/dependencies/libr/debian/libr-dev.dirs
@@ -1,3 +1,2 @@
-usr/lib
-usr/include
 usr/include/libr
+usr/lib
diff --git a/ubuntu/_base/dependencies/libr/debian/libr-dev.install b/ubuntu/_base/dependencies/libr/debian/libr-dev.install
index 6fad4769a..fc8a1b7cb 100644
--- a/ubuntu/_base/dependencies/libr/debian/libr-dev.install
+++ b/ubuntu/_base/dependencies/libr/debian/libr-dev.install
@@ -1,9 +1,6 @@
-usr/include/*
 usr/include/libr/*
-usr/lib/lib*.a
-usr/lib/lib*.so
-usr/lib/*.la
-usr/lib/pkgconfig/*
+usr/lib/$(DEB_HOST_MULTIARCH)/lib*.a
+usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so
+usr/lib/$(DEB_HOST_MULTIARCH)/*.la
+usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/*
 usr/share/man/man3/*.3
-#usr/share/pkgconfig/*
-
diff --git a/ubuntu/_base/dependencies/libr/debian/libr-dev.lintian-overrides b/ubuntu/_base/dependencies/libr/debian/libr-dev.lintian-overrides
new file mode 100644
index 000000000..9f47b462b
--- /dev/null
+++ b/ubuntu/_base/dependencies/libr/debian/libr-dev.lintian-overrides
@@ -0,0 +1,2 @@
+# Man pages are generated automatically.
+libr-dev: bad-whatis-entry
diff --git a/ubuntu/_base/dependencies/libr/debian/libr1.install b/ubuntu/_base/dependencies/libr/debian/libr1.install
index d0dbfd18a..48eab8981 100644
--- a/ubuntu/_base/dependencies/libr/debian/libr1.install
+++ b/ubuntu/_base/dependencies/libr/debian/libr1.install
@@ -1 +1 @@
-usr/lib/lib*.so.*
+usr/lib/$(DEB_HOST_MULTIARCH)/lib*.so.*
diff --git a/ubuntu/_base/dependencies/libr/debian/rules b/ubuntu/_base/dependencies/libr/debian/rules
index 0b16c81e9..95c91da90 100755
--- a/ubuntu/_base/dependencies/libr/debian/rules
+++ b/ubuntu/_base/dependencies/libr/debian/rules
@@ -3,8 +3,15 @@
 include /usr/share/cdbs/1/rules/debhelper.mk
 -include /usr/share/cdbs/1/class/tde.mk
 
+ifdef DEB_HOST_MULTIARCH
+  CMAKE_INSTALL_LIBDIR = lib/$(DEB_HOST_MULTIARCH)
+else
+  CMAKE_INSTALL_LIBDIR = lib
+endif
+
 # Build options
 DEB_CMAKE_EXTRA_FLAGS := \
+ -DCMAKE_INSTALL_LIBDIR=$(CMAKE_INSTALL_LIBDIR) \
  -DCMAKE_EXPORT_COMPILE_COMMANDS="ON" \
  -DCMAKE_SKIP_RPATH="OFF" \
  -DCMAKE_VERBOSE_MAKEFILE="ON" \
diff --git a/ubuntu/_base/dependencies/libr/debian/source.lintian-overrides b/ubuntu/_base/dependencies/libr/debian/source.lintian-overrides
deleted file mode 100644
index 71c1b8924..000000000
--- a/ubuntu/_base/dependencies/libr/debian/source.lintian-overrides
+++ /dev/null
@@ -1,9 +0,0 @@
-# We build for many distribution versions and therefore need
-# the distribution version as part of the package version,
-# which is unintentionally understood as NMU.
-libr source: source-nmu-has-incorrect-version-number
-libr source: binary-nmu-debian-revision-in-source
-libr source: no-nmu-in-changelog
-
-# We want XZ regardless of the default compression.
-libr source: custom-compression-in-debian-source-options
diff --git a/ubuntu/_base/dependencies/libr/debian/source/lintian-overrides b/ubuntu/_base/dependencies/libr/debian/source/lintian-overrides
new file mode 100644
index 000000000..71c1b8924
--- /dev/null
+++ b/ubuntu/_base/dependencies/libr/debian/source/lintian-overrides
@@ -0,0 +1,9 @@
+# We build for many distribution versions and therefore need
+# the distribution version as part of the package version,
+# which is unintentionally understood as NMU.
+libr source: source-nmu-has-incorrect-version-number
+libr source: binary-nmu-debian-revision-in-source
+libr source: no-nmu-in-changelog
+
+# We want XZ regardless of the default compression.
+libr source: custom-compression-in-debian-source-options
-- 
cgit v1.2.3

