File nss_db-2.2-db-Makefile.in.patch of Package nss_db
--- Makefile.am~ 2009-09-09 21:44:51.000000000 +0200
+++ Makefile.am 2009-09-09 21:44:51.000000000 +0200
@@ -38,7 +38,7 @@
# shuffle the installed library and the links to it around a bit,
# removing all traces from libtool in the process.
install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(libdir)
+ $(mkinstalldirs) $(DESTDIR){$(libdir),$(slibdir)}
if test -f $(DESTDIR)$(slibdir)/libnss_db.la; then \
rm $(DESTDIR)$(slibdir)/libnss_db.la; fi
if test -f $(DESTDIR)$(slibdir)/libnss_db.so; then \
@@ -54,11 +54,3 @@
rm -f $(DESTDIR)$(libdir)/libnss_db.so; fi
$(srcdir)/rellns-sh $(DESTDIR)$(slibdir)/libnss_db.so.$(INTERFACE) \
$(DESTDIR)$(libdir)/libnss_db.so
- cp db-Makefile db-Makefile.orig
- if test "$(localstatedir)" = '$(prefix)/var'; then \
- install -m 644 -D db-Makefile /var/db/Makefile; \
- else \
- sed -i -e "s@/var/db@$(localstatedir)@" db-Makefile; \
- install -m 644 -D db-Makefile $(localstatedir)/Makefile; fi
- cp db-Makefile.orig db-Makefile
-
--- configure.in~ 2009-09-09 21:48:59.000000000 +0200
+++ configure.in 2009-09-09 21:48:59.000000000 +0200
@@ -84,7 +84,10 @@
libdir='${exec_prefix}/lib64';
fi
else
- slibdir="/lib"
+ case ${build_cpu} in
+ ia64 | x86_64) slibdir="/lib64" ;;
+ *) slibdir="/lib" ;;
+ esac
fi
fi
;;
@@ -105,4 +105,6 @@
AC_SUBST(DB_CFLAGS)
AC_SUBST(DB_LIBS)
AC_SUBST(slibdir)
+AC_SUBST(prefix)
+AC_OUTPUT(db-Makefile)
AC_OUTPUT(Makefile)
--- db-Makefile.in.bak 1970-01-01 01:00:00.000000000 +0100
+++ db-Makefile.in 2009-09-09 21:56:40.000000000 +0200
@@ -0,0 +1,138 @@
+# Makefile to (re-)generate db versions of system database files.
+# Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Library General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Library General Public License for more details.
+#
+# You should have received a copy of the GNU Library General Public
+# License along with the GNU C Library; see the file COPYING.LIB. If not,
+# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA. */
+
+DATABASES = $(wildcard /etc/passwd /etc/group /etc/ethers /etc/protocols \
+ /etc/rpc /etc/services /etc/shadow /etc/netgroup)
+
+VAR_DB = @localstatedir@
+
+AWK = awk
+MAKEDB = makedb --quiet
+
+all: $(patsubst %,$(VAR_DB)/%.db,$(notdir $(DATABASES)))
+
+
+$(VAR_DB)/passwd.db: /etc/passwd
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS=":"; OFS=":"; cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$3; print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/group.db: /etc/group
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS=":"; OFS=":"; cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$3; print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/ethers.db: /etc/ethers
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/protocols.db: /etc/protocols
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print; \
+ for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s ", $$i; print } }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/rpc.db: /etc/rpc
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print; \
+ for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s ", $$i; print } }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/services.db: /etc/services
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS="[ \t/]+"; cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { printf ".%s/%s ", $$1, $$3; print; \
+ printf ".%s/ ", $$1; print; \
+ printf "=%s/%s ", $$2, $$3; print; \
+ printf "=%s/ ", $$2; print; \
+ for (i = 4; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s/%s ", $$i, $$3; print; \
+ printf ".%s/ ", $$i; print } }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/shadow.db: /etc/shadow
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS=":"; OFS=":"; cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
+ (umask 077 && $(MAKEDB) -o $@ -)
+ @echo "done."
+ @if chgrp shadow $@ 2>/dev/null; then \
+ chmod g+r $@; \
+ else \
+ chown 0 $@; chgrp 0 $@; chmod 600 $@; \
+ echo; \
+ echo "Warning: The shadow password database $@"; \
+ echo "has been set to be readable only by root. You may want"; \
+ echo "to make it readable by the \`shadow' group depending"; \
+ echo "on your configuration."; \
+ echo; \
+ fi
+
+$(VAR_DB)/netgroup.db: /etc/netgroup
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { cnt=0 } \
+ /^[ \t]*$$/ { next } \
+ /^[ \t]*#/ { next } \
+ { printf "0%u ", cnt++; print } \
+ /^[^#]/ { end=sub(/\\/, " "); \
+ gsub(/[ \t]+/, " "); \
+ if(end == 1) printf "%s", $$0; else print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."