summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2023-11-25 19:36:01 +0100
committerJörg Frings-Fürst <debian@jff.email>2023-11-25 19:36:01 +0100
commit018747de1a645fa4eb28ae0f820564df42680f58 (patch)
treebe963195102be66db5f740eb6759d5dfb87866e6
parentbf2f388431c0476403f71a630c4fd3864200cf9a (diff)
Merge /bin to /usr/bin
-rw-r--r--debian/changelog12
-rw-r--r--debian/libsane1.dirs2
-rw-r--r--debian/libsane1.install3
-rw-r--r--debian/libsane1.lintian-overrides6
-rw-r--r--debian/libsane1.postinst17
-rw-r--r--debian/libsane1.postrm23
-rw-r--r--debian/libsane1.preinst22
-rw-r--r--debian/patches/0725-fix_link_60-libsane_rule.patch33
-rw-r--r--debian/patches/series1
-rwxr-xr-xdebian/rules30
10 files changed, 97 insertions, 52 deletions
diff --git a/debian/changelog b/debian/changelog
index e6466d2..91af096 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,15 @@
+sane-backends (1.2.1-6) UNRELEASED; urgency=medium
+
+ [ Chris Hofstaedtler ]
+ * libsane1: move udev files to /usr, with protective diversion
+ against m-a: same file loss on upgrades (DEP17 P7 M10). Diversion can be
+ removed in trixie+1. (Closes: #1056725)
+
+ [ Jörg Frings-Fürst ]
+ *
+
+ -- Jörg Frings-Fürst <debian@jff.email> Sat, 25 Nov 2023 16:21:09 +0100
+
sane-backends (1.2.1-5) unstable; urgency=medium
* debian/rules:
diff --git a/debian/libsane1.dirs b/debian/libsane1.dirs
index ad3a3cc..a2b7938 100644
--- a/debian/libsane1.dirs
+++ b/debian/libsane1.dirs
@@ -1 +1 @@
-/lib/udev/hwdb.d/
+/usr/lib/udev/hwdb.d/
diff --git a/debian/libsane1.install b/debian/libsane1.install
index ba37095..bd940fe 100644
--- a/debian/libsane1.install
+++ b/debian/libsane1.install
@@ -1,3 +1,4 @@
usr/lib/*/*.so.*
usr/lib/*/sane/*.so.*
-debian/99-libsane1.rules /lib/udev/rules.d/
+debian/60-libsane1.rules /usr/lib/udev/rules.d/
+debian/99-libsane1.rules /usr/lib/udev/rules.d/
diff --git a/debian/libsane1.lintian-overrides b/debian/libsane1.lintian-overrides
new file mode 100644
index 0000000..5a4a9a0
--- /dev/null
+++ b/debian/libsane1.lintian-overrides
@@ -0,0 +1,6 @@
+# begin-remove-after: released:trixie
+# protective diversion for upgrades of files moved from / to /usr
+libsane1: diversion-for-unknown-file lib/udev/hwdb.d/20-sane.hwdb [preinst:*]
+libsane1: diversion-for-unknown-file lib/udev/rules.d/60-libsane1.rules [preinst:*]
+libsane1: diversion-for-unknown-file lib/udev/rules.d/99-libsane1.rules [preinst:*]
+# end-remove-after
diff --git a/debian/libsane1.postinst b/debian/libsane1.postinst
index 971103e..7c747f6 100644
--- a/debian/libsane1.postinst
+++ b/debian/libsane1.postinst
@@ -1,6 +1,23 @@
#!/bin/sh
set -e
+# begin-remove-after: released:trixie
+# protective diversion of files moved from / to /usr, to avoid file loss.
+# Only for upgrades.
+if [ "$1" = "configure" ]; then
+ # At this point, the package will have installed the same file in */usr*.
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/hwdb.d/20-sane.hwdb.usr-is-merged \
+ --remove /lib/udev/hwdb.d/20-sane.hwdb
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/rules.d/60-libsane1.rules.usr-is-merged \
+ --remove /lib/udev/rules.d/60-libsane1.rules
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/rules.d/99-libsane1.rules.usr-is-merged \
+ --remove /lib/udev/rules.d/99-libsane1.rules
+fi
+# end-remove-after
+
case "$1" in
configure)
# Add the scanner system group if it doesn't exist
diff --git a/debian/libsane1.postrm b/debian/libsane1.postrm
new file mode 100644
index 0000000..6448e00
--- /dev/null
+++ b/debian/libsane1.postrm
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+# begin-remove-after: released:trixie
+# protective diversion of files moved from / to /usr, to avoid file loss.
+# Only for upgrades.
+if [ "$1" = "remove" ] && [ "$DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT" = "1" ]; then
+ # Cleanup in case package is removed before upgrade is finished (postinst ran).
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/hwdb.d/20-sane.hwdb.usr-is-merged \
+ --remove /lib/udev/hwdb.d/20-sane.hwdb
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/rules.d/60-libsane1.rules.usr-is-merged \
+ --remove /lib/udev/rules.d/60-libsane1.rules
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/rules.d/99-libsane1.rules.usr-is-merged \
+ --remove /lib/udev/rules.d/99-libsane1.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
+
diff --git a/debian/libsane1.preinst b/debian/libsane1.preinst
new file mode 100644
index 0000000..4ceccd3
--- /dev/null
+++ b/debian/libsane1.preinst
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+set -e
+
+# begin-remove-after: released:trixie
+# protective diversion of files moved from / to /usr, to avoid file loss.
+# Only for upgrades.
+if [ "$1" = "upgrade" ]; then
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/hwdb.d/20-sane.hwdb.usr-is-merged \
+ --add /lib/udev/hwdb.d/20-sane.hwdb
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/rules.d/60-libsane1.rules.usr-is-merged \
+ --add /lib/udev/rules.d/60-libsane1.rules
+ dpkg-divert --package usr-is-merged --no-rename \
+ --divert /lib/udev/rules.d/99-libsane1.rules.usr-is-merged \
+ --add /lib/udev/rules.d/99-libsane1.rules
+fi
+# end-remove-after
+
+#DEBHELPER#
+
diff --git a/debian/patches/0725-fix_link_60-libsane_rule.patch b/debian/patches/0725-fix_link_60-libsane_rule.patch
deleted file mode 100644
index 0b424e2..0000000
--- a/debian/patches/0725-fix_link_60-libsane_rule.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Description: Fix directory for 20-sane.hwdb
-Author: Jörg Frings-Fürst <debian@jff.email>
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916239
-Forwarded: not-needed
-Last-Update: 2019-04-27
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-Index: trunk/tools/sane-desc.c
-===================================================================
---- trunk.orig/tools/sane-desc.c
-+++ trunk/tools/sane-desc.c
-@@ -3649,7 +3649,7 @@ print_udevhwdb_header (void)
- ("#\n"
- "# udev rules file for supported USB and SCSI devices\n"
- "#\n"
-- "# For the list of supported USB devices see /usr/lib/udev/hwdb.d/20-sane.hwdb\n"
-+ "# For the list of supported USB devices see /lib/udev/hwdb.d/20-sane.hwdb\n"
- "#\n"
- "# The SCSI device support is very basic and includes only\n"
- "# scanners that mark themselves as type \"scanner\" or\n"
-Index: trunk/testsuite/tools/data/udev+hwdb.ref
-===================================================================
---- trunk.orig/testsuite/tools/data/udev+hwdb.ref
-+++ trunk/testsuite/tools/data/udev+hwdb.ref
-@@ -3,7 +3,7 @@
- #
- # udev rules file for supported USB and SCSI devices
- #
--# For the list of supported USB devices see /usr/lib/udev/hwdb.d/20-sane.hwdb
-+# For the list of supported USB devices see /lib/udev/hwdb.d/20-sane.hwdb
- #
- # The SCSI device support is very basic and includes only
- # scanners that mark themselves as type "scanner" or
diff --git a/debian/patches/series b/debian/patches/series
index 81eddad..ac4a4b6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,7 +5,6 @@
0140-avahi.patch
0145-avahi.patch
0705-kfreebsd.patch
-0725-fix_link_60-libsane_rule.patch
0150-i386-test.patch
0155-hurd_PATH_MAX.patch
0050-Use-python3-shebang.patch
diff --git a/debian/rules b/debian/rules
index 03d63c3..d4168f2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,12 +85,26 @@ override_dh_auto_install-indep:
$(RM) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/sane/libsane-dll.*
override_dh_install-arch:
+ifeq (linux,$(DEB_HOST_ARCH_OS))
+ # udev support
+ # Generate the udev rules file
+ $(SANE_DESC) -s $(CURDIR)/doc/descriptions -m udev+hwdb > $(CURDIR)/debian/60-libsane1.rules
+ $(SANE_DESC) -s $(CURDIR)/doc/descriptions -m hwdb > $(CURDIR)/debian/20-sane.hwdb
+
+ cp $(CURDIR)/debian/20-sane.hwdb $(CURDIR)/debian/libsane1/usr/lib/udev/hwdb.d/
+endif
+
dh_install
# Install the pkg-config file
mkdir -p debian/libsane-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/
cp tools/sane-backends.pc debian/libsane-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/
cp debian/sane-utils.logrotate debian/sane-utils/etc/logrotate.d/sane-utils
+ # remove rpath from the binaries (wonderful tool !)
+ chrpath -d debian/sane-utils/usr/sbin/saned
+ chrpath -d debian/sane-utils/usr/bin/scanimage
+ chrpath -d debian/sane-utils/usr/bin/sane-find-scanner
+
override_dh_install-indep:
dh_install
@@ -126,22 +140,6 @@ ifeq (linux,$(DEB_HOST_ARCH_OS))
cp README.linux debian/libsane-common/usr/share/doc/libsane-common/
endif
-override_dh_installudev-arch:
-ifeq (linux,$(DEB_HOST_ARCH_OS))
- # udev support
- # Generate the udev rules file
- $(SANE_DESC) -s $(CURDIR)/doc/descriptions -m udev+hwdb > $(CURDIR)/debian/libsane1.udev
- $(SANE_DESC) -s $(CURDIR)/doc/descriptions -m hwdb > $(CURDIR)/debian/20-sane.hwdb
-
- cp $(CURDIR)/debian/20-sane.hwdb $(CURDIR)/debian/libsane1/lib/udev/hwdb.d/
- dh_installudev
-endif
-
- # remove rpath from the binaries (wonderful tool !)
- chrpath -d debian/sane-utils/usr/sbin/saned
- chrpath -d debian/sane-utils/usr/bin/scanimage
- chrpath -d debian/sane-utils/usr/bin/sane-find-scanner
-
override_dh_installinit-arch:
dh_installinit -psane-utils --name=saned