Hello.

Just in case it helps while you are updating several packages, a more intrusive suggestion is attached, mostly replacing the shell loop with a Make loop. Compared to the current debian/rules in (for example) kitinerary,

+ everything is visible in the log, especially the value of the substitution variable

+ the build stops on first error (errors in shell lines before the last semi-colon do not interrupt Make)

+ running override_dh_makeshlibs twice in a row will not add the substitution variable again and again. This may be convenient when trying again an interrupted build for example.

+ debian/rules -n override_dh_makeshlibs allows one to check that all versions are correctly computed

+? \s* is removed from the regex removing abi[0-9]\+ (it seems unnecessary, but you may want to restore it if I am issing something)

I hope that you will be able to reuse some of these ideas.
diff --git a/debian/rules b/debian/rules
index c3d01ea..2a3fcd5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,18 +4,23 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 include /usr/share/dpkg/pkg-info.mk
 
-AbiVirtualPackageVersion = $(call dpkg_late_eval,AbiVirtualPackageVersion,echo '${DEB_VERSION_UPSTREAM}' | sed -e 's/\.[0-9]\+$$//')
-pkgs_lib = $(filter-out %-dev %-dbg %-bin %-data,$(filter lib%,$(shell dh_listpackages)))
+# Starting with a library package $*, remove the ABI and append a
+# -MAJOR.MINOR suffix without the third component of the upstream version.
+ABIVirtualPackage = $(shell echo $* | sed 's/abi[0-9]\+//')-$(basename $(DEB_VERSION_UPSTREAM))
+pkgs_lib := $(filter-out %-dev %-dbg %-bin %-data,$(filter lib%,$(shell dh_listpackages)))
 
 %:
 	dh $@
 
-override_dh_makeshlibs:
-	for pkg in $(pkgs_lib); do \
-		name=$$( echo "$${pkg}" | sed -e 's/abi[0-9]\+\s*//'); \
-		echo "ABI:VirtualPackage=$${name}-${AbiVirtualPackageVersion}" >> debian/$${pkg}.substvars; \
-		dh_makeshlibs -p$${pkg} -V "$${pkg} (>= $(DEB_VERSION_EPOCH_UPSTREAM)), $${name}-${AbiVirtualPackageVersion}"; \
-	done
+override_dh_makeshlibs: $(pkgs_lib:=-makeshlibs)
+	dh_makeshlibs --remaining-packages
+$(pkgs_lib:=-makeshlibs): %-makeshlibs:
+	dh_makeshlibs -p$* '-V$* (>= $(DEB_VERSION_EPOCH_UPSTREAM)), $(ABIVirtualPackage)'
+
+override_dh_gencontrol: $(pkgs_lib:=-gencontrol)
+	dh_gencontrol --remaining-packages
+$(pkgs_lib:=-gencontrol): %-gencontrol:
+	dh_gencontrol -p$* -- -VABI:VirtualPackage=$(ABIVirtualPackage)
 
 override_dh_auto_test:
 	xvfb-run --\
-- 
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-kde-talk

Reply via email to