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

Re: redhat-rpm-config



On Wed, Apr 23, 2003 at 03:32:54PM -0400, David Walluck wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Wednesday 23 April 2003 3:09 pm, Jeff Johnson wrote:
> > On Wed, Apr 23, 2003 at 11:52:53AM -0700, Aaron Hanson wrote:
> > > It seems that if /usr/lib/rpm/redhat/macros is present, it overrides
> > > /usr/lib/rpm/macros. This is what I'm seeing. And the redhat glib source
> > > rpm only builds with the redhat version of macros.
> >
> > Yes, overrides, but you claimed no (well strangely) %configure w/o
> > redhat-rpm-config.
> 
> Speaking of overriding macros:
> 
> We need to add our own set of macros to rpm. Previously, this had been 
> complicated, but only involved listing our macros file in one file 
> %{_libdir}/rpm/rpmrc.
> 
> Now with the release of RedHat 9, we specifically look for both 
> %{_libdir}/rpm/rpmrc and %{_libdir}/rpm/redhat/rpmrc. The problem now is that 
> there is no sane way (even with one file) to add macros to rpm. We can't even 
> assume that an additional rc file will take the form of  
> %{_libdir}/rpm/%{_vendor}/rpmrc.
> 

Yup. However, you're better off doing

In /path/to/your/rpmrc
	include: /usr/lib/rpm/rpmrc
	macros: /usr/lib/rpm/macros:...whatever_you_want...:/path/to/your/macros

and invoking rpmbuild as
	rpmbuild --rcfile /path/to/your/rpmrc ...

which won't read anything but /path/to/your/rpmrc for configuration.

> Is there any way planned of making it easier to add custom macros to the 
> system? Maybe a system like /etc/profile.d uses where each macro in that 
> directory is 'sourced' somehow by rpm?
> 

Easier? I'd love to make rpm configuration easier, it's WAY too complicated.

> Currently, I use a script like the following (I'd appreciate any comments):
> 
> postuninstall scriptlet (through /bin/sh):
> if [ "$1" = "0" ]; then
>     for i in /usr/lib/rpm/rpmrc /usr/lib/rpm/redhat/rpmrc; do
>         if test -f "$i" && egrep -q '^macrofiles:.*/etc\/rpm\/macros\.custom' 
> "$i"; then
>             perl -p -i -e 's,(^macrofiles:.*):/etc\/rpm\/macros\.custom,$1,' 
> "$i"
>         fi
>     done
> fi
> 
> triggerin script (through /bin/sh) -- rpm, redhat-rpm-config, 
> /usr/lib/rpm/rpmrc, /usr/lib/rpm/redhat/rpmrc
> for i in /usr/lib/rpm/rpmrc /usr/lib/rpm/redhat/rpmrc; do
>     if test -f "$i" && ! egrep -q '^macrofiles:.*/etc\/rpm\/macros\.custom' 
> "$i"; then
>         perl -p -i -e 's,(^macrofiles:.*$),$1:/etc\/rpm\/macros\.custom,' "$i"
>     fi
> done
> 

Yeah, but just choose the rpm default (which is portable), or choose
the redhat-rpm-config with a PreReq: on the package, there's little
need to chase both.

73 de Jeff

-- 
Jeff Johnson	ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC





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