[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
- From: "Dennis McRitchie" <dmcr Princeton EDU>
- To: <rpm-list redhat com>
- Subject: RE: How to build rpm to point to unique config files, macros, and db
- Date: Wed, 3 Sep 2003 17:00:50 -0400
Thanks very much for the reply Jeff.
BTW, I did figure out how the rpmrc file defaults are compiled in strings,
and saw a minor problem that I wanted to point out.
On or about line 23,301 of the "configure" script, the following code
appears:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
SYSCONFIGDIR="`echo /etc/rpm`"
cat >>confdefs.h <<_ACEOF
#define SYSCONFIGDIR "$SYSCONFIGDIR"
_ACEOF
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Because this code does not make use of the "$sysconfdir" variable, the
substitutions of SYSCONFIGDIR always define the secondary macro files as
being in /etc, regardless of what command line arguments were passed to the
"configure" script, per the code below.
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
MACROFILES="${RPMCONFIGDIR}/macros:${RPMCONFIGDIR}/%{_target_platform}/macro
s:${SYSCONFIGDIR}/macros:${SYSCONFIGDIR}/macros.specspo:${SYSCONFIGDIR}/macr
os.db1:${SYSCONFIGDIR}/%{_target_platform}/macros:~/.rpmmacros"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Ideally, something more like:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
SYSCONFIGDIR="`echo {$sysconfdir}/rpm`"
cat >>confdefs.h <<_ACEOF
#define SYSCONFIGDIR "$SYSCONFIGDIR"
_ACEOF
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
would be better in that the location of the secondary macro files could then
be controlled by the --sysconfdir argument. I realize that this change would
break "configure" for the normal case where --prefix is not set (since
sysconfdir defaults to "$prefix/etc"), but I thought I would mention it to
you anyway in case you can think of a way to control the location of these
files without breaking backward compatibility.
Perhaps the sysconfdir default could be changed to be /etc unless --prefix
was specified (at which point it would revert to $prefix/etc), for example.
Then the above code change would not break "configure" in the default case,
though there would still some risk if anyone was counting on sysconfdir
being /usr/etc in the default --prefix case, or counting on the secondary
macro file locations being in /etc in the non-default --prefix case.
Alternately, perhaps there could be a new argument type on the configure
command line to control SYSCONFIGDIR. But it would be nice to be able to
control the location of these files automatically without having to edit the
master rpmrc file directly.
Just my $0.02.
Thanks again for your help.
Dennis
-----Original Message-----
From: rpm-list-admin@redhat.com [mailto:rpm-list-admin@redhat.com]On
Behalf Of Jeff Johnson
Sent: Tuesday, September 02, 2003 12:06 PM
To: rpm-list@redhat.com
Subject: 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
_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://www.redhat.com/mailman/listinfo/rpm-list
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[]