Skip to content

Commit faecea7

Browse files
committed
Bug#36807184 The Debian and Ubuntu package "libmysqlcppconnx2" might fail to install
Fixed by determining library location at package build time so that there is no need to call dpkg-architecture in the postinst script.
1 parent 993f8f4 commit faecea7

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

packaging/deb-in/CMakeLists.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,23 @@ IF(DEB_CODENAME STREQUAL "sid")
8585
SET (DEB_PLATFORMRELEASE "debianunstable")
8686
ENDIF()
8787

88+
# Determine multiarch library install location
89+
90+
execute_process(
91+
COMMAND dpkg-architecture -q DEB_TARGET_MULTIARCH
92+
OUTPUT_VARIABLE DEB_TARGET_MULTIARCH
93+
OUTPUT_STRIP_TRAILING_WHITESPACE
94+
RESULT_VARIABLE res
95+
)
96+
97+
if(res)
98+
message(FATAL_ERROR "Failed to execute dpkg-architecture")
99+
endif()
100+
101+
set(LIB_DIR "/usr/lib/${DEB_TARGET_MULTIARCH}")
102+
message(STATUS "multiarch lib location: ${LIB_DIR}")
103+
104+
88105
#Follow MYSQLCLIENT_STATIC_LINKING option on packaging
89106
if(DEFINED MYSQLCLIENT_STATIC_LINKING)
90107
set(DEB_CMAKE_EXTRAS

packaging/deb-in/rules.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export DH_VERBOSE=1
3030
export CFLAGS=
3131
export CXXFLAGS=
3232

33-
export LIB_DIR = /usr/lib/$(DEB_HOST_MULTIARCH)
33+
export LIB_DIR = @LIB_DIR@
3434
export PLUGIN_DIR = $(LIB_DIR)/mysql/libmysqlcppconn@JDBC_ABI_VERSION_MAJOR@/plugin
3535

3636
export CMAKE_OPTS= \

packaging/deb-in/xdevapi.postinst.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#! /bin/sh
22
set -e
33

4-
LIBDIR=/usr/lib/`dpkg-architecture -q DEB_TARGET_MULTIARCH`
5-
6-
cd ${LIBDIR}
4+
cd @LIB_DIR@
75

86
# Do nothing if old name is already present
97
test -e libmysqlcppconn8.so.2 && return 0

0 commit comments

Comments
 (0)