]> git.proxmox.com Git - ovs.git/commitdiff
Generating postinst at build time to avoid using dpkg-architecture at runtime.
authorThomas Goirand <zigo@debian.org>
Wed, 6 Jan 2021 21:15:13 +0000 (22:15 +0100)
committerThomas Goirand <zigo@debian.org>
Wed, 6 Jan 2021 21:15:13 +0000 (22:15 +0100)
debian/changelog
debian/openvswitch-common.postinst [deleted file]
debian/openvswitch-common.postinst.in [new file with mode: 0644]
debian/openvswitch-switch-dpdk.postinst [deleted file]
debian/openvswitch-switch-dpdk.postinst.in [new file with mode: 0644]
debian/rules

index 0474a73e89c17947d72d55b1ef4775694892e166..d2058b7eaa598c7e80729383562c92aad191c08e 100644 (file)
@@ -1,3 +1,10 @@
+openvswitch (2.13.0+dfsg1-16) unstable; urgency=medium
+
+  * Generating postinst at build time to avoid using dpkg-architecture at
+    runtime.
+
+ -- Thomas Goirand <zigo@debian.org>  Wed, 06 Jan 2021 22:13:51 +0100
+
 openvswitch (2.13.0+dfsg1-15) unstable; urgency=medium
 
   * Fix installing OVS alternatives on non-amd64 arch (Closes: #979366).
diff --git a/debian/openvswitch-common.postinst b/debian/openvswitch-common.postinst
deleted file mode 100644 (file)
index ddc9d51..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "${1}" = "configure" ] ; then
-       update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd /usr/lib/openvswitch-common/ovs-vswitchd 100 \
-        --slave /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/libopenvswitch-2.13.so.0.0.0 libopenvswitch.so /usr/lib/openvswitch-common/libopenvswitch-2.13.so.0.0.0
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/openvswitch-common.postinst.in b/debian/openvswitch-common.postinst.in
new file mode 100644 (file)
index 0000000..079fff9
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if [ "${1}" = "configure" ] ; then
+       update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd /usr/lib/openvswitch-common/ovs-vswitchd 100 \
+        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libopenvswitch-2.13.so.0.0.0 libopenvswitch.so /usr/lib/openvswitch-common/libopenvswitch-2.13.so.0.0.0
+fi
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/openvswitch-switch-dpdk.postinst b/debian/openvswitch-switch-dpdk.postinst
deleted file mode 100644 (file)
index aa7cf69..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-set -e
-
-if [ "${1}" = "configure" ] ; then
-       update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk 200 \
-        --slave /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/libopenvswitch-2.13.so.0.0.0 libopenvswitch.so /usr/lib/openvswitch-switch-dpdk/libopenvswitch-2.13.so.0.0.0
-fi
-
-#DEBHELPER#
-
-exit 0
diff --git a/debian/openvswitch-switch-dpdk.postinst.in b/debian/openvswitch-switch-dpdk.postinst.in
new file mode 100644 (file)
index 0000000..b5cd6d0
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if [ "${1}" = "configure" ] ; then
+       update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk 200 \
+        --slave /usr/lib/%%MULTIARCH_TRIPLETT%%/libopenvswitch-2.13.so.0.0.0 libopenvswitch.so /usr/lib/openvswitch-switch-dpdk/libopenvswitch-2.13.so.0.0.0
+fi
+
+#DEBHELPER#
+
+exit 0
index c49018fe93f5f76f18ebae595f0ed29409ab8480..5f6122b0ca75b41ad2995c729c7cd287e3ef6651 100755 (executable)
@@ -173,6 +173,10 @@ endif # i386/amd64/ppc64el/arm64
 endif # nocheck
 
 override_dh_auto_build:
+       set -e ; set -x ; for MYMAINTSCRIPT in openvswitch-common.postinst openvswitch-switch-dpdk.postinst ; do \
+               sed s/%%MULTIARCH_TRIPLETT%%/$$(dpkg-architecture -qDEB_HOST_MULTIARCH)/ debian/$$MYMAINTSCRIPT.in >debian/$$MYMAINTSCRIPT ; \
+       done
+
        $(MAKE) $(PARALLEL) -C _debian dist distdir=openvswitch
        $(MAKE) $(PARALLEL) -C _debian
 ifneq (,$(filter i386 amd64 ppc64el arm64, $(DEB_HOST_ARCH)))
@@ -184,6 +188,7 @@ override_dh_auto_clean:
        dh_auto_clean
        set -e ; make python/ovs/version.py && cd python && python3 setup.py clean ; rm -f ovs/version.py ; cd ..
        rm -rf _debian _dpdk
+       rm -f debian/openvswitch-common.postinst debian/openvswitch-switch-dpdk.postinst
 
 override_dh_auto_install-arch:
        $(MAKE) -C _debian DESTDIR=$(CURDIR)/debian/tmp install