Using rpmbuild to create rpms from spec-files fails the error below when the file use-flag is enabled. error: magic_load(ms, /usr/lib64/rpm/magic) failed: could not find any magic files! The error disappears when using rpmbuild without the file use-flag.
Having the stable packages app-arch/4.4.6-r6 and sys-apps/file-5.03 installed, I get: error: magic_load(ms, "/usr/lib/rpm/magic") failed: could not find any magic files! The magic-related links in /usr/lib/rpm to /usr/share/misc/file are dead as the 'file'-directory does not exist. After upgrade to app-arch/rpm-5.1.6, packaging RPMs still doesn't work - but it fails with another (later?) error, at least.
*** Bug 292511 has been marked as a duplicate of this bug. ***
I have the same problem with app-arch/rpm-4.4.6-r6. A temporary fix on my side was to fix a broken symlink manually: cd /usr/lib/rpm ln -sf /usr/share/misc/magic.mgc The solution in the ebuild for "app-arch/rpm-4.4.6-r6" would be to replace in src_install() function: dosym /usr/share/misc/file/${magic_file} /usr/lib/rpm/${magic_file} by dosym /usr/share/misc/${magic_file} /usr/lib/rpm/${magic_file}
Emerging the (obsolete) file-4.23 package installs all the expected magic files under /usr/share/misc/files. (The current file-5.03 doesn't.)
This does not seem to depend on the version of rpm. I reproduce the problem with app-arch/rpm-4.4.6 as well. unknown, 0: Warning: using regular magic file `/usr/lib/rpm/magic' error: magic_load(ms, "/usr/lib/rpm/magic") failed: could not find any magic files!
Fixed in app-arch/rpm-4.4.6-r7. With respect to the other versions, do symlinks even get created or should they been added to the ebuilds? Can anyone with the package already installed check?