config.status substitutes @localstatedir@ with ${prefix}/var
Panu Matilainen
pmatilai at laiskiainen.org
Wed Mar 6 08:21:17 UTC 2013
On 02/25/2013 11:48 PM, David Abdurachmanov wrote:
> Hi,
Hi,
>
> // 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:./macros.in
>
> 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"
> <snip>
> 1035 S["prefix"]="/build/davidlt/fc18_armv7hl_gcc480/test/tmp/BUILDROOT/ad5e3d2c403c20edd9a562f0ee59097c/opt/cmssw/fc18_armv7hl_gcc480/external/rpm/4.8.0-cms"
>
> macros.in:
>
> 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
Yup, this is an ages old, known flaw in the configure/make process:
building without an explicit --prefix doesn't work correctly. Perhaps I
should finally get around to actually do something about it as this
keeps coming up more and more.
- Panu -
More information about the Rpm-list
mailing list