[CONC-271] Cmake RPM layout works only for x86_64 Created: 2017-07-24  Updated: 2019-01-25  Resolved: 2019-01-25

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.2
Fix Version/s: 3.0.9

Type: Bug Priority: Blocker
Reporter: Michal Schorm Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Fedora - all


Attachments: File cmake.patch    

 Description   

Hello,

I am trying to pack the new CONC/C into Fedora, but I hit an issue with "-DINSTALL_LAYOUT=RPM"
It both uses wrong paths for non 64-bit arches and does not recognize other 64-bit arches than x86_64.

Here's the patch I use for my purpose: (attachement)

I'd suggest to recognize if the CPU is 64-bit, rather than architecture name.



 Comments   
Comment by Michal Schorm [ 2018-01-19 ]

Solved by 3.0.3 release, thanks!

Comment by Daniel Black [ 2018-02-10 ]

As I came across solving MDEV-14340, CMAKE_INSTALL_LIBDIR already handles the difference between deb/rpms and 64bit vs 32bit arches and the full solution is rather extensive: https://github.com/Kitware/CMake/blob/master/Modules/GNUInstallDirs.cmake#L178..L257

Suggest something like:

SET(INSTALL_LIBDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/mariadb")

CMAKE_INSTALL_LIBDIR was added in CMake-2.8.5.

edit: small against using CMAKE_INSTALL_LIBDIR - its based on cmake detecting debian and adjusting the paths rather than the presence of DEB or RPM cmake definitions.

Comment by Michal Schorm [ 2019-01-02 ]

Hmm, strange.

Can someone please double check, the 843c492 commit made it to the main branch ? ( I suppose master or 3.1)
I can see the commit in the repository in 3.1 branch, but its effect is not seen in the current HEAD.

I stumbled upon this issue with recently added cmake directive for packageconfig location, which wasn't properly processed on 64-bit arches other than x86_64.

Maybe I overlooked it, beacuse I started to specify libdir and plugindir locations, so the statement was effectively ignored on my side.
I would still worth to apply the commit.

Also the exampke Daniel showed us seems like a great final solution.

Comment by Georg Richter [ 2019-01-25 ]

Yes, you're right - the commit got lost in 2017 by a bad merge from a server branch of MariaDB Connector/C.

Generated at Thu Feb 08 03:04:07 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.