modernise and fix packaging (escapes, etc.)
authormirabilos <tg@debian.org>
Sun, 29 Sep 2019 17:50:47 +0000 (19:50 +0200)
committermirabilos <mirabilos@evolvis.org>
Sun, 29 Sep 2019 17:50:47 +0000 (19:50 +0200)
debian/changelog
debian/rules

index ab270c8..e0452d4 100644 (file)
@@ -1,11 +1,13 @@
-musescore2 (2.3.2+dfsg3-6) UNRELEASED; urgency=medium
+musescore2 (2.3.2+dfsg3-6) wtf; urgency=low
 
   * d/copyright: Update MuseJazz information from historic records
   * d/copyright: Write year numbers consistently (four digits, comma)
   * Set umask 022 for reproducibility
+  * Improve/fix packaging, from MagicPoint
   * Run the tests in an UTF-8 locale
+  * Pass -g3 in addition to -Og for “optdbg” builds
 
- -- Thorsten Glaser <tg@mirbsd.de>  Sun, 29 Sep 2019 19:35:18 +0200
+ -- Thorsten Glaser <tg@mirbsd.de>  Sun, 29 Sep 2019 19:49:48 +0200
 
 musescore2 (2.3.2+dfsg3-5) wtf; urgency=low
 
index 548d620..c9bcab4 100755 (executable)
@@ -1,8 +1,9 @@
 #!/usr/bin/make -f
 
+CWD:=$(abspath .)
 SHELL:=$(abspath debian/rwrap)
 
-ifeq (,$(findstring terse,${DEB_BUILD_OPTIONS}))
+ifeq (,$(filter terse,${DEB_BUILD_OPTIONS}))
 export DH_VERBOSE=1
 export V=1
 export VERBOSE=1
@@ -11,6 +12,9 @@ endif
 LC_ALL:=C.UTF-8
 export LC_ALL
 
+shellescape='$(subst ','\'',$(1))'
+shellexport=$(1)=$(call shellescape,${$(1)})
+
 MSPPKG=musescore
 MSCPKG=${MSPPKG}-common
 MSPDIR=debian/${MSPPKG}
@@ -34,18 +38,22 @@ OUR_CPPFLAGS+=      -DMSCORE_NO_UPDATE_CHECKER
 
 # better debugging if requested
 ifneq (,$(findstring optdbg,${DEB_BUILD_OPTIONS}))
-OUR_CFLAGS+=   -Og
-OUR_CXXFLAGS+= -Og
+OUR_CFLAGS+=   -Og -g3
+OUR_CXXFLAGS+= -Og -g3
 endif
 
 # things that cannot be passed via CPPFLAGS
-OUR_CPPFLAGS+= -I$(shell pwd)/debian/q-include
-
-export DEB_BUILD_MAINT_OPTIONS := hardening=+all
-export DEB_CPPFLAGS_MAINT_APPEND := ${OUR_CPPFLAGS}
-export DEB_CFLAGS_MAINT_APPEND := ${OUR_CFLAGS}
-export DEB_CXXFLAGS_MAINT_APPEND := ${OUR_CXXFLAGS}
-export DEB_LDFLAGS_MAINT_APPEND := ${OUR_LDFLAGS}
+OUR_CPPFLAGS+= -I$(call shellescape,${CWD}/debian/q-include)
+
+dpkgbuildflagsmkescape=$(subst \,\\\,$(1))
+export DEB_BUILD_MAINT_OPTIONS:=hardening=+all
+export DEB_CPPFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CPPFLAGS})
+export DEB_CFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CFLAGS})
+export DEB_CXXFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_CXXFLAGS})
+export DEB_LDFLAGS_MAINT_APPEND:=$(call dpkgbuildflagsmkescape,${OUR_LDFLAGS})
+include /usr/share/dpkg/buildflags.mk
+include /usr/share/dpkg/buildtools.mk
+include /usr/share/dpkg/pkg-info.mk
 
 %:
        dh $@ --buildsystem=cmake
@@ -64,10 +72,10 @@ override_dh_auto_configure:
        rm -rf debian/q-include
        mkdir debian/q-include
        printf '#define DEB_PKG_VERSION "%s (%s %s/%s)"\n' \
-           "$$(dpkg\-parsechangelog | sed -n '/^Version: */{s///p;q;}')" \
+           $(call shellescape,${DEB_VERSION}) \
            "$$(lsb_release -si)" \
            "$$(lsb_release -sc)" \
-           "${DEB_HOST_ARCH}" \
+           $(call shellescape,${DEB_HOST_ARCH}) \
            >debian/q-include/DEB_PKG_VERSION.h
        exec dh_auto_configure -- ${CMAKE_DEFS}