Re: [rpm-list] Trouble with RPM and %{_sysconfdir}.

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

 




On Apr 6, 2007, at 11:24 AM, Kevin Cosgrove wrote:


On 6 April 2007 at 11:11, Jeff Johnson <n3npq.jbj@xxxxxxxxx> wrote:

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

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

My Linux systems are just as Jeff said.  In addition to that I
sometimes use this in a specfile, in cases where my %_prefix is
other than the default AND when the source code is free from
hard-coded paths, or can be patched to be so.

%{expand: %define _sysconfdir %{_prefix}%{_sysconfdir}/somewhere}

If you *have* to do that, try this instead:

    %{expand: %%global _sysconfdir %{_prefix}%{_sysconfdir}/somewhere}

All that the %expand does is reparse its argument, kinda like eval in shell. In this situation, the %{expand: ...} is likely overkill. OTOH, if % {_sysconfdir} or %{_prefix} expansion involved some complicated system(3) invocation, one might want to run the command once, not every time that %{_sysconfdir} or % {_prefix}
was expanded.

The %% insures that the %define is done on the 2nd, not the first, pass. One
of the two % characters is stripped on the first pass.

Using %global insures that the definition is persistent, kinda like using
global rather than automatic storage in C.

But you're likely only need
    %define _sysconfdir %{_prefix}%{_sysconfdir}/somewhere
without all the other goo.

hth

73 de Jeff


Cheers...

--
Kevin


_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux