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

Re: How to build rpm to point to unique config files, macros, and db



Dennis McRitchie wrote:

It would seem that incipient brain-rot caused me to write the silly first
para in my previous post. I was conflating two unrelated parts of the
project. What we are actually trying to do - that relates to this post - is
to create multiple mounted file systems (one for RH 9, one for Solaris 8,
etc.) with standard sets of installed packages on them for use by our user
community. To install these packages on the mounted file systems, I would
like to have builds of the rpm program (one per OS) that point to a unique
"rpmrc" and "macros" files, as well as to a unique rpm DB, by *default*. I
would prefer not to have to use --rcfile.

I have been unsuccessful so far in figuring out how rpm knows where to look
for its config files and db. Any pointers would be very much appreciated.

Thanks,
      Dennis

-----Original Message-----
From: rpm-list-admin@redhat.com [mailto:rpm-list-admin@redhat.com]On
Behalf Of Dennis McRitchie
Sent: Friday, August 29, 2003 4:36 PM
To: rpm-list@redhat.com
Subject: How to build rpm to point to unique config files, macros, and
db


Hi,


We are in the process of developing a repository of rpm packages for
multiple OSs. Each OS's repository will be NFS-mountable from any user's
machine running that OS, and users must then be able to execute the instance
of rpm residing in that repository to install any of the packages recorded
in that rpm instance's db.

Aside from the need to build (and adapt) rpm for each OS, and (for non-Linux
OSs) to populate the rpm db with the OS-provided packages, I am having
difficulty in figuring out how rpm determines the location of its master
rpmrc file (usually in /usr/lib), and the location of its db.

As a test, I built rpm under Linux using the sources within the 4.2 src rpm
file. I mimicked what the rpm.spec file does in terms of passing arguments
to "configure", amending them to point to the real install target within my
repository. I then executed "make" and "make install", and everything went
where it should, including the normal contents of "/usr/bin", /usr/lib" and
/usr/lib/rpm".

However, when I execute that instance of rpm using "rpm --showrc" it is
still looking in /usr/lib to find its rpmrc file. (It also still points to
/usr/lib/rpm/macros and to the /etc directory on the "macrofiles" line, but
I can edit that manually if need be.)

What do I need to do to get rpm to look at "/<my-repository>/lib/rpmrc" by
default instead of /usr/lib/rpmrc?



--rcfile only way, "default" is compiled in strings, overrdden with --rcfile rpmrc1:rpmrc2:...
Yes, colon seperated paths to multiple rpmrc files, only the 1st of which must exist.


And can I assume that once I get it to do that, that it will also look for
its db in "/<my-repository>/lib/rpm"?



Add --dbpath to override, better might be to add --root wich will be used as prefix to
/var/lib/rpm.


Something like shell wrappers is best way. Say "solrpm" is script to manage
your solaris tree mounted at /sol, conatins

   #!/bin/sh
   root=/sol
   rcpath="$root/usr/lib/rpm/rpmrc:$root/etc/rpmrc"

exec rpm --rcfile $rcpath --root $root $*

Note: you will need to exec something other than /sol/bin/sh if managing sparc tree on non-sparc,
but you'll need to figger arch/os matches first too.


73 de Jeff





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