Le Thursday 26 May 2005 23:46, dblank@xxxxxxxxxxxx a écrit : > New rpm builder here, so please point me in the right direction if I'm > posting to the wrong group, etc. > > I'm attempting to build some packages, but I would like the initial build > made with the rpmbuild command to go to, say, /usr/local, and then have > the "rpm -i" command put it where ever it defaults. > > The problem is, there seems to be only one default. For example, if I do > this in the SPEC file: > > Prefix: /usr/local > %install > %makeinstall > > Then the files will go into /usr because that is the default: > > % rpm --eval %{_prefix} > /usr > > Of course, that builds fine, and I could then: > > rpm -i --prefix=/usr/local package.rpm > > Now, I can force it to go to /usr/local in the build by doing this: > > %define _prefix /usr/local > Prefix: /usr > %install > %makeinstall > > But, then it isn't relocatable (well, it thinks it is, but --prefix has no > effect). > > So, is there a way to get it to build in /usr/local but then default > correctly when installing? Or I am I just trying to do something that I > shouldn't be doing? Well first, do not mixate %_prefix, the top level of most software (except /etc, /var) and the Prefix tag which allow to rpm change to evilly change some parts of files path to install the software in another tree than the default. Does the relocation is a good thing and doesn't will breaks you software ? If change on the fly the path of some files make the application not working (because it want files in /usr/share and not elsewhere), forget the Prefix tag. On mandriva (was Mandrake and Conectiva), no package are relocatable, and this does not make our distro better or worst. But well, as rpm is dedicated to properly install/erase software in a cleaner way, why do want you want to put it in /usr/local ? useally /usr/local is used for sotfware installed w/o rpm. Finally, if you really want to put the software into /usr/local inside your rpm, redefine %_prefix, %_sysconfdir, %_var, ect... at beginning of your spec or in your ~/.rpmmacros.
Attachment:
pgp2wD2rPbAZ1.pgp
Description: PGP signature