]> review.fuel-infra Code Review - packages/trusty/mysql-wsrep-5.6.git/commitdiff
Add mysql-server-wsrep-core-5.6-dbg package 26/27126/2
authorIvan Suzdal <isuzdal@mirantis.com>
Mon, 3 Oct 2016 15:01:52 +0000 (18:01 +0300)
committerIvan Suzdal <isuzdal@mirantis.com>
Tue, 4 Oct 2016 08:12:37 +0000 (08:12 +0000)
Change-Id: I0f44fb6b33dfa95d251e4bbb0e3f429349f25aab
Closes-Bug: #1628104

debian/changelog
debian/control
debian/rules

index 879dfd214f5a0735d7968a02415307a61f295551..716e97390381900327bd1ef7c02002f8dccff065 100644 (file)
@@ -1,3 +1,9 @@
+mysql-wsrep-5.6 (5.6.33-0~u14.04+mos2) mos; urgency=low
+
+  * Add mysql-server-wsrep-core-5.6-dbg package (Closes: #LP1628104)
+
+ -- Ivan Suzdal <mos-linux@mirantis.com>  Mon, 03 Oct 2016 14:57:30 +0000
+
 mysql-wsrep-5.6 (5.6.33-0~u14.04+mos1) mos; urgency=low
 
   * Rebuilt for MOS
index 9272a803127d78f85d840c7844062e14568f853a..90261bed96f79126e90a0dba65cefe49a0e79055 100644 (file)
@@ -150,3 +150,8 @@ Description: MySQL source
  This package includes the MySQL source code as configured before building
  - but after the arch specific configuration. This is currently required for
  building plugins.
+
+Package: mysql-server-wsrep-core-5.6-dbg
+Architecture: any
+Depends: mysql-server-wsrep-core-5.6 (= ${binary:Version}), ${misc:Depends}
+Description: debugging symbols for mysql-server-wsrep-core-5.6
index 9b64bc2303ae9eaaf0f94fefd9525c0e08ec3630..f00d93fa224f7d4054244e9768ebc3e0d91e7633 100755 (executable)
@@ -29,6 +29,7 @@ TESTSUITE_FAIL_CMD:=true
 TMP := $(CURDIR)/debian/tmp/
 USE_ASSEMBLER:=--enable-assembler
 
+DBG_PACKAGES := $(shell awk '/^Package:([[:space:]]+)([^[:space:]]+)-dbg([[:space:]]*)$$/ { gsub(/-dbg$$/, "", $$2); print $$2 }' debian/control)
 
 export MYSQL_BUILD_CC=$(DEB_HOST_GNU_TYPE)-gcc
 export MYSQL_BUILD_CXX=$(DEB_HOST_GNU_TYPE)-g++
@@ -58,6 +59,20 @@ ifeq ($(STATIC_MYSQLD), 1)
     USE_STATIC_MYSQLD:=--with-mysqld-ldflags=-all-static
 endif
 
+# Default CMAKE_BUILD_TYPE is RelwithDebInfo, but this type
+# doesn't provide enough debugging symbols (actually, this type
+# is quite similar to Release mode).
+# So, let's build with debug symbols and put them into separate package.
+CMAKE_BUILD_TYPE ?= Debug
+
+# Otherwise, it can cause exception during build, like
+# "error: ignoring return value of 'size_t fread(void*, size_t, size_t, FILE*)',
+# declared with attribute warn_unused_result [-Werror=unused-result]"
+# I've seen this error only then build with debug.
+ifeq ($(CMAKE_BUILD_TYPE), Debug)
+    UNUSED_RESULT_FLAGS:=-Wno-unused-result
+endif
+
 override_dh_auto_clean:
        @echo "RULES.$@"
        dh_testdir
@@ -83,12 +98,12 @@ configure-stamp configure-pic-stamp:
                CC=$${MYSQL_BUILD_CC:-gcc} \
                CFLAGS=$${MYSQL_BUILD_CFLAGS:-"-O2 -DBIG_JOINS=1 ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing ${TAOCRYPT_OPT}"} \
                CXX=$${MYSQL_BUILD_CXX:-g++} \
-               CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fpermissive ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing ${TAOCRYPT_OPT}"} \
+               CXXFLAGS=$${MYSQL_BUILD_CXXFLAGS:-"-O3 -DBIG_JOINS=1 -felide-constructors -fpermissive ${FORCE_FPIC_CFLAGS} -fno-strict-aliasing ${TAOCRYPT_OPT} ${UNUSED_RESULT_FLAGS}"} \
                cmake -DCMAKE_INSTALL_PREFIX=/usr \
                -DCMAKE_VERBOSE_MAKEFILE=ON \
                $(FORCE_FPIC) \
                -DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \
-               -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+               -DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
                -DWITH_WSREP=1 \
                -DWITH_LIBWRAP=ON \
                -DWITH_ZLIB=system \
@@ -219,8 +234,16 @@ override_dh_installinit-arch:
 override_dh_installcron-arch:
        dh_installcron --name mysql-server
 
+ifeq ($(CMAKE_BUILD_TYPE), Debug)
+override_dh_strip:
+       for pkg in $(DBG_PACKAGES); do \
+               dh_strip -p$$pkg --dbg-package=$$pkg-dbg; \
+       done
+       dh_strip
+else
 override_dh_strip:
        @echo "Notice: not stripping debug symbols from any binaries"
+endif
 
 binary:        binary-indep binary-arch