[Git][debian-gis-team/hdf5][master] Fix -dev packages' alternatives' priorities

Gilles Filippini gitlab at salsa.debian.org
Mon Mar 16 16:43:30 GMT 2020



Gilles Filippini pushed to branch master at Debian GIS Project / hdf5


Commits:
5216c1ae by Gilles Filippini at 2020-03-16T14:20:37+01:00
Fix -dev packages' alternatives' priorities

- - - - -


6 changed files:

- debian/changelog
- debian/libhdf5-flavor-dev.postinst.in
- + debian/libhdf5-mpi-dev.links.in
- + debian/libhdf5-mpi-dev.postinst.in
- + debian/libhdf5-mpi-dev.prerm.in
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,11 @@
-hdf5 (1.10.6+repack-1~exp4) UNRELEASED; urgency=medium
+hdf5 (1.10.6+repack-1~exp4) experimental; urgency=medium
 
+  * libhdf5-mpi-dev: add hdf5-mpi.pc link to the pkg-config file of the
+    related default MPI implementation
+  * Fix -dev packages' alternatives' priorities (closes: #953020)
   * Bump Standards-Version to 4.5.0, no changes.
 
- -- Gilles Filippini <pini at debian.org>  Sat, 25 Jan 2020 10:37:42 +0100
+ -- Gilles Filippini <pini at debian.org>  Mon, 16 Mar 2020 14:20:23 +0100
 
 hdf5 (1.10.6+repack-1~exp3) experimental; urgency=medium
 


=====================================
debian/libhdf5-flavor-dev.postinst.in
=====================================
@@ -4,13 +4,13 @@ set -e
 
 if [ "@FLAVOR@" != "serial" ]; then
   update-alternatives \
-	--install /usr/bin/h5pcc h5pcc /usr/bin/h5pcc. at FLAVOR@ 50 \
+	--install /usr/bin/h5pcc h5pcc /usr/bin/h5pcc. at FLAVOR@ @UA_PRIORITY_FLAVOR@ \
 	--slave /usr/bin/h5pfc h5pfc /usr/bin/h5pfc. at FLAVOR@ \
 	--slave /usr/share/man/man1/h5pcc.1.gz h5pcc.1.gz /usr/share/man/man1/h5pcc. at FLAVOR@.1.gz \
 	--slave /usr/share/man/man1/h5pfc.1.gz h5pfc.1.gz /usr/share/man/man1/h5pfc. at FLAVOR@.1.gz
 fi
 update-alternatives \
-	--install /usr/lib/@MULTIARCH@/pkgconfig/hdf5.pc hdf5.pc /usr/lib/@MULTIARCH@/pkgconfig/hdf5- at FLAVOR@.pc 50 \
+	--install /usr/lib/@MULTIARCH@/pkgconfig/hdf5.pc hdf5.pc /usr/lib/@MULTIARCH@/pkgconfig/hdf5- at FLAVOR@.pc @UA_PRIORITY_FLAVOR@ \
 
 #DEBHELPER#
 


=====================================
debian/libhdf5-mpi-dev.links.in
=====================================
@@ -0,0 +1 @@
+usr/lib/@MULTIARCH@/pkgconfig/hdf5- at DEFAULT_MPI@.pc usr/lib/@MULTIARCH@/pkgconfig/hdf5-mpi.pc


=====================================
debian/libhdf5-mpi-dev.postinst.in
=====================================
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -e
+
+update-alternatives \
+	--install /usr/lib/@MULTIARCH@/pkgconfig/hdf5.pc hdf5.pc /usr/lib/@MULTIARCH@/pkgconfig/hdf5-mpi.pc @UA_PRIORITY_MPI@ \
+
+#DEBHELPER#
+
+exit 0


=====================================
debian/libhdf5-mpi-dev.prerm.in
=====================================
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" != "upgrade" ]; then
+  update-alternatives \
+	--remove hdf5.pc /usr/lib/@MULTIARCH@/pkgconfig/hdf5-mpi.pc
+fi
+
+#DEBHELPER#
+
+exit 0


=====================================
debian/rules
=====================================
@@ -55,6 +55,17 @@ include /usr/share/mpi-default-dev/debian_defaults
 endif
 DEFAULT_MPI=$(ARCH_DEFAULT_MPI_IMPL)
 
+# update-alternatives priorities
+UA_PRIORITY_serial := 20
+UA_PRIORITY_mpi := 35
+ifeq (openmpi,$(DEFAULT_MPI))
+UA_PRIORITY_openmpi := 30
+UA_PRIORITY_mpich := 10
+else
+UA_PRIORITY_openmpi := 10
+UA_PRIORITY_mpich := 30
+endif
+
 # Arches to build MPI flavors on
 # Setting empty OMPIARCHS and MPICHARCHS environment variables disables
 # the related mpi targets
@@ -159,6 +170,7 @@ DEBIAN_OUT := $(shell \
     !/control/ {print $$0} \
   ' \
 )
+debian_out: $(DEBIAN_OUT);
 # Requested to prevent deletion of $(DEBIAN_OUT) files as intermediate files
 .SECONDARY: $(DEBIAN_OUT)
 
@@ -174,6 +186,7 @@ sonames:
 info: VARIABLES := package pkgversion upstreamversion libversion $(foreach interface,$(INTERFACES),SONAME$(istr))
 info: VARIABLES += FLAVORS DH_OPTIONS DEBIAN_OUT
 info: VARIABLES += $(foreach flavor,serial openmpi mpich,PACKAGES_$(flavor))
+info: VARIABLES += UA_PRIORITY_SERIAL UA_PRIORITY_MPI UA_PRIORITY_OPENMPI UA_PRIORITY_MPICH
 info:
 	@$(foreach var,$(VARIABLES), echo "$(shell printf "%30s" "$(var)") = $($(var))" &&) true
 
@@ -191,7 +204,9 @@ debian/%: debian/%.in
 	    -e "s/@OMPIARCHS@/$(filter-out !%,$(OMPIARCHS))/" \
 	    -e "s/@MPICHARCHS@/$(filter-out !%,$(MPICHARCHS))/" \
 	    -e "s/@NODOCARCHS@/$(NODOCARCHS)/g" \
+	    -e "s/@DEFAULT_MPI@/$(DEFAULT_MPI)/" \
 	    -e "s/@EXT@/$(EXT)/g" \
+	    -e "s/@UA_PRIORITY_MPI@/$(UA_PRIORITY_mpi)/g" \
 	  $< >$@
 
 define helper_soname_rule
@@ -204,12 +219,14 @@ define helper_flavor_rule
 debian/libhdf5$(2)-%: flavor = $(1)
 debian/libhdf5$(2)-%: ifmpi = $(if $(findstring mpi,$(1)),,\#)
 debian/libhdf5$(2)-%: ifserial = $(if $(findstring mpi,$(1)),\#,)
+debian/libhdf5$(2)-%: ua_priority_flavor = $(UA_PRIORITY_$(1))
 debian/libhdf5$(2)-%: debian/libhdf5-flavor-%
 	sed -e 's/@FLAVORLIB@/'_$$(flavor)'/g' \
 	    -e 's/@FLAVORPKG@/'$$(flavorpkg)'/g' \
 	    -e 's/@FLAVOR@/'$$(flavor)'/g' \
 	    -e 's/@IFMPI@/'$$(ifmpi)'/g' \
 	    -e 's/@IFSERIAL@/'$$(ifserial)'/g' \
+	    -e 's/@UA_PRIORITY_FLAVOR@/$$(ua_priority_flavor)/g' \
 	  $$< >$$@
 endef
 $(foreach flavor,$(FLAVORS),$(eval $(call helper_flavor_rule,$(flavor),$(flavorpkg))))



View it on GitLab: https://salsa.debian.org/debian-gis-team/hdf5/-/commit/5216c1ae040916c7bbae2545bced51a577507603

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/hdf5/-/commit/5216c1ae040916c7bbae2545bced51a577507603
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20200316/e9792b0e/attachment-0001.html>


More information about the Pkg-grass-devel mailing list