Oh, I looked at your source code and you moved "/var/lib/dnf" to
"/usr/lib/sysimage/dnf" using a patch, but I don't think that's needed. Using
the original location is just fine.
That re-describes the problem as, not packing "/usr/lib/sysimage/libdnf5" in.
And you seem to be confusing the two folders (libdnf5 and dnf).
> ls -l /usr/lib/sysimage/libdnf5/
total 736
drwxr-xr-x. 1 root root 0 Dec 17 20:28 comps_groups
-rw-r--r--. 1 root root 34 Dec 17 23:03 environments.toml
-rw-r--r--. 1 root root 28 Dec 17 23:03 groups.toml
-rw-r--r--. 1 root root 29 Dec 17 23:03 modules.toml
-rw-r--r--. 1 root root 1151 Dec 17 23:03 nevras.toml
-rw-r--r--. 1 root root 860 Dec 17 23:03 packages.toml
-rw-r--r--. 1 root root 116 Dec 17 23:03 system.toml
-rw-r--r--. 1 root root 139264 Dec 17 23:03 transaction_history.sqlite
-rw-r--r--. 1 root root 32768 Dec 17 23:03 transaction_history.sqlite-shm
-rw-r--r--. 1 root root 556232 Dec 17 23:03 transaction_history.sqlite-wal