Skip to content

Commit c2b1caa

Browse files
committed
Bug #26186911 DEBIAN/UBUNTU "SOURCE" CONTAINS AMD64 BINARIES
Make the debug build part of the standard deb package build. Triggered by adding -DDEB_WITH_DEBUG
1 parent 34d3ae8 commit c2b1caa

File tree

5 files changed

+116
-34
lines changed

5 files changed

+116
-34
lines changed

packaging/deb-in/CMakeLists.txt

+11
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,19 @@ usr/lib/mysql/plugin/authentication_pam.so
5454
usr/lib/mysql/plugin/openssl_udf.so
5555
usr/lib/mysql/plugin/thread_pool.so
5656
usr/lib/mysql/plugin/firewall.so
57+
")
58+
59+
# Add debug versions of commercial plugins, if enabled
60+
if (DEFINED DEB_WITH_DEBUG)
61+
SET (DEB_INSTALL_SERVER_PLUGINS "${DEB_INSTALL_SERVER_PLUGINS}
5762
usr/lib/mysql/plugin/debug/audit_log.so
5863
usr/lib/mysql/plugin/debug/authentication_pam.so
5964
usr/lib/mysql/plugin/debug/openssl_udf.so
6065
usr/lib/mysql/plugin/debug/thread_pool.so
6166
usr/lib/mysql/plugin/debug/firewall.so
6267
")
68+
ENDIF()
69+
6370
SET (DEB_REMOVEPATTERN "gpl.in")
6471
ELSE()
6572
SET (DEB_PRODUCT "community")
@@ -224,6 +231,10 @@ ELSE()
224231
RETURN()
225232
ENDIF()
226233

234+
235+
if (DEFINED DEB_WITH_DEBUG)
236+
INCLUDE(deb_debug.cmake)
237+
ENDIF()
227238
# All files are configured and copied to the debian/ directory, which is used
228239
# by debuild to make the packages
229240
SET (DEB_ROOT ${CMAKE_SOURCE_DIR}/packaging/deb-in)

packaging/deb-in/deb_debug.cmake

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2+
#
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; version 2 of the License.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
# GNU General Public License for more details.
11+
#
12+
# You should have received a copy of the GNU General Public License
13+
# along with this program; if not, write to the Free Software
14+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
16+
SET (DEB_RULES_DEBUG_CMAKE
17+
"
18+
mkdir debug && cd debug && \\
19+
cmake .. \\
20+
-DBUILD_CONFIG=mysql_release \\
21+
-DCMAKE_INSTALL_PREFIX=/usr \\
22+
-DCMAKE_BUILD_TYPE=Debug \\
23+
-DINSTALL_DOCDIR=share/mysql/docs \\
24+
-DINSTALL_DOCREADMEDIR=share/mysql \\
25+
-DINSTALL_INCLUDEDIR=include/mysql \\
26+
-DINSTALL_INFODIR=share/mysql/docs \\
27+
-DINSTALL_LIBDIR=lib/$(DEB_HOST_MULTIARCH) \\
28+
-DINSTALL_MANDIR=share/man \\
29+
-DINSTALL_MYSQLSHAREDIR=share/mysql \\
30+
-DINSTALL_MYSQLTESTDIR=lib/mysql-test \\
31+
-DINSTALL_PLUGINDIR=lib/mysql/plugin \\
32+
-DINSTALL_SBINDIR=sbin \\
33+
-DINSTALL_SUPPORTFILESDIR=share/mysql \\
34+
-DSYSCONFDIR=/etc/mysql \\
35+
-DMYSQL_UNIX_ADDR=/var/run/mysqld/mysqld.sock \\
36+
-DWITH_SSL=bundled \\
37+
-DWITH_INNODB_MEMCACHED=1 \\
38+
-DWITH_MECAB=system \\
39+
-DWITH_NUMA=ON \\
40+
-DCOMPILATION_COMMENT=\"MySQL ${DEB_PRODUCTNAMEC} Server (${DEB_LICENSENAME})\" \\
41+
-DINSTALL_LAYOUT=DEB \\
42+
-DDEB_PRODUCT=${DEB_PRODUCT} \\
43+
${DEB_CMAKE_EXTRAS}
44+
")
45+
46+
SET (DEB_RULES_DEBUG_MAKE
47+
"
48+
cd debug && \\
49+
$(MAKE) -j8 VERBOSE=1
50+
")
51+
52+
SET (DEB_RULES_DEBUG_EXTRA
53+
"
54+
# The ini file isn't built for debug, so copy over from the standard build
55+
install -g root -o root -m 0755 debian/tmp/usr/lib/mysql/plugin/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
56+
")
57+
58+
SET (DEB_INSTALL_DEBUG_SERVER
59+
"
60+
# debug binary
61+
usr/sbin/mysqld-debug
62+
")
63+
64+
SET (DEB_INSTALL_DEBUG_SERVER_PLUGINS
65+
"
66+
# debug plugins
67+
usr/lib/mysql/plugin/debug/adt_null.so
68+
usr/lib/mysql/plugin/debug/auth_socket.so
69+
usr/lib/mysql/plugin/debug/connection_control.so
70+
usr/lib/mysql/plugin/debug/innodb_engine.so
71+
usr/lib/mysql/plugin/debug/libmemcached.so
72+
usr/lib/mysql/plugin/debug/mypluglib.so
73+
usr/lib/mysql/plugin/debug/mysql_no_login.so
74+
usr/lib/mysql/plugin/debug/semisync_master.so
75+
usr/lib/mysql/plugin/debug/semisync_slave.so
76+
usr/lib/mysql/plugin/debug/validate_password.so
77+
")
78+
79+
SET (DEB_INSTALL_DEBUG_TEST_PLUGINS
80+
"
81+
# debug plugins
82+
usr/lib/mysql/plugin/debug/auth.so
83+
usr/lib/mysql/plugin/debug/auth_test_plugin.so
84+
usr/lib/mysql/plugin/debug/daemon_example.ini
85+
usr/lib/mysql/plugin/debug/libdaemon_example.so
86+
usr/lib/mysql/plugin/debug/qa_auth_client.so
87+
usr/lib/mysql/plugin/debug/qa_auth_interface.so
88+
usr/lib/mysql/plugin/debug/qa_auth_server.so
89+
usr/lib/mysql/plugin/debug/test_udf_services.so
90+
")

packaging/deb-in/mysql-packagesource-server.install.in

+2-12
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ usr/bin/replace
3636
usr/bin/resolveip
3737
usr/bin/resolve_stack_dump
3838
usr/sbin/mysqld
39-
# debug binary
40-
usr/sbin/mysqld-debug
4139
# man pages
4240
usr/share/man/man1/innochecksum.1
4341
usr/share/man/man1/msql2mysql.1
@@ -63,6 +61,7 @@ usr/share/man/man1/replace.1
6361
usr/share/man/man1/resolveip.1
6462
usr/share/man/man1/resolve_stack_dump.1
6563
usr/share/man/man8/mysqld.8
64+
@DEB_INSTALL_DEBUG_SERVER@
6665
# confguration files
6766
usr/share/mysql/my-default.cnf
6867
debian/extra/mysql.cnf etc/mysql/
@@ -82,16 +81,7 @@ usr/lib/mysql/plugin/mysql_no_login.so
8281
usr/lib/mysql/plugin/semisync_master.so
8382
usr/lib/mysql/plugin/semisync_slave.so
8483
usr/lib/mysql/plugin/validate_password.so
85-
usr/lib/mysql/plugin/debug/adt_null.so
86-
usr/lib/mysql/plugin/debug/auth_socket.so
87-
usr/lib/mysql/plugin/debug/connection_control.so
88-
usr/lib/mysql/plugin/debug/innodb_engine.so
89-
usr/lib/mysql/plugin/debug/libmemcached.so
90-
usr/lib/mysql/plugin/debug/mypluglib.so
91-
usr/lib/mysql/plugin/debug/mysql_no_login.so
92-
usr/lib/mysql/plugin/debug/semisync_master.so
93-
usr/lib/mysql/plugin/debug/semisync_slave.so
94-
usr/lib/mysql/plugin/debug/validate_password.so
84+
@DEB_INSTALL_DEBUG_SERVER_PLUGINS@
9585
@DEB_INSTALL_SERVER_PLUGINS@
9686
# support files
9787
usr/share/mysql/dictionary.txt

packaging/deb-in/mysql-packagesource-test.install.in

+2-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
1+
# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License as published by
@@ -33,14 +33,7 @@ usr/lib/mysql/plugin/qa_auth_client.so
3333
usr/lib/mysql/plugin/qa_auth_interface.so
3434
usr/lib/mysql/plugin/qa_auth_server.so
3535
usr/lib/mysql/plugin/test_udf_services.so
36-
usr/lib/mysql/plugin/debug/auth.so
37-
usr/lib/mysql/plugin/debug/auth_test_plugin.so
38-
usr/lib/mysql/plugin/debug/daemon_example.ini
39-
usr/lib/mysql/plugin/debug/libdaemon_example.so
40-
usr/lib/mysql/plugin/debug/qa_auth_client.so
41-
usr/lib/mysql/plugin/debug/qa_auth_interface.so
42-
usr/lib/mysql/plugin/debug/qa_auth_server.so
43-
usr/lib/mysql/plugin/debug/test_udf_services.so
36+
@DEB_INSTALL_DEBUG_TEST_PLUGINS@
4437
# test suite
4538
usr/lib/mysql-test/*
4639
# legal

packaging/deb-in/rules.in

+11-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ export CXXFLAGS=
2424

2525
override_dh_auto_configure:
2626
@echo "RULES.$@"
27-
cmake . \
27+
28+
@DEB_RULES_DEBUG_CMAKE@
29+
30+
mkdir release && cd release && \
31+
cmake .. \
2832
-DBUILD_CONFIG=mysql_release \
2933
-DCMAKE_INSTALL_PREFIX=/usr \
3034
-DINSTALL_DOCDIR=share/mysql/docs \
@@ -49,10 +53,13 @@ override_dh_auto_configure:
4953
-DINSTALL_LAYOUT=DEB \
5054
-DDEB_PRODUCT=@DEB_PRODUCT@ \
5155
@DEB_CMAKE_EXTRAS@
56+
5257
touch $@
5358

5459
override_dh_auto_build:
5560
@echo "RULES.$@"
61+
@DEB_RULES_DEBUG_MAKE@
62+
cd release && \
5663
$(MAKE) -j8 VERBOSE=1
5764
touch $@
5865

@@ -64,22 +71,13 @@ override_dh_auto_install:
6471

6572
@echo "RULES.$@"
6673
# complete install first
67-
$(MAKE) install DESTDIR=debian/tmp
74+
cd release && \
75+
$(MAKE) install DESTDIR=../debian/tmp
76+
@DEB_RULES_DEBUG_EXTRA@
6877
# remove all redundant files
6978
rm debian/tmp/usr/lib/*/*_r*
70-
rm debian/tmp/usr/lib/mysql-test/cmake_install.cmake
71-
rm debian/tmp/usr/lib/mysql-test/CTestTestfile.cmake
72-
rm debian/tmp/usr/lib/mysql-test/Makefile
7379
# add missing man pages
7480
install -g root -o root -m 0644 debian/extra/mysql_embedded.1 debian/tmp/usr/share/man/man1
75-
# add MySQL Server debug binary and library to package
76-
install -g root -o root -m 0755 debian/extra/server-binary debian/tmp/usr/sbin/mysqld-debug
77-
install -g root -o root -m 0755 debian/extra/embedded-server debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmysqld-debug.a
78-
# add debug plugin libraries to package
79-
install -g root -o root -m 0755 -d debian/tmp/usr/lib/mysql/plugin/debug
80-
for file in debian/extra/*-plugin; do NEW=`echo $$file | cut -d- -f1`; mv $$file $$NEW.so; done
81-
install -g root -o root -m 0755 debian/extra/*.so debian/tmp/usr/lib/mysql/plugin/debug
82-
install -g root -o root -m 0755 debian/extra/daemon_example.ini debian/tmp/usr/lib/mysql/plugin/debug
8381
# Add helper functions for maintainer scripts
8482
install -m 0644 debian/extra/mysql-helpers debian/tmp/usr/share/mysql/
8583
# add apparmor profile

0 commit comments

Comments
 (0)