On Fri, May 25, 2001 at 05:09:01PM -0500, Daniel Manrique wrote:
> > Does anyone have any insight in taking an rpm, modifying a couple files,
> > and repackaging the rpm? I've been reading the rpm man page as I get
> > time, but it's huge, and I'm not interested in rebuilding rpms from
> > source, i'd just like to incorporate our site-specific configurations for
> > stuff like yp, printers, fonts, etc when i install a new host....
> >
> > Has anyone done anything like that with rpm before?
>
> Sure, and that's one of the aims of RPM.
>
> Grab the source RPM (ends in src.rpm), and install it as usual:
>
> rpm -ivh package.src.rpm
>
> stuff gets unpacked in /usr/src/redhat.
Only if you unpacked as root or changed the permissions on
/usr/src/redhat. :-)
The various arcane setup options for rpm are poorly documented, but
there are ways of customising almost everything.
Since I favour doing as little as possible as root (and I use rpms a
lot!), here's how to set it up so that you can do everything as
Jane-Average-User..
(1) In your home directory, create a file called .rpmmacros. This file
should contain the line
%_topdir /home/malcolm/Builds
(well, ok, not exactly that ... fine tune it to your username, etc).
This directory (/home/malcolm/Builds) is going the be used in place of
/usr/src/redhat.
(2) Change to /home/malcolm/Builds and create the necessary
subdirectories:
mkdir BUILD RPMS SOURCES SPECS SRPMS
Note that misspelling any of these will lead to mysterious failures
later on, so don't do that! In case I've made a typo here, the spellings
should be the same as those under /usr/src/redhat. You do not need to
create any other subdirectories. If rpm, for example, wants to put
something inside RPMS/i686, it will create the i686 directory providing
the RPMS one already exists.
Now you can happily do rpm -i ... and rpm -ba..., rpm --rebuild... and
all your other favourite commands without having to have superuser
privileges.
NOTE: There is a bug in rpm (at least as of 4.0.2) whereby the %clean
target doesn't clean up the BUILD directory under this setup. I started
to work on a patch for this about a month ago and got distracted. Maybe
I should go back and finish that (in my infinite amounts of spare time).
For now, you just have to go into /home/malcolm/Builds/BUILD an tidy up
from time to time.
Cheers,
Malcolm
--
Works better when plugged in.
_______________________________________________
techtalk mailing list
[EMAIL PROTECTED]
http://www.linux.org.uk/mailman/listinfo/techtalk