[RFC/PATCH] Install db-Makefile under $prefix

Jonathan Nieder jrnieder@gmail.com
Fri Jul 1 08:57:00 GMT 2011


After commit 77fb9117 (Install db-Makefile, 2011-06-15), trying to
install as an unprivileged user with "../configure
--prefix=$HOME/glibc-test && make && make install" fails for lack of
privilege to write files under /var.

"make install" should not be writing files outside of $prefix anyway.
Fix it by using localstatedir (which defaults to $prefix/var) instead
of /var in the path for nss db files.

This is not enough to get nss_db working in configurations with
nonempty prefix, since db-Makefile and the nscd code still hard-code
the absolute path /var/db.  Fixing that can wait for another day.
---
Hi,

"make install" failed when I tried it today; hopefully this patch can
help.  Probably not usable as-is because distros would need to be
updated to pass

	--localstatedir=/var

Any autoconf experts have hints about where to put logic to set that
up automatically?  Other thoughts?

2011-07-01  Jonathan Nieder  <jrnieder@gmail.com>

	* Makeconfig: Prepend $(prefix) to vardbdir by defining the
	latter in terms of localstatedir.

 Makeconfig |    6 +++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/Makeconfig b/Makeconfig
index cc5c3a9f..72404573 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -291,9 +291,13 @@ sysconfdir = $(prefix)/etc
 endif
 inst_sysconfdir = $(install_root)$(sysconfdir)
 
+ifndef localstatedir
+localstatedir = $(prefix)/var
+endif
+
 # Directory for the database files and Makefile for nss_db.
 ifndef vardbdir
-vardbdir = /var/db
+vardbdir = $(localstatedir)/db
 endif
 inst_vardbdir = $(install_root)$(vardbdir)
 
-- 
1.7.6



More information about the Libc-help mailing list