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

Hoyt Duff hoytduff at gmail.com
Fri Jan 14 06:18:58 CET 2011


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.

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.

On 1/13/11, Remy CLOUARD <shikamaru at mandriva.org> wrote:
> On Thu, Jan 13, 2011 at 09:41:46AM +0200, P. Christeas wrote:
>> On Thursday 13 January 2011, Hoyt Duff wrote:
>> > ...
>> > I contacted the author, who says the rpm will build on Fedora. He
>> > says: "Path error. The .spec file "%define _prefix /usr/local"
>> > (compare with a "./configure --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__
>> >
>> > Can someone point me to where in the Mandriva docs I can find info on
>> > what might be going wrong? Thanks.
>>
>> (by just looking at your mail, no deeper look at rkhunter or else)
>>
>> The prefix should be "/usr", and not explicitly defined in the project's
>> spec.
>> Reason: all software that is installed through distro packages goes to
>> /usr.
>> All other that installs through "./install.sh" or custom hacks goes to
>> "/usr/local"
>> So, make sure that "/usr/local" is _not_ the path passed to ./configure
>> and
>> used to install files onto.
>>
> That’s true.
>
> I would add that we also have preconfigured macro that ensures standard
> directories are respected (among other things).
>
> Could you try using %configure2_5x instead of ./configure ? the prefix
> part should be dropped.
>
> If you are curious about what it does, you could try rpm --eval
> %configure2_5x :-)
>
> Regards,
> --
> Rémy CLOUARD
> () ascii ribbon campaign - against html e-mail
> /\ www.asciiribbon.org - against proprietary attachments
>


-- 
Hoyt


More information about the Mageia-discuss mailing list