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

Re: Trouble with RPM and %{_sysconfdir}.




On Apr 6, 2007, at 10:30 AM, Paul Johnson wrote:

People write spec files using macros, and then the macros on my system
do not generate packages that put files in the correct place.  I
noticed this while packaging ggobi and WindowMaker, and probably in
other packages as well.  WHen people have a statement in the files
section like

%config %{_sysconfdir}/%{name}

the config files end up in the wrong place, in /usr/etc/WindowMaker or
/usr/etc/ggobi.  The authors of those programs claim that the correct
place ought to be

/etc/WindowMaker  or  /etc/ggobi

and inside their programs, there scripts that have hard coded paths
that look for files in those places.


Yep.

Until now, I've just had the habit of editing the spec file to cut out
the usage of %{_sysconfdir}, replacing it with /etc.  But it causes me
to wonder why I'm the only one apparently having this problem, and why
aren't all the RPMS built for Fedora & Fedora extras messed up like
mine, because I've not changed any settings in the rpmbuild macros.


Hacking spec files "works", but is tedious and painful and hacky.
I'm sure we agree. ;-)

I've often wished the RPM system did not allow macros because it is
hard to rebuild packages that some people make because they have
changed their macro definitions.  (Try taking a SRPM file from the
atrpms repository, or something from Mandrake, and you'll see what I
mean.  Unbuildable unless you make a lot of changes in your rpm
system.)  I can see why those problems exist, but I can't understand
this _sysconfidir thing ending up in /usr/etc on my system but in /etc
on others.


Whether you use macros or not is up to you.

Meanwhile, here's what is likely happening:

1) By intent, rpm default macros are just the default values used by autoconf.
Specifically, that means
	%_sysconfidir %{_prefix}/etc
The usual location for the default is /usr/lib/rpm/macros.

2) On linux platforms, there are overrides to rpm defaults. Specifically, that means
        %_sysconfdir /etc
The usual location for the override is /usr/lib/rpm/i386-linux/macros

When a build-machine is not configured correctly, then the override does not occur, and rpm uses the default value, not the linux-specific value, for % _sysconfdir.

The easy fix is to insure that /etc/rpm/platform is correct, and verify whatever
other goo that is being used to configure rpm is correct.

The value for arch on x86_64/amd64/ia32e is usually what rots in /etc/ rpm/platform because of arch aliasing problems. Anaconda, not rpm, writes /etc/rpm/ platform.

The verification for %_sysconfdir is as simple as
    rpm --showrc | grep _sysconfdir

If all else fails, this will change the value of %_sysconfdir for you:

    echo '%_sysconfdir /etc' >> ~/.rpmmacros

73 de Jeff


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