On Thu, Aug 07, 2003 at 03:33:37AM +0300, Oded Arbel wrote:
> On Thursday 07 August 2003 02:09, Tzafrir Cohen wrote:
> 
> > > > Do I need to make them available on /usr/src and then add them to the
> > > > Kernel SRPM and then re-build it?
> > >
> > > If you want to add patches, you put them in the SOURCES directory under
> > > your RPM build tree (e.g. /usr/src/redhat/SOURCES on redhat,
> > > /usr/src/RPM/SOURCES on mandrake), and then add them to the spec file as
> > > described above. You can then test if they apply correctly by running
> >
> > Regarding the instructions that refered to /usr/src/REDHAT/ : I would
> > recommend against building rpm packages as root. It is bad for your
> > health, especially if you start editing the spec.
> >
> > In order to create packages as a user you need to create some files in
> > your account, though. I know no built-in (in the rpm package) to
> > automate this
> 
> Its no biggy - just create the base directory and define it in our .rpmmacros:
> $_topdir /home/oded/rpm
> 
> now create the directories BUILD, SRPMS and RPMS/<whatever arch you build for> 
> under that root and your set to fo - all other stuff gets generated.

The thing is that if you forget to generate them, rpm will only silently
fail when it needs to. E.g: you finished building your kernel package,
but the binary package was not written, because RPM/RPMS/<arch> does not
exist. Now go and rebuild that kernel package (after you've figured out
this was the problem).

> Building packages as a regular user is recommended for testing, but if you 
> want to build binary packages and distribute them, you'd better do that as 
> root, otherwise you'll have lots of premissions and ownership issues.

Ownership of the files in the cpio archive itself is not relevant. The
permissions on each file are part of the rpm header, and set as part of
the %files part of the spec.

Note: ownership of files is set by user and group names. Not by suer and
group IDs. If when an rpm package is installed a certain user or group
wqith the appropriate name does not exist , root (actually: 0, I figure)
will be used. this will generate an install-time warning.

> 
> > > when you build the binary RPM, don't forget to also build the new source
> > > RPM using the -bs switch, so that you'll have a source RPM with all your
> > > new patches, that you can distribute.

-ba generates both source and binary packages. I tend to always use it
and not -bb to always have something I can continue working on later.

> >
> > But this builds the kernel a number of times with various
> > configurations. How do I tell it to build just for my architecture?
> > Or with my config file?
> 
> It's easy to save the configuration you've setup in the source RPM and make 
> sure that the SPEC file builds the kernel with your configuration. of course, 
> depending on your setup, that config file may or may not cause your generated 
> source RPM to be distributable to other users.
> 
> Mandrake has a complicated setup to allow the same source RPM to be built w/o 
> changes for different architectures - I personally couldn't find head or 
> tails in that mess :-)

Ditto for RH. I asked the same question on redhat's rpm list. The only 
partially useful reply was to use 'make rpm' from the kernel. 

-- 
Tzafrir Cohen                       +---------------------------+
http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
mailto:[EMAIL PROTECTED]       +---------------------------+

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to