This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
[RFC/PATCH] Install db-Makefile under $prefix
- From: Jonathan Nieder <jrnieder at gmail dot com>
- To: libc-help at sourceware dot org
- Date: Fri, 1 Jul 2011 03:57:00 -0500
- Subject: [RFC/PATCH] Install db-Makefile under $prefix
- References: <20110616012711.16867.qmail@sourceware.org>
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