%{_prefix} vs Prefix: and relocatable packages (was: cmake rpm macro(s):)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 20, 2007 at 01:48:45PM +0000, Kevin Kofler wrote:
> Axel Thimm <Axel.Thimm <at> ATrpms.net> writes:
> > > Won't setting %{_prefix} make the package relocatable?
> > 
> > At build time? No, it won't, and for truly being relocatable the
> > package needs to support this at runtime, e.g. the build should not
> > hardwire /usr and friends anywhere. Being relocatabale needs a lot of
> > work at the source level.
> 
> No, my question was if it will make RPM _think_ the package is relocatable, 
> even if it actually is not, which of course will screw up badly if the user 
> really tries to relocate the package.

I understand what you mean - no, setting _prefix does not make a
package relocatable. The long version follows:

Packages become relocatable by having a

Prefix: ...

tag. That's not how _prefix is set, _prefix is set like

%_prefix /usr

under /usr/lib/rpm somewhere, or even by %define _prefix ... in the
specfile.

You will sometimes find

Prefix: /
or
Prefix: /usr
or
Prefix: %{_prefix}

That doesn't really set prefix, it tells rpm that you promise to
install everything under that folder and nowhere else outside of it
(rpmbuild will bail out otherwise) and that that part of the buildroot
is relocatable.

Is it clearer or did I add to the confusion :)
-- 
Axel.Thimm at ATrpms.net

Attachment: pgpxrrY6w2cD4.pgp
Description: PGP signature

--
Fedora-packaging mailing list
Fedora-packaging@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-packaging

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux