[X2Go-Commits] [x2goclient] 16/19: debian/rules: add Qt 4/5 switching, based upon the base system definition.
git-admin at x2go.org
git-admin at x2go.org
Wed May 12 19:28:24 CEST 2021
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2goclient.
commit 149304f87025106987b8f47f79102b5892fa79ab
Author: Mihai Moldovan <ionic at ionic.de>
Date: Sun May 9 18:09:55 2021 +0200
debian/rules: add Qt 4/5 switching, based upon the base system definition.
Mostly adapted from x2gomatebindings.
---
debian/changelog | 2 ++
debian/rules | 50 +++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 51 insertions(+), 1 deletion(-)
diff --git a/debian/changelog b/debian/changelog
index 4ba2325..688d650 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -58,6 +58,8 @@ x2goclient (4.1.2.3-0x2go1) UNRELEASED; urgency=medium
* debian/rules:
+ Preprocess files with an ".in" suffix in the "debian" directory. Mostly
adapted from the firefox package.
+ + Add Qt 4/5 switching, based upon the base system definition. Mostly
+ adapted from x2gomatebindings.
* debian/:
+ New file "watch". We won't need this per se (since we're upstream and
there cannot be a newer version of the Debian package without releasing
diff --git a/debian/rules b/debian/rules
index 65a7662..1705202 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,54 @@ export CFLAGS:=$(shell dpkg-buildflags --get CFLAGS)
export CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
export LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS)
+RELEASE_VER := 0
+RELEASE_VER_MAJOR := 0
+RELEASE_VER_MINOR := 0
+VENDOR_DEBIAN :=
+VENDOR_UBUNTU :=
+
+QT_VERSION := 4
+
+VENDOR_DEBIAN := $(shell { dpkg-vendor --is 'Debian' && echo 'yes'; } || { dpkg-vendor --is 'Raspbian' && echo 'yes'; })
+
+ifeq ($(VENDOR_DEBIAN),yes)
+ RELEASE_VER := $(shell /usr/bin/lsb_release -r | /bin/sed -e 's/[ ]*//g' | /usr/bin/cut -d ':' -f '2' | /usr/bin/cut -d '.' -f '1')
+ # Let's fake testing's and unstable's "release version"...
+ ifeq ($(RELEASE_VER),testing)
+ RELEASE_VER := 999
+ endif
+ ifeq ($(RELEASE_VER),unstable)
+ RELEASE_VER := 9999
+ endif
+else
+ VENDOR_UBUNTU := $(shell dpkg-vendor --is 'Ubuntu' && echo 'yes')
+
+ ifeq ($(VENDOR_UBUNTU),yes)
+ RELEASE_VER_MAJOR := $(shell /usr/bin/lsb_release -r | /bin/sed -e 's/[ ]*//g' | /usr/bin/cut -d ':' -f '2' | /usr/bin/cut -d '.' -f '1')
+ RELEASE_VER_MINOR := $(shell /usr/bin/lsb_release -r | /bin/sed -e 's/[ ]*//g' | /usr/bin/cut -d ':' -f '2' | /usr/bin/cut -d '.' -f '2')
+ endif
+endif
+
+# Actual version switch.
+ifeq ($(VENDOR_DEBIAN),yes)
+ ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER) >= 11 )) && echo '"'"'yes'"'"),yes)
+ QT_VERSION = 5
+ endif
+else
+ ifeq ($(VENDOR_UBUNTU),yes)
+ # Example of how to use major and minor as a selector, we currently won't need
+ # this as the transition happened on a major version.
+ #ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER_MAJOR) == 20 )) && echo '"'"'yes'"'"),yes)
+ #ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER_MINOR) >= 4 )) && echo '"'"'yes'"'"),yes)
+ #QT_VERSION = 5
+ #endif
+ #else
+ ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER_MAJOR) >= 20 )) && echo '"'"'yes'"'"),yes)
+ QT_VERSION = 5
+ endif
+ endif
+endif
+
# The preprocessing magic is highly inspired by the firefox package.
IN_FILES := $(wildcard debian/*.in)
preprocessed_filename = $(1:.in=)
@@ -17,7 +65,7 @@ $(foreach f,$(IN_FILES),$(eval $(call preprocess, $(f))))
$(PREPROCESSED_FILES): VARS = QT_VERSION
$(PREPROCESSED_FILES):
- debian/preprocess.sh $< $(foreach var,$(VARS),-D$(var)="$($(var))" )
+ debian/preprocess.sh $< $(foreach var,$(VARS),'$(var)=$($(var))' )
%:
dh $@ --parallel
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
More information about the x2go-commits
mailing list