about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Makeconfig6
-rw-r--r--nss/Makefile5
3 files changed, 14 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 33d9706a5d..e7bfbb88d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-06-15  Ulrich Drepper  <drepper@gmail.com>
 
+	* Makeconfig: Define vardbdir and inst_vardbdir.
+	* nss/Makefile: Add rules to install db-Makefile.
+
 	* nss/nss_db/db-XXX.c: Cleanup.
 
 	* nss/Makefile (libnss_db-dbs): Add db-initgroups.
diff --git a/Makeconfig b/Makeconfig
index b34cacfa7a..cc5c3a9ffb 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -291,6 +291,12 @@ sysconfdir = $(prefix)/etc
 endif
 inst_sysconfdir = $(install_root)$(sysconfdir)
 
+# Directory for the database files and Makefile for nss_db.
+ifndef vardbdir
+vardbdir = /var/db
+endif
+inst_vardbdir = $(install_root)$(vardbdir)
+
 # What timezone should be the installed default (e.g., US/Eastern).
 # Run `make -C time echo-zonenames' to see a list of available zone names.
 # The local timezone can be changed with `zic -l TIMEZONE' at any time.
diff --git a/nss/Makefile b/nss/Makefile
index f6065cc2b8..60c65492ff 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -78,6 +78,8 @@ generated		+= $(filter-out db-alias.c db-netgrp.c, \
 					$(addsuffix .c,$(libnss_db-dbs)))
 distribute		+= $(addprefix nss_db/, db-XXX.c nss_db.h)
 
+install-others		+= $(inst_vardbdir)/Makefile
+
 # Build static module if requested
 ifneq ($(build-static-nss),yes)
 libnss_files-inhibit-o	= $(filter-out .os,$(object-suffixes))
@@ -114,6 +116,9 @@ $(libnss_db-dbs:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
 
 $(objpfx)makedb: $(makedb-modules:%=$(objpfx)%.o)
 
+$(inst_vardbdir)/Makefile: db-Makefile $(+force)
+	$(do-install)
+
 distribute		+= nss_test1.c
 
 CFLAGS-nss_test1.c = -DNOT_IN_libc=1