Opening this generic issue to track issues when trying to switch deb package generation to cmake:
complains if not git is installed ``` -- USE_FAST_LOCK = YES CMake Error at /usr/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message): Could NOT find Git (missing: GIT_EXECUTABLE) Call Stack (most recent call first): /usr/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE) /usr/share/cmake-3.31/Modules/FindGit.cmake:128 (find_package_handle_standard_args) src/CMakeLists.txt:31 (find_package)
-- Configuring incomplete, errors occurred! cd obj-x86_64-linux-gnu && tail -v -n +0 CMakeCache.txt ```
Yeah i can make `git` optional since i think it's only used for assigning versions when build from sources. I 'll push a fix soon.
After the library fix from #4059 was merged it probably make sense to re-test it.
@xkaraman previously I had to use ``` # CFLAGS + CPPFLAGS -> CC_EXTRA_OPTS CC_EXTRA_OPTS := $(shell dpkg-buildflags --get CPPFLAGS) CC_EXTRA_OPTS += $(shell dpkg-buildflags --get CFLAGS) CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) # LDFLAGS -> LD_EXTRA_OPTS LD_EXTRA_OPTS := $(shell dpkg-buildflags --get LDFLAGS)
# https://wiki.debian.org/ReproducibleBuilds/ CC_EXTRA_OPTS += -DVERSION_NODATE ```
To be able to modify build and link flags... what should I use now?
Generally when you want to pass extra definitions into `cmake`, you do it by passing them with `-DNAME=values`. This overwrites any previous value it may had, so make sure to include whatever is needed. ie
`cmake .. -DCC_EXTRA_OPTS= -DVERSION_NODATE`.
But then it should be used somehow from the `CMakeLists.txt` unless it's some standard variable.
See https://cmake.org/cmake/help/latest/envvar/CFLAGS.html#envvar:CFLAGS. Env variables can also be used to modify these flags.
and what about ``cfg_target`` ?
previously I was doing: ``` $(MAKE) FLAVOUR=kamailio cfg prefix=/usr cfg_prefix=$(D) \ cfg_target=/etc/kamailio/ \ BASEDIR=$(D) \ skip_modules="$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)" \ CC_EXTRA_OPTS="$(CC_EXTRA_OPTS)" \ LD_EXTRA_OPTS="$(LD_EXTRA_OPTS)" \ group_include="kstandard" quiet=verbose ```
right now using: ``` override_dh_auto_configure: dh_auto_configure -- \ -DCC_EXTRA_OPTS='"$(CC_EXTRA_OPTS)"' \ -DLD_EXTRA_OPTS='"$(LD_EXTRA_OPTS)"' \ -DINCLUDE_MODULES='"$(PACKAGE_GROUPS) $(EXTRA_GROUPS)"' \ -DEXCLUDE_MODULES='"$(EXCLUDED_MODULES) $(EXTRA_EXCLUDED_MODULES)"' ``` That's producing: ``` cd obj-x86_64-linux-gnu && DEB_PYTHON_INSTALL_LAYOUT=deb PKG_CONFIG=/usr/bin/pkg-config cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu "-DCC_EXTRA_OPTS="-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -DVERSION_NODATE"" "-DLD_EXTRA_OPTS="-Wl,-z,relro -Wl,-z,now"" "-DINCLUDE_MODULES="mysql postgres berkeley unixodbc radius presence ldap xml perl utils lua memcached snmpstats carrierroute xmpp cpl redis geoip2 sqlite json ruby ims sctp tls outbound websocket autheph kazoo cnxcc erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid lwsc nats tls_wolfssl microhttpd kafka ev gzcompress jansson uuid http_async"" "-DEXCLUDE_MODULES="mono geoip bdb dbtext oracle pa iptrtpproxy dnssec java python"" .. ```
Full build log: [kamailio_6.0.0~dev3_amd64.build.txt](https://github.com/user-attachments/files/18078651/kamailio_6.0.0.dev3_amd64...)
I'm getting: ``CFG_DIR="/usr//etc/kamailio/"`` ``` -- Compile definitions for common: FAST_LOCK;ADAPTIVE_WAIT;ADAPTIVE_WAIT_LOOPS=1024;USE_TCP;USE_TLS;TLS_HOOKS;USE_NAPTR;USE_DNS_CACHE;F_MALLOC;Q_MALLOC;TLSF_MALLOC;MALLOC_STATS;DBG_SR_MEMORY;USE_DNS_FAILOVER;USE_DST_BLOCKLIST;HAVE_RESOLV_RES;USE_MCAST;DISABLE_NAGLE;DNS_IP_HACK;SHM_MMAP;PKG_MALLOC;RAW_SOCKS;KSR_PTHREAD_MUTEX_SHARED;FMSTATS;KMSTATS;CC_GCC_LIKE_ASM;HAVE_GETHOSTBYNAME2;HAVE_UNION_SEMUN;HAVE_SCHED_YIELD;HAVE_MSG_NOSIGNAL;HAVE_MSGHDR_MSG_CONTROL;HAVE_ALLOCA_H;HAVE_TIMEGM;HAVE_SCHED_SETSCHEDULER;HAVE_IP_MREQN;USE_RAW_SOCKS;HAVE_SELECT;HAVE_EPOLL;HAVE_SIGIO_RT;SIGINFO64_WORKAROUND;USE_FUTEX;NAME="kamailio";VERSION="6.0.0-dev2";ARCH="x86_64";OS=Linux;OS_QUOTED="Linux";COMPILER="14.2.0";__CPU_x86_64;__OS_linux;VERSIONVAL=6000000;CFG_DIR="/usr//etc/kamailio/";SHARE_DIR="/usr/share/kamailio/";RUN_DIR="//var/run/kamailio";USE_FUTEX;PIC;$<$BOOL:ON:USE_SCTP>;$<$BOOL:ON:STATISTICS> ```
`cfg_prefix` is probably the `cmake_install_prefix`? : The base folder where you want it installed?
`cfg_target` what is its purpose?
My guess is it's a path that is already provided by https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html? and we want it to be configurable?
Well, is where we install the configs. In my case: ``/etc/kamailio``
here is where is it set https://github.com/kamailio/kamailio/blob/b6f25031590e472f0f63b3e2a4fa61dad9...
And here is where is defined previously https://github.com/kamailio/kamailio/blob/b6f25031590e472f0f63b3e2a4fa61dad9...
Notice that I don't want to change ``CMAKE_INSTALL_SYSCONFDIR`` that is fine pointing to ``etc`` I want to be able to define where the configs should be installed and ``/usr/etc/kamailio`` is not it.
So please allow me to define ``CFG_DIR`` somehow and use that value if is defined
If you scroll down to [Special Cases](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html), you can see that it describes what you want. I may have an error on how it's evaluating the path, I'll look into that.
I see that the command you used produced this: `-DCMAKE_INSTALL_PREFIX=/usr` which is a special case and should do what you describe by changing `${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}` to `${CMAKE_INSTALL_FULL_SYSCONFDIR}/`.
Quick, question though. Is there a case where you will want to install in a specific folder and then install the cfg somewhere else? (Apart from the special case described in the link.)
I don't think we should configure or define CFG_DIR; it should be evaluated from the install prefix according to the rules described above.
If you scroll down to [Special Cases](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html), you can see that it describes what you want. I may have an error on how it's evaluating the path, I'll look into that.
I see that the command you used produced this: `-DCMAKE_INSTALL_PREFIX=/usr` which is a special case and should do what you describe by changing `${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_SYSCONFDIR}` to `${CMAKE_INSTALL_FULL_SYSCONFDIR}/`.
I don't follow. In my build ``-DCMAKE_INSTALL_SYSCONFDIR=/etc`` is set already
Quick, question though. Is there a case where you will want to install in a specific folder and then install the cfg somewhere else? (Apart from the special case described in the link.)
in my case ``DESTDIR`` is ``debian/<pkg_name>`` where all the files should be installed and later packaged.
I don't think we should configure or define CFG_DIR; it should be evaluated from the install prefix according to the rules described above.
Uhm... ``CFG_DIR`` is something we use in code and it should be configurable.
I don't follow. In my build `-DCMAKE_INSTALL_SYSCONFDIR=/etc` is set already
Are you the one setting it or is the whatever tool you use maybe: `dh-cmake` defining them? It's not recommended to define this variables as absolute paths because it breaks `cmake --install --prefix` and cpack generators.
I don't think we should configure or define CFG_DIR; it should be evaluated from the install prefix according to the rules described above.
Uhm... `CFG_DIR` is something we use in code and it should be configurable.
It's configurable by evaluating the install prefix and the cfg_name but not setting it directly. Wasn't this also the case in Makefiles?
Is not just me... just grep ``cfg_target`` in ``pkg/``. It's a must for packaging.

Is not just me... just grep `cfg_target` in `pkg/`. It's a must for packaging.
OK, can you try with this https://github.com/kamailio/kamailio/commit/a08da7b34b01f4b0a579fbfdc141bf29... changes or did you already tried it?
If it's still not working, I'll introduce a new variable you can set, and discuss on where it should be used in the CMakelists.txt
Is not just me... just grep `cfg_target` in `pkg/`. It's a must for packaging.
OK, can you try with this [a08da7b](https://github.com/kamailio/kamailio/commit/a08da7b34b01f4b0a579fbfdc141bf29...) changes or did you already tried it?
If it's still not working, I'll introduce a new variable you can set, and discuss on where it should be used in the CMakelists.txt
Already tried, not working for me, sorry
Trying this ``` cd obj-x86_64-linux-gnu && DEB_PYTHON_INSTALL_LAYOUT=deb PKG_CONFIG=/usr/bin/pkg-config cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu "-DCC_EXTRA_OPTS="-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -DVERSION_NODATE"" "-DLD_EXTRA_OPTS="-Wl,-z,relro -Wl,-z,now"" "-DINCLUDE_MODULES="mysql postgres berkeley unixodbc radius presence ldap xml perl utils lua memcached snmpstats carrierroute xmpp cpl redis geoip2 sqlite json ruby ims sctp tls outbound websocket autheph kazoo cnxcc erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid lwsc nats tls_wolfssl microhttpd kafka ev gzcompress jansson uuid http_async"" "-DEXCLUDE_MODULES="mono geoip bdb dbtext oracle pa iptrtpproxy dnssec java python"" .. ```
I found some possible mistakes when trying the `cmake` command above. Correct if I am wrong somewhere:
1. Including and excluding of modules is wrong: There is no need (it works but is incorrect) to `"-DINCLUDE_MODULES="value""` directives only their values. Correct usage would be: ``` -DINCLUDE_MODULES="mysql postgres berkeley unixodbc radius presence ldap xml perl utils lua memcached snmpstats carrierroute xmpp cpl redis geoip2 sqlite json ruby ims sctp tls outbound websocket autheph kazoo cnxcc erlang systemd phonenum mongodb rabbitmq python3 mqtt secsipid lwsc nats tls_wolfssl microhttpd kafka ev gzcompress jansson uuid http_async" -DEXCLUDE_MODULES="mono geoip bdb dbtext oracle pa iptrtpproxy dnssec java python" ``` 2. See 1 about the rest of the options. I am not sure what is the correct usage of the quotes here, but I believe the same applies. 3. Modules naming is wrong. Modules that are included and excluded must have the same name of the folder ie `mysql` is `db_mysql`, `python` is `app_python` and so on. I got a lot of warnings when I tried the cmake commands and that was one of them. 4. `CC_EXTRA_OPS` and `LD_EXTRA_OPS` are not used inside the CMakeLists. I will adopt this so, it appends to the already defined options! Is this the expected behavior or you want to override them?
So, regarding the `cfg_target`, you want to apply a `-DCFG_TARGET=/path/to/config/folder` that is used, as the `CFG_DIR` and it's where the config files are installed?
See 1 about the rest of the options. I am not sure what is the correct usage of the quotes here, but I believe the same applies.
Anyhow, I have to rework the my cmake effort since ``dh-cmake`` is too recent and is not packaged for older releases. I need to call it directly. Are you planing to use ``cpack``?
Modules naming is wrong. Modules that are included and excluded must have the same name of the folder ie mysql is db_mysql, python is app_python and so on. I got a lot of warnings when I tried the cmake commands and that was one of them.
yes, they are wrong but the intention was to use ``k<value>`` as defined at [Makefile.groups](https://github.com/kamailio/kamailio/blob/master/src/Makefile.groups)
how should I use [groups.cmake](https://github.com/kamailio/kamailio/blob/master/cmake/groups.cmake) ?
CC_EXTRA_OPS and LD_EXTRA_OPS are not used inside the CMakeLists. I will adopt this so, it appends to the already defined options! Is this the expected behavior or you want to override them?
yes, the expected behavior is to append values.
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 ```
@linuxmaniac You may now set `-DUSE_GIT=OFF`, so that the configure step do not warn you out even if git is installed!
@linuxmaniac You can now also set `-DMODULE_GROUP_NAME=value` with value being `KSTANDARD`, `KMINI` and all the rest you are familiar with. For now it's case sensitive, but that can change. This option now will build only the modules assigned in that group!
I think we discussed the need to be able to provide two or more groups? I ll check that next if it's needed.
CC_EXTRA_OPS and LD_EXTRA_OPS are not used inside the CMakeLists. I will adopt this so, it appends to the already defined options! Is this the expected behavior or you want to override them?
@linuxmaniac Regarding this, `CMake` offer some env variables ([CFLAGS](https://cmake.org/cmake/help/latest/envvar/CFLAGS.html) and [LDFLAGS](https://cmake.org/cmake/help/latest/envvar/LDFLAGS.html#ldflags)) where the user can use, and then `CMake` use them to initialize the lists along some default compiler specifics.
So, to use them you have to set them as env variables just before the `cmake` configuration phase like:
**_Note: Be sure to run this the first time you run the CMake configuration phase. Subsquent call have the corresponding CMake variables used as cached already and therefore do no use the provided ones to initialize them. You can use --fresh though, as if you were calling it the first time._**
``` LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro " CFLAGS="-g -O2 -fdebug-prefix-map=/home/xenofon/kamailio-cmake=. -fstack-protector-strong -Wformat -Werror=format-security" cmake -S . -B build -DCMAKE_INSTALL_PREFIX=./kam6.0 -DINCLUDE_MODULES="async" -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DVERBOSE=ON -DMODULE_GROUP_NAME=KSTANDARD -DBUILD_DOC=ON -DEXCLUDE_MODULES="db_oracle dnssec jwt microhttpd nats nsq ruxc secsipid_proc stirshaken tls_wolfssl" -DCMAKE_BUILD_TYPE="Debug --fresh" ```
and then for verifying: `cmake --build build -t acc -v ` outputs (see bold -g -O2 ...)
cd /home/xenofon/kamailio-cmake/build/src/modules/acc && /usr/bin/cc -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DARCH="x86_64" -DCC_GCC_LIKE_ASM -DCFG_DIR="/home/xenofon/kamailio-cmake/kam6.0/etc/kamailio/" -DCOMPILER=""gcc 10.5.0"" -DDBG_SR_MEMORY -DDISABLE_NAGLE -DDNS_IP_HACK -DFAST_LOCK -DFMSTATS -DF_MALLOC -DHAVE_ALLOCA_H -DHAVE_EPOLL -DHAVE_GETHOSTBYNAME2 -DHAVE_IP_MREQN -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_MSG_NOSIGNAL -DHAVE_RESOLV_RES -DHAVE_SCHED_SETSCHEDULER -DHAVE_SCHED_YIELD -DHAVE_SELECT -DHAVE_SIGIO_RT -DHAVE_TIMEGM -DHAVE_UNION_SEMUN -DKMSTATS -DKSR_PTHREAD_MUTEX_SHARED -DMALLOC_STATS -DMOD_NAME="acc" -DMOD_NAMEID=acc -DNAME="kamailio" -DOS=Linux -DOS_QUOTED="Linux" -DPIC -DPKG_MALLOC -DQ_MALLOC -DRAW_SOCKS -DRUN_DIR="/home/xenofon/kamailio-cmake/kam6.0/var/run/kamailio" -DSHARE_DIR="/home/xenofon/kamailio-cmake/kam6.0/share/kamailio/" -DSHM_MMAP -DSIGINFO64_WORKAROUND -DSTATISTICS -DTLSF_MALLOC -DTLS_HOOKS -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLOCKLIST -DUSE_FUTEX -DUSE_MCAST -DUSE_NAPTR -DUSE_RAW_SOCKS -DUSE_SCTP -DUSE_TCP -DUSE_TLS -DVERSION="6.0.0-dev2" -DVERSIONVAL=6000000 -D__CPU_x86_64 -D__OS_linux -Dacc_EXPORTS **-g -O2 -fdebug-prefix-map=/home/xenofon/kamailio-cmake=. -fstack-protector-strong -Wformat -Werror=format-security** -g -std=gnu11 -fPIC -ffile-prefix-map=/home/xenofon/kamailio-cmake/src/modules/acc/= -fPIC -O0 -Wall -funroll-loops -Wcast-align -Werror=implicit-function-declaration -Werror=implicit-int -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -MD -MT src/modules/acc/CMakeFiles/acc.dir/acc_mod.c.o -MF CMakeFiles/acc.dir/acc_mod.c.o.d -o CMakeFiles/acc.dir/acc_mod.c.o -c /home/xenofon/kamailio-cmake/src/modules/acc/acc_mod.c
/usr/bin/cc -fPIC -g -O2 -fdebug-prefix-map=/home/xenofon/kamailio-cmake=. -fstack-protector-strong -Wformat -Werror=format-security -g **-Wl,-Bsymbolic-functions -Wl,-z,relro** -shared -Wl,-soname,acc.so -o acc.so
Hey @linuxmaniac,
After 2dc8de1, you should be able to pass multiple groups in the `-DMODULE_GROUP_NAME` option like
`cmake -S . -B build-multigroup -DMODULE_GROUP_NAME="KSTANDARD KMYSQL"`
along with the `INCLUDE_MODULES` and `EXCLUDE_MODULES` options that accept specific modules.
Hey @linuxmaniac,
Just a ping to see if you have any updates or missing stuff for packaging?
In https://github.com/kamailio/kamailio/pull/4085, with discussion from @sergey-safarov, I pushed some missing docs, man, config files and more.
if you need anything still, just ping me!
``` Setting up xsltproc (1.1.35-1.1+b1) ... ``` but still I get this error: ``` CMake Warning at cmake/modules-docs.cmake:9 (message): xsltproc or lynx not found but required for doc generation. ``` the executable is there: ``` (unstable-amd64-sbuild)root@debrock:/build/kamailio-ryw8OC# dpkg -L xsltproc /. /usr /usr/bin /usr/bin/xsltproc /usr/share /usr/share/doc /usr/share/doc/xsltproc /usr/share/doc/xsltproc/AUTHORS /usr/share/doc/xsltproc/FEATURES.gz /usr/share/doc/xsltproc/NEWS.gz /usr/share/doc/xsltproc/README /usr/share/doc/xsltproc/TODO /usr/share/doc/xsltproc/changelog.Debian.amd64.gz /usr/share/doc/xsltproc/changelog.Debian.gz /usr/share/doc/xsltproc/changelog.gz /usr/share/doc/xsltproc/copyright /usr/share/man /usr/share/man/man1 /usr/share/man/man1/xsltproc.1.gz ```
after a1bdef919414173e8327a8dd65ecaa2fca279d6a the build continues but then: ``` -- Compile options for common: MY_INTERFACE_OPTIONS-NOTFOUND -- Found FLEX: /usr/bin/flex (found version "2.6.4") -- Found BISON: /usr/bin/bison (found version "3.8.2") -- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.14") -- Building groups: KSTANDARD;KMYSQL;KPOSTGRES;KBERKELEY;KUNIXODBC;KRADIUS;KPRESENCE;KLDAP;KXML;KPERL;KUTILS;KLUA;KMEMCACHED;KSNMPSTATS;KXMPP;KCPL;KREDIS;KGEOIP2;KSQLITE;KJSON;KRUBY;KIMS;KSCTP;KTLS;KOUTBOUND;KWE BSOCKET;KAUTHEPH;KKAZOO;KCNXCC;KERLANG;KSYSTEMD;KPHONENUM;KMONGODB;KRABBITMQ;KPYTHON3;KMQTT;KSECSIPID;KLWSC;KNATS;KTLS_WOLFSSL;KMICROHTTPD;KKAFKA;KEV;KGZCOMPRESS;KJANSSON;KUUID;KHTTP_ASYNC -- xsltproc or lynx not found but required for doc generation. -- Extra modules (if module already included already from group is ignored):
-- Excluded modules (exlcude even if in included modules): mono;geoip;bdb;dbtext;oracle;pa;iptrtpproxy;dnssec;java;python -- PCRE2 library not found... looking with pkg-config -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") -- Checking for module 'libpcre2-8' -- Found libpcre2-8, version 10.44 -- PCRE2 library not found... looking with pkg-config -- Checking for module 'libpcre2-8' -- Found libpcre2-8, version 10.44 -- Found MariaDBClient: /usr/lib/x86_64-linux-gnu/libmariadb.so -- Found PostgreSQL: /usr/lib/x86_64-linux-gnu/libpq.so (found version "17.2") CMake Error at /usr/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message): Could NOT find BerkeleyDB (missing: BerkeleyDB_LIBRARY) (found version "5.3.28") Call Stack (most recent call first): /usr/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE) cmake/modules/FindBerkeleyDB.cmake:147 (find_package_handle_standard_args) src/modules/db_berkeley/CMakeLists.txt:6 (find_package)
-- Configuring incomplete, errors occurred! ```
Hey @linuxmaniac,
the cmake error noted here is the missing Berkeley db libraries. are those installed?
for the `xsltproc or lynx missing`, maybe lynx is missing? Even if they are missing cmake won't error out on them and should run perfectly fine!
the cmake error noted here is the missing Berkeley db libraries. are those installed?
``` (unstable-amd64-sbuild)root@debrock:/build/kamailio-YmzKKQ# dpkg -L libdb5.3-dev /. /usr /usr/include /usr/include/db.h /usr/include/db_185.h /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libdb-5.3.a /usr/share /usr/share/doc /usr/lib/x86_64-linux-gnu/libdb.a /usr/lib/x86_64-linux-gnu/libdb.so /usr/share/doc/libdb5.3-dev ```
After 13d306dd97989162bf716fa23342608bce037b9b, `BerkeleyDB` should be found correctly!
``` Setting up libphonenumber8:amd64 (8.13.51+ds-4) ... ```
``` CMake Error at /usr/lib/x86_64-linux-gnu/cmake/libphonenumber/libphonenumber-targets.cmake:118 (message): The imported target "libphonenumber::phonenumber" references the file
"/usr/lib/x86_64-linux-gnu/libphonenumber.a"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/usr/lib/x86_64-linux-gnu/cmake/libphonenumber/libphonenumber-targets.cmake"
but not all the files it references.
Call Stack (most recent call first): /usr/lib/x86_64-linux-gnu/cmake/libphonenumber/libphonenumber-config.cmake:42 (include) src/modules/phonenum/CMakeLists.txt:6 (find_package)
-- Configuring incomplete, errors occurred! ```
``` unstable-amd64-sbuild)root@debrock:/build/kamailio-bufF3L# dpkg -L libphonenumber8 /. /usr /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/libphonenumber.so.8.13 /usr/share /usr/share/doc /usr/share/doc/libphonenumber8 /usr/share/doc/libphonenumber8/changelog.Debian.gz /usr/share/doc/libphonenumber8/copyright /usr/lib/x86_64-linux-gnu/libphonenumber.so.8 ```
just in case you're wandering, the dev package is installed too ``` (unstable-amd64-sbuild)root@debrock:/build/kamailio-oOi7Im# dpkg -L libphonenumber-dev /. /usr /usr/include /usr/include/phonenumbers /usr/include/phonenumbers/asyoutypeformatter.h /usr/include/phonenumbers/base /usr/include/phonenumbers/base/basictypes.h /usr/include/phonenumbers/base/logging.h /usr/include/phonenumbers/base/memory /usr/include/phonenumbers/base/memory/scoped_ptr.h /usr/include/phonenumbers/base/memory/singleton.h /usr/include/phonenumbers/base/memory/singleton_boost.h /usr/include/phonenumbers/base/memory/singleton_posix.h /usr/include/phonenumbers/base/memory/singleton_stdmutex.h /usr/include/phonenumbers/base/memory/singleton_unsafe.h /usr/include/phonenumbers/base/memory/singleton_win32.h /usr/include/phonenumbers/base/synchronization /usr/include/phonenumbers/base/synchronization/lock.h /usr/include/phonenumbers/base/synchronization/lock_boost.h /usr/include/phonenumbers/base/synchronization/lock_posix.h /usr/include/phonenumbers/base/synchronization/lock_stdmutex.h /usr/include/phonenumbers/base/synchronization/lock_unsafe.h /usr/include/phonenumbers/base/synchronization/lock_win32.h /usr/include/phonenumbers/base/template_util.h /usr/include/phonenumbers/base/thread_checker.h /usr/include/phonenumbers/callback.h /usr/include/phonenumbers/geocoding /usr/include/phonenumbers/geocoding/phonenumber_offline_geocoder.h /usr/include/phonenumbers/logger.h /usr/include/phonenumbers/matcher_api.h /usr/include/phonenumbers/phonemetadata.pb.h /usr/include/phonenumbers/phonenumber.pb.h /usr/include/phonenumbers/phonenumbermatch.h /usr/include/phonenumbers/phonenumbermatcher.h /usr/include/phonenumbers/phonenumberutil.h /usr/include/phonenumbers/regexp_adapter.h /usr/include/phonenumbers/regexp_cache.h /usr/include/phonenumbers/region_code.h /usr/include/phonenumbers/shortnumberinfo.h /usr/include/phonenumbers/unicodestring.h /usr/include/phonenumbers/utf /usr/include/phonenumbers/utf/unicodetext.h /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/cmake /usr/lib/x86_64-linux-gnu/cmake/libphonenumber /usr/lib/x86_64-linux-gnu/cmake/libphonenumber/libphonenumber-config-version.cmake /usr/lib/x86_64-linux-gnu/cmake/libphonenumber/libphonenumber-config.cmake /usr/lib/x86_64-linux-gnu/cmake/libphonenumber/libphonenumber-targets-none.cmake /usr/lib/x86_64-linux-gnu/cmake/libphonenumber/libphonenumber-targets.cmake /usr/share /usr/share/doc /usr/share/doc/libphonenumber-dev /usr/share/doc/libphonenumber-dev/changelog.Debian.gz /usr/share/doc/libphonenumber-dev/copyright /usr/lib/x86_64-linux-gnu/libgeocoding.so /usr/lib/x86_64-linux-gnu/libphonenumber.so ```
@linuxmaniac
i am guessing you are using sid debian where libphonenumber 8.13 added support for cmake.
it seems that the installation is missing the static libraries that are required for some reason. This need to be discussed probably with the upstream packager to include them or dont require them if no static libraries are requested.
all latest release of ubuntu installed the 8.12 with static versions as well. But the new `plucky` 25.04 that also installs 8.13, is missing the static libraries.
here is where the debian maintainer removed static files https://salsa.debian.org/debian/libphonenumber/-/commit/ae644645da0fc5f69584...
i don't know why they removed it.
shouldn't it be install if someone wants to choose between shared and static? Is there a separate package for static? I can't open an issue in https://github.com/google/libphonenumber. do they use some other tracker if you happen to know?
We we want to build the phonenum module static in the first place? The old makefile system just build it dynamic linked, we should probably do the same?
We don't want it, but there is probably a bug(or intentional idk) in how they provided the targets for CMake that requires the static library to be there.
Then one can choose between `libphonenumber::phonenumber-shared` for shared linkage and `libphonenumber::phonenumber` for static linkage.
In rpm packages, it works with shared linking ``` [root@esrp-1a ~]# ldd /usr/lib64/kamailio/modules/phonenum.so| grep phone libphonenumber.so.8 => /lib64/libphonenumber.so.8 (0x0000ffff9602f000) [root@esrp-1a ~]# rpm -ql kamailio-phonenum-5.8.2-4.el9.centos.aarch64 /usr/lib/.build-id /usr/lib/.build-id/e6/a9515bbc951a1d0dd0abc95533e6d71f4b8566 /usr/lib64/kamailio/modules/phonenum.so /usr/share/doc/kamailio/modules/README.phonenum [root@esrp-1a ~]# ldd /usr/lib64/kamailio/modules/phonenum.so| grep phone libphonenumber.so.8 => /lib64/libphonenumber.so.8 (0x0000ffffb513c000)
```
Can you tell me the version of `libphonenumber`? Is it >8.13?
That is the version that add `cmake` config file and seems to be broken on debian.
For rpm it will be ``` [root@nout SPECS]# rpm -qa | grep libphonenum libphonenumber-8.13.45-1.fc41.x86_64 libphonenumber-devel-8.13.45-1.fc41.x86_64 ```
here is where the debian maintainer removed static files https://salsa.debian.org/debian/libphonenumber/-/commit/ae644645da0fc5f69584...
@linuxmaniac
As far as I can understand, here is the [configure step of cmake](https://salsa.debian.org/debian/libphonenumber/-/blob/debian/sid/debian/rule...). They don't set [BUILD_STATIC_LIB]( https://github.com/google/libphonenumber/blob/ff8fbbdb2ffe12aff1c7f54d5314b2...) to `OFF` and therefore both shared and static are built and their targets do exist.
So, by not installing the static libraries, the static target complains that the static library is not found and rightfully so. Either the debian packager must set the `BUILD_STATIC_LIB` option to `OFF` if they don't want to offer the static version, or install the the static as well.
That's my understanding so far, please let me know if I get something wrong! and if there is a way to create an issue for the debian packager
For rpm it will be
[root@nout SPECS]# rpm -qa | grep libphonenum libphonenumber-8.13.45-1.fc41.x86_64 libphonenumber-devel-8.13.45-1.fc41.x86_64
For Fedora https://kojipkgs.fedoraproject.org//packages/libphonenumber/8.13.45/1.fc41/d... from here I see that both are installed and picks up correctly therefore
Filing a debian issue will probably take some time until it will be eventually fixed. Is there some workaround, e.g. can we specify this flag from our side, or maybe providing a fixed copy of this cmake specific file in our tree?
I think i can remove the https://github.com/kamailio/kamailio/blob/13d306dd97989162bf716fa23342608bce... alltogether and be done with it for now. The next searches are done manually and will pick (hopefully) the shared version if installed.
``` make[3]: *** No rule to make target '/usr/lib/erlang/lib/erl_interface-5.5.2/lib/liberl_interface.a', needed by 'src/modules/erlang/erlang.so'. Stop. [...] make[2]: *** [CMakeFiles/Makefile2:45976: src/modules/erlang/CMakeFiles/erlang.dir/all] Error 2 ```
And again, @xkaraman I still don't know how to tell cmake to just install a GROUP only.
I will try to explain my workflow.
First the configure step using ``MODULE_GROUP_NAME`` to define ALL the groups I want to build and not using ``EXCLUDE_MODULES``: ``` dh_auto_configure -- \ -DUSE_GIT=OFF \ -DEXCLUDE_MODULES="mono geoip erlang bdb dbtext oracle pa iptrtpproxy dnssec java python" \ -DMODULE_GROUP_NAME="KSTANDARD KMYSQL KPOSTGRES KBERKELEY KUNIXODBC KRADIUS KPRESENCE KLDAP KXML KPERL KUTILS KLUA KMEMCACHED KSNMPSTATS KXMPP KCPL KREDIS KGEOIP2 KSQLITE KJSON KRUBY KIMS KSCTP KTLS KOUTBOUND KWEBSOCKET KAUTHEPH KKAZOO KCNXCC KSYSTEMD KPHONENUM KMONGODB KRABBITMQ KPYTHON3 KMQTT KSECSIPID KLWSC KNATS KTLS_WOLFSSL KMICROHTTPD KKAFKA KEV KGZCOMPRESS KJANSSON KUUID KHTTP_ASYNC" │ cd obj-x86_64-linux-gnu && DEB_PYTHON_INSTALL_LAYOUT=deb PKG_CONFIG=/usr/bin/pkg-config cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTA│ TEDIR=/var -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DFETCHCONTENT_FULLY_DISCONNECTED=ON -DCMAKE_INSTALL_RUNSTATEDIR=/run -DCMAKE_S│ KIP_INSTALL_ALL_DEPENDENCY=ON "-GUnix Makefiles" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu -DUSE_GIT=OFF "-DEXCLUDE_MODULES=mono geoip erlang bdb dbtext oracle pa iptrtpproxy dnsse│ c java python" "-DMODULE_GROUP_NAME=KSTANDARD KMYSQL KPOSTGRES KBERKELEY KUNIXODBC KRADIUS KPRESENCE KLDAP KXML KPERL KUTILS KLUA KMEMCACHED KSNMPSTATS KXMPP KCPL KREDIS KGEOIP2 KSQLITE KJSON KRUBY KIMS KSCTP K│ TLS KOUTBOUND KWEBSOCKET KAUTHEPH KKAZOO KCNXCC KSYSTEMD KPHONENUM KMONGODB KRABBITMQ KPYTHON3 KMQTT KSECSIPID KLWSC KNATS KTLS_WOLFSSL KMICROHTTPD KKAFKA KEV KGZCOMPRESS KJANSSON KUUID KHTTP_ASYNC" .. ``` That seems to work just fine. ``` -- Modules to be built: async;auth;benchmark;blst;cfg_rpc;cfgutils;corex;counters;ctl;debugger;diversion;enum;exec;ipops;kex;mangler;maxfwd;mediaproxy;mqueue;nat_traversal;nathelper;path;pike;pv;ratelimit;rr;rtimer;rtpproxy;sanity;sdpops;siputils;sl;statistics;textops;textopsx;tm;tmx;topoh;xlog;rtpengine;stun;sipt;tcpops;auth_xkeys;smsops;tsilo;cfgt;statsc;topos;topos_htable;sipdump;pv_headers;kemix;avp;auth_diameter;call_control;call_obj;dmq;domainpolicy;msrp;carrierroute;pdb;qos;sca;seas;sms;sst;timer;tmrec;uac_redirect;xhttp;xhttp_rpc;xprint;jsonrpcs;nosip;dmq_usrloc;statsd;rtjson;log_custom;keepalive;ss7ops;acc_diameter;evrexec;file_out;sipjson;lrkproxy;math;posops;xhttp_prom;dlgs;sworker;influxdbc;acc;alias_db;auth_db;avpops;cfg_db;db_text;db_flatstore;db_cluster;dialog;dispatcher;domain;drouting;group;htable;imc;matrix;mohqueue;msilo;mtree;p_usrloc;pdt;permissions;pipelimit;prefix_route;registrar;sipcapture;siptrace;speeddial;sqlops;uac;uri_db;userblocklist;usrloc;secfilter;db2_ops;uid_auth_db;uid_avp_db;uid_domain;uid_gflags;uid_uri_db;dialplan;lcr;regex;app_jsdt;db_mysql;db_postgres;db_berkeley;db_unixodbc;acc_radius;auth_radius;misc_radius;peering;presence;presence_conference;presence_dfks;presence_dialoginfo;presence_mwi;presence_profile;presence_reginfo;presence_xml;pua;pua_bla;pua_dialoginfo;pua_reginfo;pua_rpc;pua_usrloc;pua_xmpp;rls;xcap_client;xcap_server;db2_ldap;h350;ldap;xhttp_pi;xmlrpc;xmlops;app_perl;db_perlvdb;utils;http_client;lost;slack;app_lua;memcached;snmpstats;xmpp;db_redis;ndb_redis;topos_redis;geoip2;db_sqlite;json;pua_json;jsonrpcc;app_ruby;app_ruby_proc;cdp;cdp_avp;ims_dialog;ims_auth;ims_isc;ims_icscf;ims_qos;ims_registrar_pcscf;ims_registrar_scscf;ims_usrloc_pcscf;ims_usrloc_scscf;ims_charging;ims_ocs;ims_diameter_server;ims_ipsec_pcscf;sctp;crypto;tls;outbound;websocket;auth_ephemeral;kazoo;cnxcc;log_systemd;systemdops;phonenum;db_mongodb;ndb_mongodb;rabbitmq;app_python3;app_python3s;mqtt;secsipid;secsipid_proc;lwsc;nats;tls_wolfssl;microhttpd;kafka;evapi;gzcompress;jansson;acc_json;janssonrpcc;uuid;http_async_client ``` And the build starts... ``` -- Build files have been written to: /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu make[1]: Leaving directory '/<<PKGBUILDDIR>>' dh_auto_build -O--buildsystem=cmake cd obj-x86_64-linux-gnu && make -j16 "INSTALL=install --strip-program=true" VERBOSE=1 ``` and after that I'm calling something like this for each GROUP: ``` dh_auto_install --buildsystem=cmake -pkamailio-mysql-modules \ --destdir=debian/kamailio-mysql-modules \ -- MODULE_GROUP_NAME=KMYSQL ``` That produces this command: ``` cd obj-x86_64-linux-gnu && make -j16 install DESTDIR=/<<BUILDDIR>>/kamailio-6.0.0~pre0/debian/kamailio-mysql-modules AM_UPDATE_INFO_DIR=no "INSTALL=install --strip-program=true" MODULE_GROUP_NAME=KMYSQL ```
That installs everything again and again in different ``DESTDIR``. How is the proper way to tell install rule to just install a GROUP?
Hey @linuxmaniac ,
Yeah there seems to be a misunderstanding how `MODULE_GROUP_NAME` works.
So, what it currently does is that you provide the group names you want and then creates a list of all the modules that are part of those groups. Therefore it's a one big list of modules at the end. `CMake` then, builds ALL the modules on the list and therefore install targets are for all the modules that were configured.
By doing `-DMODULE_GROUP_NAME="KSTANDARD KMYSQL KPOSTGRES KBERKELEY KUNIXODBC KRADIUS KPRESENCE KLDAP KXML KPERL KUTILS KLUA KMEMCACHED KSNMPSTATS KXMPP KCPL KREDIS KGEOIP2 KSQLITE KJSON KRUBY KIMS KSCTP KTLS KOUTBOUND KWEBSOCKET KAUTHEPH KKAZOO KCNXCC KSYSTEMD KPHONENUM KMONGODB KRABBITMQ KPYTHON3 KMQTT KSECSIPID KLWSC KNATS KTLS_WOLFSSL KMICROHTTPD KKAFKA KEV KGZCOMPRESS KJANSSON KUUID KHTTP_ASYNC"`, you might as well do `-DMODULE_GROUP_NAME=ALL`, (assuming you included all groups in the list).
So, if one wants to build one group and only those files installed, `MODULE_GROUP_NAME` should only contain ONE group name, ie `MODULE_GROUP_NAME=KSTANDARD` in the _configuration_ phase. Afterwards, build and installed will install only that group!
Is this plausible to do with maybe a loop in your deb creation or I need to find another way for single configure command and separate install commands for groups?
make[3]: *** No rule to make target '/usr/lib/erlang/lib/erl_interface-5.5.2/lib/liberl_interface.a', needed by 'src/modules/erlang/erlang.so'. Stop. [...] make[2]: *** [CMakeFiles/Makefile2:45976: src/modules/erlang/CMakeFiles/erlang.dir/all] Error 2
I pushed some other fixes after trying to build `ALL` group in `sid`. Hopefully, you wont find other missing packages and are building correctly apart from these `EXCLUDE_MODULES="db_oracle dnssec nsq nghttp2 rtp_media_server app_python app_java ims_icscf ims_dialog ruxc secsipid_proc stirshaken"`
So, if one wants to build one group and only those files installed, MODULE_GROUP_NAME should only contain ONE group name, ie MODULE_GROUP_NAME=KSTANDARD in the configuration phase. Afterwards, build and installed will install only that group!
This flow doesn't work at all. If you call just one group, core gets build for that group. And in combination of different build dir for each group... You end up building the core for each group again and again.
This flow doesn't work at all. If you call just one group, core gets build for that group. And in combination of different build dir for each group... You end up building the core for each group again and again.
You can use the same build directory for all but indeed it will **install** always the core in your `DESTDIR`.
--- So I introduced the components found in cmake `install` commands in https://github.com/kamailio/kamailio/tree/cmake **branch**.
**Unfortunately, this requires `CMake 3.15`, if we can afford it.**
What you can do now is:
Provide all the groups in the configuration phase like you did before `-DMODULE_GROUP_NAME='KSTANDARD KJSON KPERL'`. Try using the K-variations, otherwise the components won't be defined for later. You can do for example the `ALL` but if you don't provide the `KJSON` as well, the component `KJSON` won't be there (only the `ALL`) even if the module is going to be compiled.
Then you proceed to build everything in one go, in the same build directory `cmake --build build_folder -j8` . (remember to use specific targets as well if you need non default files like dbschema for example).
and lastly to install a specific component you can use
`DESTDIR=path_to_folder cmake --install build_folder --component component_name`
where component_name can be `kamailio-core` for installing everything related to core, such `kamctl`, `kamdbctl`, docs, man, configs, (if I didn't miss anything...) or any of the provided `MODULE_GROUP_NAME`.
You can't give yet multiple components to the command, as noted in [issue](https://gitlab.kitware.com/cmake/cmake/-/issues/24335). You can run the same command with the same `DESTDIR` with diff component and it will install only the related files.
If this is not desirable, I will try to find some other alternatives...
Cheers, Xenofon
@linuxmaniac
I am aware of some installed files (db related files and scripts files mostly) are getting still installed when not appropriate component is selected.
I am working on it still.
@linuxmaniac
I have pushed some new commits in https://github.com/kamailio/kamailio/tree/cmake. You should be able to install now properly all files related to groups using the above noted comment:
Provide all the groups in the configuration phase like you did before `-DMODULE_GROUP_NAME='KSTANDARD KJSON KPERL'`. Try using the K-variations, otherwise the components won't be defined for later. You can provide for example the `ALL` group but if you don't provide the `KJSON` as well, the component `KJSON` won't be there (only the `ALL`) even if the module is going to be compiled.
Then you proceed to build everything in one go, in the same build directory `cmake --build build_folder -j8` . (remember to use specific targets as well if you need non default files like dbschema for example).
and lastly to install a specific component you can use
`DESTDIR=path_to_folder cmake --install build_folder --component component_name` or the workaround for older versions: `DESTDIR=path_to_folder cmake -DCOMPONENT=component_name -P {your_build_dir}/cmake_install.cmake`
where component_name can be `kamailio-core` for installing everything related to core, such `kamctl`, `kamdbctl`, docs, man, configs, (if I didn't miss anything...) or any of the provided `MODULE_GROUP_NAME`.
For example:
Include groups KBERKELEY and KXML:
`cmake -S . -B build-comp -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DVERBOSE=off -DBUILD_DOC=OFF --fresh -DEXCLUDE_MODULES="db_oracle dnssec jwt microhttpd nats nsq ruxc secsipid_proc stirshaken tls_wolfssl app_lua" -DCMAKE_BUILD_TYPE="Debug" -DMODULE_GROUP_NAME="KBERKELEY KXML" -DINCLUDE_MODULES=""`
Build: `cmake --build build-comp -j8 [-t dbschema]` (Don't forget to build the `dbschema` target as well if you dbfiles to be installed as well)
Install: `DESTDIR=path_to_folder cmake --install build-comp --component KBERKELEY` will install anything related to berkeley
``` -- Install configuration: "Debug" -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/modules/db_berkeley.so -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/share/doc/kamailio/modules/README.db_berkeley -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamctl.db_berkeley -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamdbctl.db_berkeley -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/share/kamailio/db_berkeley -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/share/kamailio/db_berkeley/kamailio -- Installing: /home/xenofon/kamailio-cmake/kam6comp/share/kamailio/db_berkeley/kamailio/dr_gateways -- Installing: /home/xenofon/kamailio-cmake/kam6comp/share/kamailio/db_berkeley/kamailio/mohqueues .... -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/sbin/kamdb_recover ```
and `DESTDIR=path_to_folder cmake --install build-comp --component kamailio-core` will install anything related to core
``` -- Install configuration: "Debug" -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/sbin/kamailio -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/share/doc/kamailio/README -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/share/doc/kamailio/INSTALL -- kamailio.cfg already exists in /home/xenofon/kamailio-cmake/kam6comp/etc/kamailio/kamailio.cfg. Installing as kamailio.cfg.sample -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/etc/kamailio/kamailio.cfg.sample -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamctl.base -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamctl.ctlbase -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamctl.rpcfifo -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamctl.ser -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamctl.sqlbase -- Installing: /home/xenofon/kamailio-cmake/kam6comp/sbin/kamctl -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/lib/kamailio/kamctl/kamdbctl.base -- Installing: /home/xenofon/kamailio-cmake/kam6comp/sbin/kamdbctl -- kamctlrc already exists in/home/xenofon/kamailio-cmake/kam6comp/etc/kamailio/kamctlrc. Installing as kamctlrc.sample -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/etc/kamailio/kamctlrc.sample -- Up-to-date: /home/xenofon/kamailio-cmake/kam6comp/sbin/kamcmd ```
``` override_dh_auto_build: cmake --build obj-${DEB_BUILD_GNU_TYPE} -j$(NUMJOBS) -t dbschema ```
fails in the dbschema part
``` /bin/sh: 1: XML_CATALOG_FILES=/<<PKGBUILDDIR>>/doc/stylesheets/dbschema_k/catalog.xml: not found ``` [kamailio_6.1.0~dev0_amd64-2025-02-11T01:52:16Z.build.log](https://github.com/user-attachments/files/18743065/kamailio_6.1.0.dev0_amd64...)
xkaraman left a comment (kamailio/kamailio#4053)
Hey @linuxmaniac ,
I am not exactly sure why this fails on your system. That `<<PKGBUILDDIR>>` should have expanded to the full path of the source code tree.
From the logs i see this: `I: NOTICE: Log filtering will replace 'build/kamailio-76r2kT/kamailio-6.1.0~dev0' with '<<PKGBUILDDIR>>'`
Is that the root tree of the kamailio source code? It should contain the path to the xml file.
I have pushed 63920593839081e1532cd77a41d13413161ee139, that add some quoting but not sure if it will actually help.
Can you check whether it fixes that?
linuxmaniac left a comment (kamailio/kamailio#4053)
Sorry, I didn't explain that ``<<PKGBUILDDIR>>`` is just a thing that `sbuild` does to output log. There's nothing wrong with that "fake" path
xkaraman left a comment (kamailio/kamailio#4053)
Yeah ok np.
Is that the root tree of the kamailio source code? It should contain the path to the xml file. if not something is calling cmake with wrong paths and need more information on it.
linuxmaniac left a comment (kamailio/kamailio#4053)
Is that the root tree of the kamailio source code?
Yes, it is
xkaraman left a comment (kamailio/kamailio#4053)
`cd "/<<PKGBUILDDIR>>/src/lib/srdb1/schema" && "XML_CATALOG_FILES=/<<PKGBUILDDIR>>/doc/stylesheets/dbschema_k/catalog.xml" /usr/bin/xsltproc --xinclude --stringparam dir /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/src/modules/db_mysql/mysql/'' --stringparam prefix acc- --stringparam db mysql /<<PKGBUILDDIR>>/doc/stylesheets/dbschema_k/xsl/mysql.xsl kamailio-acc.xml`
I am not familiar with your workflow with packaging but there seems to be a problem with the above command. `"XML_CATALOG_FILES=/<<PKGBUILDDIR>>/doc/stylesheets/dbschema_k/catalog.xml"` is enclosed in quotes that makes bash/sh think it'a command? hence not found? Is there a bash/sh directive somewhere that somehow misinterpeting the arguments?
In my runs i have seen `XML_CATALOG_FILES=/<<PKGBUILDDIR>>/doc/stylesheets/dbschema_k/catalog.xml` without the additional double quotes.