[TriLUG] RPM: spec file questions

H Brett Bolen wingedlizard at nc.rr.com
Thu Dec 19 17:02:53 EST 2002


I'm building a binary rpm -- but it installs to a user
account.  This is for a navy project, all the user does
is turns on the computer ( I don't even think there is a
login), and the files executed from /home/apbtuser.

I was thinking it might be better to build a src rpm instead
even though it installs binary files, but currently I'm building
a binary rpm.

I've used rpm2cpio but it didn't give the spec file.

Regarding the relative path question, I'm wondering if
I can build the rpm file from a different tree than
I'm working on.  For instance this might be the file
section of the spec file.

    %files
    /home/apbtuser/apbt/bin/blah
    /home/apbtuser/apbt/rtf/blah.xml
    /home/apbtuser/apbt/dat/blah.db

Since I install these to that location ( /home/apbtuser/apbt), I
have to move my dev tree before I can test the rpm build.  Is there
a way I can do something like this

    %files
    ./apbt/bin/blah

or

    %file
    $PATH/apbt/bin/blah

The goal is for it to be easy to build the rpm, and easy to install it.

'Easy' is ill defined -- but generally, I'd like something that 'joe user'
can just extract out of cvs, and build the rpm without having to
worry about permissions, logins, moving directories to switch between
development and test, etc.  ( an exact defination of 'Easy' would be
'makes my boss happy' -- but that is even more ill defined).

much thanks
b

Tanner Lovelace wrote:
> On Thu, 2002-12-19 at 15:49, H Brett Bolen wrote:
> 
>>Is there a way to extract the spec file out of an rpm file?
> 
> 
> I presume you mean out of the source rpm, since they're 
> not stored in the binary rpms. :-)  Yes, you can use
> rpm2cpio to convert the rpm file into a cpio stream
> that you can then use with cpio (which is similar to tar).
> rpm2cpio <rpmfile> | cpio [params] should do the trick.
> See the cpio man file for params.
>  >
>>When I list the files in the spec file, Do I have to use
>>a full pathname -- is there a way to use relative paths
>>( aka  tar cvf MyDir.tar ./MyDir )
> 
> 
> What are you trying to do?  This question is confusing.
>  
> 
>>Is there list of %vars I can use in the spec file?
> 
> 
> You can look in the rpm macros file (generally found
> in /usr/lib/rpm/macros) for a start.
> 
> 
>>Is Maximum RPM still a good source for info?
> 
> 
> Maximum RPM is showing its age these days, but it's
> still a good place for the fundamentals.  I don't
> know for certain, but I think just about everything
> in it will still work.  (If someone knows differently,
> please correct me.)
> 
> Cheers,
> Tanner




More information about the TriLUG mailing list