d/rules: Replace dpkg-parsechangelog
authorBoyuan Yang <073plan@gmail.com>
Mon, 5 Mar 2018 08:44:38 +0000 (16:44 +0800)
committerBoyuan Yang <073plan@gmail.com>
Mon, 5 Mar 2018 08:44:38 +0000 (16:44 +0800)
debian/rules

index 29a010a1832f6b7b5790a61682b3d3f3ec9639fa..6b880c28314f7b0ce4dfe0f8bf3abe6d5902d832 100755 (executable)
@@ -8,6 +8,9 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 export QT_SELECT := 5
 
+# Retrieve version info
+include /usr/share/dpkg/pkg-info.mk
+
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
 _QT_COMPAT_VERSION := 5.9.2
@@ -20,9 +23,8 @@ _QTXCBDIR := $(_TMPDIR)/usr/include/$(DEB_HOST_MULTIARCH)/qt5/QtXcb/$(_QT_COMPAT
 ifneq (,$(wildcard .git/config))
        CONFIG_VERSION=
 else
-VERSION = $(shell dpkg-parsechangelog -ldebian/changelog -SVersion)
-_PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}')
-_BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g')
+_PACK_VER = $(shell echo $(DEB_VERSION) | awk -F'[+_~-]' '{print $$1}')
+_BUILD_VER = $(shell echo $(DEB_VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g')
 ifeq ($(_BUILD_VER),)
        CONFIG_VERSION = $(_PACK_VER)
 else
@@ -34,6 +36,7 @@ endif
        dh $@ --with pkgkde_symbolshelper
 
 override_dh_auto_configure:
+       @echo "I: Current dtkcore VERSION is $(CONFIG_VERSION)"
        dh_auto_configure -- LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) VERSION=$(CONFIG_VERSION)
 
 override_dh_makeshlibs: