config.status substitutes @localstatedir@ with ${prefix}/var

David Abdurachmanov david.abd at
Mon Feb 25 21:48:15 UTC 2013


// Using 4.8.0, but same probably applies to 4.11.X

After configuration step I fill macros template manually:

./config.status --file=./macros.test:./

And @localstatedir@ is substituted with not expanded ${prefix}/var:

%_var                   ${prefix}/var

If we look at config.status, we see:

1026 S["localstatedir"]="${prefix}/var"
1035 S["prefix"]="/build/davidlt/fc18_armv7hl_gcc480/test/tmp/BUILDROOT/ad5e3d2c403c20edd9a562f0ee59097c/opt/cmssw/fc18_armv7hl_gcc480/external/rpm/4.8.0-cms"

27 %_usr     @prefix@
28 %_usrsrc    %{_usr}/src
29 %_var     @localstatedir@

Shouldn't we better have @prefix@/var or %{_usr}/var ? The issue could be if someone passes --localstatedir to ./configure, which when would be working correctly. It does sound like --localstatedir must be used on ./configure to generate ``macros'' file correctly.

To check if I am right, I did configure with --prefix $PREFIX and --localstatedir=$PREFIX/var

``macros'' file was generated correctly. 

     27 %_usr                   /build/davidlt/fc18_armv7hl_gcc480/testing3/rpmsw
     28 %_usrsrc                %{_usr}/src
     29 %_var                   /build/davidlt/fc18_armv7hl_gcc480/testing3/rpmsw/var


More information about the Rpm-list mailing list