Regarding the build paths for packagin, i think a the solution was quite simple after some research:
After 954fa3188b3e5e18b0992667b8904a1d17430598, you should have the expected behavior on the packages structure after these commands:
Configure from kamailio root folder ``` # (groups not yet defined, use either `ALL` or `DEFAULT` for now and include or exclude whichever you want # and remove `--fresh` if CMake version less than 3.20 I think):
cmake -S . -B build_folder -DCMAKE_INSTALL_PREFIX=/usr -DINCLUDE_MODULES="" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DVERBOSE=ON -DMODULE_GROUP_NAME=DEFAULT -DBUILD_DOC=OFF --fresh -DEXCLUDE_MODULES="db_oracle dnssec jwt microhttpd nats nsq ruxc secsipid_proc stirshaken tls_wolfssl" -DCMAKE_BUILD_TYPE="Debug" ```
Build kamailio and modules: ``` cmake --build build_folder ```
Install it with DESTDIR env variable so you get the structure ready for packaging: ``` # Replace ./kamailio-destdir with a new folder you want all these to be installed. DESTDIR=./kamailio-destdir cmake --install build_folder ``` This will produced the following folder structure: ``` tree kamailio-destdir -L 3 kamailio-destdir ├── etc │ └── kamailio │ ├── kamailio.cfg │ ├── kamailio.cfg.sample │ ├── kamctlrc │ └── kamctlrc.sample └── usr ├── lib │ └── x86_64-linux-gnu └── sbin ├── kamailio ├── kamctl └── kamdbctl ```