Bug 418265

Summary: Akonadi misbehaves if installed with -DCONFIG_INSTALL_DIR=/somewhere
Product: [Frameworks and Libraries] Akonadi Reporter: Bernhard Rosenkränzer <bero>
Component: serverAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: OpenMandriva   
OS: Linux   
Latest Commit: Version Fixed In:

Description Bernhard Rosenkränzer 2020-02-27 19:50:38 UTC
SUMMARY
If akonadi is configured with -DCONFIG_INSTALL_DIR=/somewhere, all of its config files (including mysql-global.conf) get installed to /somewhere -- but akonadiserver tries to load some of the files (including mysql-global.conf) with StandardDirs::locateResourceFile -- which isn't aware of -DCONFIG_INSTALL_DIR and looks in the default places.

STEPS TO REPRODUCE
1. On a box without previous akonadi configs, build and install akonadi with e.g. -DCONFIG_INSTALL_DIR=/etc
2. Try to start akonadiserver

OBSERVED RESULT
akonadiserver crashes on startup saying it can't find mysql-global.conf

EXPECTED RESULT
akonadiserver finds mysql-global.conf where it was installed (or alternatively, make install ignores CONFIG_INSTALL_DIR and installs mysql-global.conf where it can be found).

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2023-04-25 17:52:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/akonadi/-/merge_requests/135
Comment 2 Carl Schwan 2023-05-06 07:36:58 UTC
Git commit 0763800aed1b09259d8e42621482ed3b66a34f2d by Carl Schwan.
Committed on 06/05/2023 at 07:33.
Pushed by carlschwan into branch 'master'.

Check for config file in the location of CONFIG_INSTALL_DIR

Since we install the files in CONFIG_INSTALL_DIR

M  +2    -0    src/private/CMakeLists.txt
M  +8    -0    src/private/standarddirs.cpp

https://invent.kde.org/pim/akonadi/commit/0763800aed1b09259d8e42621482ed3b66a34f2d