[Mageia-dev] Trouble building rkhunter RPM

Hoyt Duff hoytduff at gmail.com
Fri Jan 14 06:28:35 CET 2011


I posted this to the general list, but didn't receive any useful
comments so far.

I'm trying to learn a little about packaging and was attempting to
build source and binary packages from a tarball with an embedded .spec
file for rkhunter-1.3.8-1 and maybe submit it to Mageia with
appropriate rkhunter.conf tweaks to remove false positives when I'm done.

Building on Mandriva 2010.2, "rpmbuild -ta" fails with:

<SNIP>
Processing files: rkhunter-1.3.8-1
error: File not found:
/home/hoyt/rpmbuild/BUILDROOT/rkhunter-1.3.8-1.i386/usr/lib/rkhunter
error: File not found:
/home/hoyt/rpmbuild/BUILDROOT/rkhunter-1.3.8-1.i386/usr/lib/rkhunter/scripts
error: File not found by glob:
/home/hoyt/rpmbuild/BUILDROOT/rkhunter-1.3.8-1.i386/usr/lib/rkhunter/scripts/*.pl
error: File not found by glob:
/home/hoyt/rpmbuild/BUILDROOT/rkhunter-1.3.8-1.i386/usr/lib/rkhunter/scripts/*.sh

I contacted the author, who says the rpm will build on Fedora. He
says: "Path error. The .spec file "%define _prefix /usr/local"
and in the %files section "%{_libdir}/%{name}" should pick up
"%_prefix". For some
reason it doesn't but then again I never built RPM's on Mandriva..."

... and gave me a hack to try that fails also with an error he has
never seen before,
error: Package already exists: %package __restore__

The .spec file as provided defines %define _prefix as /usr/local. Yes,
I know that it should be /usr for a Mandriva-specific package, but I'd
like to actually build the package first so I can understand what
needs to be patched to build from the pristine sources on
Madriva/Mageia, not start from scratch - that kind of defeats the
purpose of RPM.

In the %files section "%{_libdir}/%{name}" should pick up "%_prefix"
so as to have a value of /usr/local/lib,
but it does not. As a result, some files don't get created in the proper
directories and the build fails.

What I'm asking is if there is a difference in how Mandrake handles
that substitution versus how Fedora handles that. I installed Fedora
in a VM and the package builds fine on Fedora, but I get the error on
Madriva. I've examined the .spec file and don't see where there is any
obvious problem, so I'm seeking some guidance as to where to look
deeper.

While I can find lots of (mostly useless) info on RPM building through
Google, I'm not sure where to look for any Mandriva docs for that, so
a suggestion for that would be welcome as well.

-- 
Hoyt


More information about the Mageia-dev mailing list