Discussion:
new/custom installation directory
Eric Blake
2014-11-17 15:19:06 UTC
Permalink
One installation directory choice I haven't found a good solution to is
the ntp.conf file, which is traditionally installed in /etc/ . If there
is an ntp.keys file, it will usually go in /etc/ as well.
In general, folks want the config-related files to be in /etc/ even if
they install the binaries in /usr/local.
While I'd like to use sysconfdir for this I'm concerned about the
hackery I'd need to do to make it work as we expect.
sysconfdir IS the solution you are looking for. A distro will run:

./configure prefix=/ sysconfdir=/etc

and things will just work.
I'm thinking about using ntpconfdir for this, but how to make that work
the way the other paths do hasn't been obvious to me from casual study.
I don't see the point of adding a non-standard variable when the
standard one already works as advertised.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Harlan Stenn
2014-11-18 03:38:57 UTC
Permalink
One installation directory choice I haven't found a good solution to
is the ntp.conf file, which is traditionally installed in /etc/ . If
there is an ntp.keys file, it will usually go in /etc/ as well.
In general, folks want the config-related files to be in /etc/ even
if they install the binaries in /usr/local.
While I'd like to use sysconfdir for this I'm concerned about the
hackery I'd need to do to make it work as we expect.
=2E/configure prefix=3D/ sysconfdir=3D/etc
and things will just work.
Eric, it needs more than that. We might be able to do it with:

--prefix=/ --exec-prefix=/usr/local --sysconfdir=/etc

but that won't work because that also affects datarootdir, includedir,
localstatedir, and sharedstatedir. I need sysconfdir to be $DESTDIR/etc
and all of the others to use $DESTDIR/usr/local/XXX .
I'm thinking about using ntpconfdir for this, but how to make that work
the way the other paths do hasn't been obvious to me from casual study.
I don't see the point of adding a non-standard variable when the
standard one already works as advertised.
If they work as advertised then what is advertised is not what I need in
this case.

H
Gavin Smith
2014-11-18 10:01:14 UTC
Permalink
Post by Harlan Stenn
One installation directory choice I haven't found a good solution to
is the ntp.conf file, which is traditionally installed in /etc/ . If
there is an ntp.keys file, it will usually go in /etc/ as well.
In general, folks want the config-related files to be in /etc/ even
if they install the binaries in /usr/local.
While I'd like to use sysconfdir for this I'm concerned about the
hackery I'd need to do to make it work as we expect.
=2E/configure prefix=3D/ sysconfdir=3D/etc
and things will just work.
--prefix=/ --exec-prefix=/usr/local --sysconfdir=/etc
but that won't work because that also affects datarootdir, includedir,
localstatedir, and sharedstatedir. I need sysconfdir to be $DESTDIR/etc
and all of the others to use $DESTDIR/usr/local/XXX .
What is wrong with

--prefix=/usr/local --sysconfdir=/etc

With

prefix=@prefix@
sysconfdir=@sysconfdir@
datarootdir=@datarootdir@
includedir=@includedir@
localstatedir=@localstatedir@
sharedstatedir=@sharedstatedir@

in Makefile.in, and

AC_INIT
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

in configure.ac, running "./configure --prefix=/usr/local
--sysconfdir=/etc" gives the following in Makefile:

prefix=/usr/local
sysconfdir=/etc
datarootdir=${prefix}/share
includedir=${prefix}/include
localstatedir=${prefix}/var
sharedstatedir=${prefix}/com

which are the values you want.
Harlan Stenn
2014-11-18 10:29:31 UTC
Permalink
Post by Gavin Smith
What is wrong with
--prefix=/usr/local --sysconfdir=/etc
With
in Makefile.in, and
AC_INIT
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
in configure.ac, running "./configure --prefix=/usr/local
prefix=/usr/local
sysconfdir=/etc
datarootdir=${prefix}/share
includedir=${prefix}/include
localstatedir=${prefix}/var
sharedstatedir=${prefix}/com
which are the values you want.
Well, with autoconf-2.69 that works just fine. I have the (possibly
incorrect) recollection that this did not work with (much) older
versions of autoconf and automake.

Now to figure out how to get our per-OS default values for sysconfdir to
be used only in the case where no --sysconfdir=... value was given (in
some way).

That might be:

test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc

Thanks Gavin, and sorry I was being thick, Eric.

H

Loading...