[Mageia-discuss] Trying to learn a little about packaging

Michael Scherer misc at zarb.org
Fri Jan 14 12:42:09 CET 2011


Le vendredi 14 janvier 2011 à 00:18 -0500, Hoyt Duff a écrit :
> 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",
> but it does not. As a result, some files don't get created in two
> 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.

That's quite simple.
On fedora :
~ $ rpm --showrc | grep -i ' _libdir'
-14: _libdir	%{_prefix}/lib

On mandriva :
$ rpm --showrc | grep -i ' _libdir'  
-14: _libdir	/usr/lib

Mandriva hardcode the use of /usr/ in the rpm macros file, while Fedora
doesn't, letting people override %_prefix.

-- 
Michael Scherer



More information about the Mageia-discuss mailing list