[X2Go-Commits] [x2goplasmabindings] 01/02: debian/rules: add Plasma 4/5 bridge based on distro version and pass down to build system.
git-admin at x2go.org
git-admin at x2go.org
Wed May 3 20:32:00 CEST 2023
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository x2goplasmabindings.
commit f329349171601f37301a51093dee5ce806e8c32f
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed May 3 20:28:56 2023 +0200
debian/rules: add Plasma 4/5 bridge based on distro version and pass down to build system.
---
debian/changelog | 3 ++
debian/rules | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 68b91e0..da4f45b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -27,6 +27,9 @@ x2goplasmabindings (3.0.2.3-0x2go1) UNRELEASED; urgency=medium
+ Adapt description to also mention KDE 5.
+ Build-Depend on libkf5plasma-dev and libkf5i18n-dev, with a fallback to
kdelibs5-dev, which doesn't exist any longer past-buster.
+ * debian/rules:
+ + Add Plasma 4/5 bridge based on distro version and pass down to build
+ system.
-- X2Go Release Manager <git-admin at x2go.org> Thu, 22 Nov 2018 00:21:33 +0100
diff --git a/debian/rules b/debian/rules
index 0d3f272..788d661 100755
--- a/debian/rules
+++ b/debian/rules
@@ -14,5 +14,95 @@ 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 :=
+
+USE_PLASMA5 := OFF
+
+# Setting these disables autodetection.
+FORCE_VENDOR ?=
+FORCE_RELEASE_VER ?=
+
+ifneq ($(FORCE_VENDOR),)
+ ifneq ($(FORCE_RELEASE_VER),)
+ VENDOR_DEBIAN := $(shell if [ 'debian' = '$(FORCE_VENDOR)' ] || [ '$(FORCE_VENDOR)' = 'raspbian' ]; then echo 'yes'; fi)
+ VENDOR_UBUNTU := $(shell if [ 'ubuntu' = '$(FORCE_VENDOR)' ]; then echo 'yes'; fi)
+ RELEASE_VER := $(FORCE_RELEASE_VER)
+
+ ifeq ($(VENDOR_UBUNTU),yes)
+ RELEASE_VER_MAJOR := $(shell printf '%s\n' '$(RELEASE_VER)' | /usr/bin/cut -d '.' -f '1')
+ RELEASE_VER_MINOR := $(shell printf '%s\n' '$(RELEASE_VER)' | /usr/bin/cut -d '.' -f '2')
+ endif
+ else
+ $(error FORCE_VENDOR passed, but FORCE_RELEASEVER empty.)
+ endif
+else
+ 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')
+
+ # Newer Debian versions might report "n/a" for testing and unstable.
+ ifeq ($(RELEASE_VER),n/a)
+ # On these platforms, the best way to determine the system version is by
+ # going through "apt-cache policy".
+ # Note that this should only be the case for either testing or unstable.
+ # Other systems should have a proper version number.
+ # This is also why we can just drop any suites/archive names (this is
+ # what a= means) containing a dash character (e.g., "stable-updates")
+ # and only pick the first match.
+ RELEASE_VER := $(shell /usr/bin/apt-cache policy | grep -E 'o=(De|Rasp)bian,' | grep -E 'l=(De|Rasp)bian,' | grep -F 'c=main,' | grep -Eo 'a=[^, ]*' | sed -e 's/^a=//' | grep -v -- '-' | head -n '1')
+
+ # Do error checking.
+ ifneq ($(RELEASE_VER),testing)
+ ifneq ($(RELEASE_VER),unstable)
+ $(error Release version could not be determined, sorry. Extracted value: $(RELEASE_VER))
+ endif
+ endif
+ endif
+
+ # 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
+endif
+
+# Actual version switch.
+ifeq ($(VENDOR_DEBIAN),yes)
+ ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER) >= 10 )) && echo '"'"'yes'"'"),yes)
+ USE_PLASMA5 = ON
+ 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)
+ # USE_PLASMA5 = ON
+ # endif
+ #else
+ ifeq ($(shell /bin/bash -c '(( $(RELEASE_VER_MAJOR) >= 20 )) && echo '"'"'yes'"'"),yes)
+ USE_PLASMA5 = ON
+ endif
+ endif
+endif
+
%:
dh $@
+
+override_dh_auto_configure:
+ dh_auto_configure $@ -DUSE_PLASMA5=$(USE_PLASMA5)
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/x2goplasmabindings.git
More information about the x2go-commits
mailing list